Skip to content

Commit 17c7303

Browse files
erwangokartben
authored andcommitted
boards: stm32n6: Document sb variant and testing using twister
Update stm32n6 based boards documentation to reflect addition of new sb variant and how it could be used for twister tests automation. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent d37a365 commit 17c7303

File tree

2 files changed

+198
-60
lines changed

2 files changed

+198
-60
lines changed

boards/st/nucleo_n657x0_q/doc/index.rst

Lines changed: 102 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Overview
44
********
55

6-
The STM32 Nucleo-144 board provides an affordable and flexible way for users to try out
6+
The NUCLEO-N657X0-Q board provides an affordable and flexible way for users to try out
77
new concepts and build prototypes by choosing from the various combinations of performance
88
and power consumption features, provided by the STM32 microcontroller. For the compatible boards,
99
the internal or external SMPS significantly reduces power consumption in Run mode.
@@ -12,7 +12,7 @@ The ST Zio connector, which extends the ARDUINO® Uno V3 connectivity, and the S
1212
provide an easy means of expanding the functionality of the Nucleo open development platform with
1313
a wide choice of specialized shields.
1414

15-
The STM32 Nucleo-144 board does not require any separate probe as it integrates the ST-LINK
15+
The NUCLEO-N657X0-Q board does not require any separate probe as it integrates the ST-LINK
1616
debugger/programmer.
1717

1818
The STM32 Nucleo-144 board comes with the STM32 comprehensive free software libraries and
@@ -51,6 +51,12 @@ Hardware
5151
- On-board ST-LINK (STLINK/V2-1, STLINK-V3E, or STLINK-V3EC) debugger/programmer with
5252
USB re-enumeration capability: mass storage, Virtual COM port, and debug port
5353

54+
For more details, please refer to:
55+
56+
* `NUCLEO-N657X0-Q website`_
57+
* `STM32N657X0 on www.st.com`_
58+
* `STM32N657 reference manual`_
59+
5460
Supported Features
5561
==================
5662

@@ -79,10 +85,10 @@ The default configuration can be found in the defconfig file:
7985
Connections and IOs
8086
===================
8187

82-
NUCLEO_N657X0_Q Board has 12 GPIO controllers. These controllers are responsible
88+
NUCLEO-N657X0-Q Board has 12 GPIO controllers. These controllers are responsible
8389
for pin muxing, input/output, pull-up, etc.
8490

85-
For more details please refer to `NUCLEO_N657X0_Q User Manual`_.
91+
For more details please refer to `NUCLEO-N657X0-Q User Manual`_.
8692

8793
Default Zephyr Peripheral Mapping:
8894
----------------------------------
@@ -95,83 +101,147 @@ Default Zephyr Peripheral Mapping:
95101
System Clock
96102
------------
97103

98-
NUCLEO_N657X0_Q System Clock could be driven by internal or external oscillator,
104+
NUCLEO-N657X0-Q System Clock could be driven by internal or external oscillator,
99105
as well as main PLL clock. By default System clock is driven by PLL clock at
100106
400MHz, driven by 64MHz high speed internal oscillator.
101107

102108
Serial Port
103109
-----------
104110

105-
NUCLEO_N657X0_Q board has 10 U(S)ARTs. The Zephyr console output is assigned to
111+
NUCLEO-N657X0-Q board has 10 U(S)ARTs. The Zephyr console output is assigned to
106112
USART1. Default settings are 115200 8N1.
107113

108114
Programming and Debugging
109115
*************************
110116

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.
117+
NUCLEO-N657X0-Q board includes an ST-LINK/V3 embedded debug tool interface.
118+
This probe allows to flash and debug the board using various tools.
119+
113120

114-
Flashing
115-
========
116121

117-
The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
118-
so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
122+
Flashing or loading
123+
===================
124+
125+
The board is configured to be programmed using west `STM32CubeProgrammer`_ runner,
126+
so its :ref:`installation <stm32cubeprog-flash-host-tools>` is needed.
119127
Version 2.18.0 or later of `STM32CubeProgrammer`_ is required.
120128

