Skip to content

Commit 0d4ae12

Browse files
erwangokartben
authored andcommitted
boards: st: Add support for the nucleo_n657x0_q
Add support for the nucleo_n657x0_q board. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent 865fbbc commit 0d4ae12

File tree

8 files changed

+357
-0
lines changed

8 files changed

+357
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# STM32N657X0_Q Nucleo board configuration
2+
3+
# Copyright (c) 2024 STMicroelectronics
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_NUCLEO_N657X0_Q
7+
select SOC_STM32N657XX

boards/st/nucleo_n657x0_q/board.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2024 STMicroelectronics
3+
4+
board_runner_args(stm32cubeprogrammer "--port=swd")
5+
board_runner_args(stm32cubeprogrammer "--tool-opt= mode=HOTPLUG ap=1")
6+
board_runner_args(stm32cubeprogrammer "--extload=MX25UM51245G_STM32N6570-NUCLEO.stldr")
7+
board_runner_args(stm32cubeprogrammer "--download-address=0x70000000")
8+
9+
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)

boards/st/nucleo_n657x0_q/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: nucleo_n657x0_q
3+
full_name: Nucleo N657x0-Q
4+
vendor: st
5+
socs:
6+
- name: stm32n657xx
Binary file not shown.
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
.. zephyr:board:: nucleo_n657x0_q
2+
3+
Overview
4+
********
5+
6+
The STM32 Nucleo-144 board provides an affordable and flexible way for users to try out
7+
new concepts and build prototypes by choosing from the various combinations of performance
8+
and power consumption features, provided by the STM32 microcontroller. For the compatible boards,
9+
the internal or external SMPS significantly reduces power consumption in Run mode.
10+
11+
The ST Zio connector, which extends the ARDUINO® Uno V3 connectivity, and the ST morpho headers
12+
provide an easy means of expanding the functionality of the Nucleo open development platform with
13+
a wide choice of specialized shields.
14+
15+
The STM32 Nucleo-144 board does not require any separate probe as it integrates the ST-LINK
16+
debugger/programmer.
17+
18+
The STM32 Nucleo-144 board comes with the STM32 comprehensive free software libraries and
19+
examples available with the STM32Cube MCU Package.
20+
21+
Hardware
22+
********
23+
24+
- Common features:
25+
26+
- STM32 microcontroller in an LQFP144, TFBGA225, or VFBGA264 package
27+
- 3 user LEDs
28+
- 1 user push-button and 1 reset push-button
29+
- 32.768 kHz crystal oscillator
30+
- Board connectors:
31+
32+
- SWD
33+
- ST morpho expansion connector
34+
35+
- Flexible power-supply options: ST-LINK USB VBUS, USB connector, or external sources
36+
37+
- Features specific to some of the boards (refer to the ordering information section
38+
of the data brief for details);
39+
40+
- External or internal SMPS to generate Vcore logic supply
41+
- Ethernet compliant with IEEE-802.3-2002
42+
- USB Device only, USB OTG full speed, or SNK/UFP (full-speed or high-speed mode)
43+
- Board connectors:
44+
45+
- ARDUINO® Uno V3 connector or ST Zio expansion connector including ARDUINO® Uno V3
46+
- Camera module FPC
47+
- MIPI20 compatible connector with trace signals
48+
- USB with Micro-AB or USB Type-C®
49+
- Ethernet RJ45
50+
51+
- On-board ST-LINK (STLINK/V2-1, STLINK-V3E, or STLINK-V3EC) debugger/programmer with
52+
USB re-enumeration capability: mass storage, Virtual COM port, and debug port
53+
54+
Supported Features
55+
==================
56+
57+
The Zephyr ``nucleo_n657x0_q`` board supports the following hardware features:
58+
59+
+-----------+------------+-------------------------------------+
60+
| Interface | Controller | Driver/Component |
61+
+===========+============+=====================================+
62+
| CLOCK | on-chip | reset and clock control |
63+
+-----------+------------+-------------------------------------+
64+
| GPIO | on-chip | gpio |
65+
+-----------+------------+-------------------------------------+
66+
| NVIC | on-chip | nested vector interrupt controller |
67+
+-----------+------------+-------------------------------------+
68+
| UART | on-chip | serial port-polling; |
69+
| | | serial port-interrupt |
70+
+-----------+------------+-------------------------------------+
71+
72+
73+
Other hardware features are not yet supported on this Zephyr port.
74+
75+
The default configuration can be found in the defconfig file:
76+
:zephyr_file:`boards/st/nucleo_n657x0_q/nucleo_n657x0_q_defconfig`
77+
78+
79+
Connections and IOs
80+
===================
81+
82+
NUCLEO_N657X0_Q Board has 12 GPIO controllers. These controllers are responsible
83+
for pin muxing, input/output, pull-up, etc.
84+
85+
For more details please refer to `NUCLEO_N657X0_Q User Manual`_.
86+
87+
Default Zephyr Peripheral Mapping:
88+
----------------------------------
89+
90+
- LD1 : PO1
91+
- LD2 : PG10
92+
- USART_1_TX : PE5
93+
- USART_1_RX : PE6
94+
95+
System Clock
96+
------------
97+
98+
NUCLEO_N657X0_Q System Clock could be driven by internal or external oscillator,
99+
as well as main PLL clock. By default System clock is driven by PLL clock at
100+
400MHz, driven by 64MHz high speed internal oscillator.
101+
102+
Serial Port
103+
-----------
104+
105+
NUCLEO_N657X0_Q board has 10 U(S)ARTs. The Zephyr console output is assigned to
106+
USART1. Default settings are 115200 8N1.
107+
108+
Programming and Debugging
109+
*************************
110+
111+
NUCLEO_N657X0_Q board includes an ST-LINK/V3 embedded debug tool interface.
112+
This probe allows to flash the board using various tools.
113+
114+
Flashing
115+
========
116+
117+
The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
118+
so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
119+
Version 2.18.0 or later of `STM32CubeProgrammer`_ is required.
120+
121+
Flashing an application to NUCLEO_N657X0_Q
122+
------------------------------------------
123+
124+
Connect the NUCLEO_N657X0_Q to your host computer using the USB port.
125+
Then build and flash an application.
126+
127+
.. note::
128+
For flashing, BOOT0 pin should be set to 0 and BOOT1 to 1 before powering on
129+
the board.
130+
131+
To run the application after flashing, BOOT1 should be set to 0 and the board
132+
should be powered off and on again.
133+
134+
Here is an example for the :zephyr:code-sample:`hello_world` application.
135+
136+
Run a serial host program to connect with your Nucleo board:
137+
138+
.. code-block:: console
139+
140+
$ minicom -D /dev/ttyACM0
141+
142+
Then build and flash the application.
143+
144+
.. zephyr-app-commands::
145+
:zephyr-app: samples/hello_world
146+
:board: nucleo_n657x0_q
147+
:goals: build flash
148+
149+
You should see the following message on the console:
150+
151+
.. code-block:: console
152+
153+
Hello World! nucleo_n657x0_q/stm32n657xx
154+
155+
Debugging
156+
=========
157+
158+
For now debugging is only available through STM32CubeIDE:
159+
* Go to File > Import and select C/C++ > STM32 Cortex-M Executable
160+
* In Executable field, browse to your <ZEPHYR_PATH>/build/zephyr/zephyr.elf
161+
* In MCU field, select STM32N657X0HxQ.
162+
* Click on Finish
163+
* Then click on Debug to start the debugging session
164+
165+
.. note::
166+
For debugging, BOOT0 pin should be set to 0 and BOOT1 to 1 before powering on the
167+
board.
168+
169+
.. _NUCLEO_N657X0_Q website:
170+
https://www.st.com/en/evaluation-tools/nucleo-n657x0-q.html
171+
172+
.. _NUCLEO_N657X0_Q User Manual:
173+
https://www.st.com/resource/en/user_manual/um3417-stm32n6-nucleo144-board-mb1940-stmicroelectronics.pdf
174+
175+
.. _STM32N657X0 on www.st.com:
176+
https://www.st.com/en/microcontrollers-microprocessors/stm32n657x0.html
177+
178+
.. _STM32N657 reference manual:
179+
https://www.st.com/resource/en/reference_manual/rm0486-stm32n647657xx-armbased-32bit-mcus-stmicroelectronics.pdf
180+
181+
.. _STM32CubeProgrammer:
182+
https://www.st.com/en/development-tools/stm32cubeprog.html
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
/*
2+
* Copyright (c) 2024 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <st/n6/stm32n657X0.dtsi>
9+
#include <st/n6/stm32n657x0hxq-pinctrl.dtsi>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
12+
/ {
13+
model = "STMicroelectronics STM32N657X0-Q-NUCLEO board";
14+
compatible = "st,stm32n657x0-q-nucleo";
15+
16+
chosen {
17+
zephyr,console = &usart1;
18+
zephyr,shell-uart = &usart1;
19+
zephyr,sram = &axisram2;
20+
};
21+
22+
leds: leds {
23+
compatible = "gpio-leds";
24+
25+
green_led: led_1 {
26+
gpios = <&gpiog 0 GPIO_ACTIVE_HIGH>;
27+
label = "User LD6";
28+
};
29+
30+
blue_led: led_2 {
31+
gpios = <&gpiog 8 GPIO_ACTIVE_HIGH>;
32+
label = "User LD7";
33+
};
34+
35+
red_led: led_3 {
36+
gpios = <&gpiog 10 GPIO_ACTIVE_HIGH>;
37+
label = "User LD5";
38+
};
39+
};
40+
41+
gpio_keys {
42+
compatible = "gpio-keys";
43+
44+
user_button: button_0 {
45+
gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
46+
label = "User SB1";
47+
zephyr,code = <INPUT_KEY_0>;
48+
};
49+
};
50+
51+
aliases {
52+
led0 = &green_led;
53+
sw0 = &user_button;
54+
};
55+
};
56+
57+
&clk_hsi {
58+
hsi-div = <1>;
59+
status = "okay";
60+
};
61+
62+
&pll1 {
63+
clocks = <&clk_hsi>;
64+
div-m = <4>;
65+
mul-n = <75>;
66+
div-p1 = <1>;
67+
div-p2 = <1>;
68+
status = "okay";
69+
};
70+
71+
&ic1 {
72+
pll-src = <1>;
73+
ic-div = <2>;
74+
status = "okay";
75+
};
76+
77+
&ic2 {
78+
pll-src = <1>;
79+
ic-div = <3>;
80+
status = "okay";
81+
};
82+
83+
&ic6 {
84+
pll-src = <1>;
85+
ic-div = <2>;
86+
status = "okay";
87+
};
88+
89+
&ic11 {
90+
pll-src = <1>;
91+
ic-div = <3>;
92+
status = "okay";
93+
};
94+
95+
&perck {
96+
clocks = <&rcc STM32_SRC_HSI PER_SEL(0)>;
97+
status = "okay";
98+
};
99+
100+
&cpusw {
101+
clocks = <&rcc STM32_SRC_IC1 CPU_SEL(3)>;
102+
clock-frequency = <DT_FREQ_M(600)>;
103+
status = "okay";
104+
};
105+
106+
&rcc {
107+
/* ic2, ic6 & ic11 must all be enabled to set ic2 as SYSCLK */
108+
clocks = <&ic2>;
109+
clock-frequency = <DT_FREQ_M(400)>;
110+
ahb-prescaler = <2>;
111+
apb1-prescaler = <1>;
112+
apb2-prescaler = <1>;
113+
apb4-prescaler = <1>;
114+
apb5-prescaler = <1>;
115+
};
116+
117+
&usart1 {
118+
clocks = <&rcc STM32_CLOCK(APB2, 4)>,
119+
<&rcc STM32_SRC_CKPER USART1_SEL(1)>;
120+
pinctrl-0 = <&usart1_tx_pe5 &usart1_rx_pe6>;
121+
pinctrl-names = "default";
122+
current-speed = <115200>;
123+
status = "okay";
124+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
identifier: nucleo_n657x0_q
2+
name: ST Nucleo N657X0-Q
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
- xtools
9+
ram: 1024
10+
flash: 0
11+
supported:
12+
- gpio
13+
- uart
14+
vendor: st
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2024 STMicroelectronics
3+
4+
# Enable UART driver
5+
CONFIG_SERIAL=y
6+
7+
# Enable GPIO
8+
CONFIG_GPIO=y
9+
10+
# Console
11+
CONFIG_CONSOLE=y
12+
CONFIG_UART_CONSOLE=y
13+
14+
# No internal Flash
15+
CONFIG_XIP=n

0 commit comments

Comments
 (0)