121-
Flashing an application to NUCLEO_N657X0_Q
122-
------------------------------------------
129+
To program the board, there are two options:
130+
131+
- Program the firmware in external flash. At boot, it will then be loaded on RAM
132+
and executed from there.
133+
- Optionally, it can also be taken advantage from the serial boot interface provided
134+
by the boot ROM. In that case, firmware is directly loaded in RAM and executed from
135+
there. It is not retained.
136+
137+
Programming an application to NUCLEO-N657X0-Q
138+
---------------------------------------------
139+
140+
Here is an example to build and run :zephyr:code-sample:`hello_world` application.
141+
142+
First, connect the NUCLEO-N657X0-Q to your host computer using the ST-Link USB port.
123143

124-
Connect the NUCLEO_N657X0_Q to your host computer using the USB port.
125-
Then build and flash an application.
144+
.. tabs::
145+
146+
.. group-tab:: ST-Link
147+
148+
Build and flash an application using ``nucleo_n657x0_q`` target.
149+
150+
.. zephyr-app-commands::
151+
:zephyr-app: samples/hello_world
152+
:board: nucleo_n657x0_q
153+
:goals: build flash
126154

127155
.. note::
128-
For flashing, BOOT0 pin should be set to 0 and BOOT1 to 1 before powering on
129-
the board.
156+
For flashing, before powering the board, set the boot pins in the following configuration:
157+
158+
* BOOT0: 0
159+
* BOOT1: 1
130160

131-
To run the application after flashing, BOOT1 should be set to 0 and the board
132-
should be powered off and on again.
161+
After flashing, to run the application, set the boot pins in the following configuration:
133162

134-
Here is an example for the :zephyr:code-sample:`hello_world` application.
163+
* BOOT1: 0
135164

136-
Run a serial host program to connect with your Nucleo board:
165+
Power off and on the board again.
166+
167+
Run a serial host program to connect to your board:
137168

138169
.. code-block:: console
139170
140171
$ minicom -D /dev/ttyACM0
141172
142-
Then build and flash the application.
173+
.. group-tab:: Serial Boot Loader (USB)
174+
175+
Additionally, connect the NUCLEO-N657X0-Q to your host computer using the USB port.
176+
In this configuration, ST-Link is used to power the board and for serial communication
177+
over the Virtual COM Port.
178+
179+
.. note::
180+
Before powering the board, set the boot pins in the following configuration:
181+
182+
* BOOT0: 1
183+
* BOOT1: 0
184+
185+
Build and load an application using ``nucleo_n657x0_q/stm32n657xx/sb`` target (you
186+
can also use the shortened form: ``nucleo_n657x0_q//sb``)
143187
144188
.. zephyr-app-commands::
145189
:zephyr-app: samples/hello_world
146190
:board: nucleo_n657x0_q
147191
:goals: build flash
148192

193+
194+
Run a serial host program to connect to your board:
195+
196+
.. code-block:: console
197+
198+
$ minicom -D /dev/ttyACM0
199+
149200
You should see the following message on the console:
150201

151202
.. code-block:: console
152203
153204
Hello World! nucleo_n657x0_q/stm32n657xx
154205
206+
155207
Debugging
156208
=========
157209

158210
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
211+
212+
* Go to File > Import and select C/C++ > STM32 Cortex-M Executable.
213+
* In Executable field, browse to your <ZEPHYR_PATH>/build/zephyr/zephyr.elf.
161214
* In MCU field, select STM32N657X0HxQ.
162-
* Click on Finish
163-
* Then click on Debug to start the debugging session
215+
* Click on Finish.
216+
* Finally, click on Debug to start the debugging session.
164217

165218
.. note::
166-
For debugging, BOOT0 pin should be set to 0 and BOOT1 to 1 before powering on the
167-
board.
219+
For debugging, before powering on the board, set the boot pins in the following configuration:
220+
221+
* BOOT0: 0
222+
* BOOT1: 1
223+
224+
225+
Running tests with twister
226+
==========================
168227

169-
.. _NUCLEO_N657X0_Q website:
228+
Due to the BOOT switches manipulation required when flashing the board using ``nucleo_n657x0_q``
229+
board target, it is only possible to run twister tests campaign on ``nucleo_n657x0_q/stm32n657xx/sb``
230+
board target which doesn't require BOOT pins changes to load and execute binaries.
231+
To do so, it is advised to use Twister's hardware map feature with the following settings:
232+
233+
.. code-block:: yaml
234+
235+
- platform: nucleo_n657x0_q/stm32n657xx/sb
236+
product: BOOT-SERIAL
237+
pre_script: <path_to_zephyr>/boards/st/common/scripts/board_power_reset.sh
238+
runner: stm32cubeprogrammer
239+
240+
.. _NUCLEO-N657X0-Q website:
170241
https://www.st.com/en/evaluation-tools/nucleo-n657x0-q.html
171242

172-
.. _NUCLEO_N657X0_Q User Manual:
243+
.. _NUCLEO-N657X0-Q User Manual:
173244
https://www.st.com/resource/en/user_manual/um3417-stm32n6-nucleo144-board-mb1940-stmicroelectronics.pdf
174-
175245
.. _STM32N657X0 on www.st.com:
176246
https://www.st.com/en/microcontrollers-microprocessors/stm32n657x0.html
177247

boards/st/stm32n6570_dk/doc/index.rst

Lines changed: 96 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ Hardware
5555
- On-board STLINK-V3EC debugger/programmer with USB re-enumeration capability:
5656
Virtual COM port, and debug port
5757

58+
For more details, please refer to:
59+
60+
* `STM32N6570_DK website`_
61+
* `STM32N657X0 on www.st.com`_
62+
* `STM32N657 reference manual`_
5863

5964
Supported Features
6065
==================
@@ -114,43 +119,87 @@ Programming and Debugging
114119
*************************
115120

116121
STM32N6570_DK board includes an ST-LINK/V3 embedded debug tool interface.
117-
This probe allows to flash the board using various tools.
122+
This probe allows to flash and debug the board using various tools.
123+
118124

119-
Flashing
120-
========
125+
Flashing or loading
126+
===================
121127

122-
The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
123-
so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
128+
The board is configured to be programmed using west `STM32CubeProgrammer`_ runner,
129+
so its :ref:`installation <stm32cubeprog-flash-host-tools>` is needed.
124130
Version 2.18.0 or later of `STM32CubeProgrammer`_ is required.
125131

126-
Flashing an application to STM32N6570_DK
127-
------------------------------------------
132+
To program the board, there are two options:
128133

129-
Connect the STM32N6570_DK to your host computer using the USB port.
130-
Then build and flash an application.
134+
- Program the firmware in external flash. At boot, it will then be loaded on RAM
135+
and executed from there.
136+
- Optionally, it can also be taken advantage from the serial boot interface provided
137+
by the boot ROM. In that case, firmware is directly loaded in RAM and executed from
138+
there. It is not retained.
131139

132-
.. note::
133-
For flashing, BOOT0 pin should be set to 0 and BOOT1 to 1 before powering on
134-
the board.
140+
Programming an application to STM32N6570_DK
141+
-------------------------------------------
142+
143+
Here is an example to build and run :zephyr:code-sample:`hello_world` application.
144+
145+
First, connect the STM32N6570_DK to your host computer using the ST-Link USB port.
146+
147+
.. tabs::
148+
149+
.. group-tab:: ST-Link
150+
151+
Build and flash an application using ``stm32n6570_dk`` target.
152+
153+
.. zephyr-app-commands::
154+
:zephyr-app: samples/hello_world
155+
:board: stm32n6570_dk
156+
:goals: build flash
157+
158+
.. note::
159+
For flashing, before powering the board, set the boot pins in the following configuration:
160+
161+
* BOOT0: 0
162+
* BOOT1: 1
163+
164+
After flashing, to run the application, set the boot pins in the following configuration:
165+
166+
* BOOT1: 0
167+
168+
Power off and on the board again.
169+
170+
Run a serial host program to connect to your board:
135171

136-
To run the application after flashing, BOOT1 should be set to 0 and the board
137-
should be powered off and on again.
172+
.. code-block:: console
173+
174+
$ minicom -D /dev/ttyACM0
175+
176+
.. group-tab:: Serial Boot Loader (USB)
177+
178+
Additionally, connect the STM32N6570_DK to your host computer using the USB port.
179+
In this configuration, ST-Link is used to power the board and for serial communication
180+
over the Virtual COM Port.
181+
182+
.. note::
183+
Before powering the board, set the boot pins in the following configuration:
184+
185+
* BOOT0: 1
186+
* BOOT1: 0
187+
188+
Build and load an application using ``stm32n6570_dk/stm32n657xx/sb`` target (you
189+
can also use the shortened form: ``stm32n6570_dk//sb``)
190+
191+
.. zephyr-app-commands::
192+
:zephyr-app: samples/hello_world
193+
:board: stm32n6570_dk//sb
194+
:goals: build flash
138195

139-
Here is an example for the :zephyr:code-sample:`hello_world` application.
140196

141197
Run a serial host program to connect with your Disco board:
142198

143199
.. code-block:: console
144200
145201
$ minicom -D /dev/ttyACM0
146202
147-
Then build and flash the application.
148-
149-
.. zephyr-app-commands::
150-
:zephyr-app: samples/hello_world
151-
:board: stm32n6570_dk
152-
:goals: build flash
153-
154203
You should see the following message on the console:
155204

156205
.. code-block:: console
@@ -162,15 +211,34 @@ Debugging
162211
=========
163212

164213
For now debugging is only available through STM32CubeIDE:
165-
* Go to File > Import and select C/C++ > STM32 Cortex-M Executable
166-
* In Executable field, browse to your <ZEPHYR_PATH>/build/zephyr/zephyr.elf
214+
215+
* Go to File > Import and select C/C++ > STM32 Cortex-M Executable.
216+
* In Executable field, browse to your <ZEPHYR_PATH>/build/zephyr/zephyr.elf.
167217
* In MCU field, select STM32N657X0HxQ.
168-
* Click on Finish
169-
* Then click on Debug to start the debugging session
218+
* Click on Finish.
219+
* Finally, click on Debug to start the debugging session.
170220

171221
.. note::
172-
For debugging, BOOT0 pin should be set to 0 and BOOT1 to 1 before powering on the
173-
board.
222+
For debugging, before powering on the board, set the boot pins in the following configuration:
223+
224+
* BOOT0: 0
225+
* BOOT1: 1
226+
227+
228+
Running tests with twister
229+
==========================
230+
231+
Due to the BOOT switches manipulation required when flashing the board using ``stm32n6570_dk``
232+
board target, it is only possible to run twister tests campaign on ``stm32n6570_dk/stm32n657xx/sb``
233+
board target which doesn't require BOOT pins changes to load and execute binaries.
234+
To do so, it is advised to use Twister's hardware map feature with the following settings:
235+
236+
.. code-block:: yaml
237+
238+
- platform: stm32n6570_dk/stm32n657xx/sb
239+
product: BOOT-SERIAL
240+
pre_script: <path_to_zephyr>/boards/st/common/scripts/board_power_reset.sh
241+
runner: stm32cubeprogrammer
174242
175243
.. _STM32N6570_DK website:
176244
https://www.st.com/en/evaluation-tools/stm32n6570-dk.html

0 commit comments

Comments
 (0)