Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards: stm32n6: Add serial boot variant #84869

Merged
merged 12 commits into from
Feb 3, 2025

Conversation

erwango
Copy link
Member

@erwango erwango commented Jan 29, 2025

  • Adding a serial boot variant allowing to flash the board using the serial boot feature from the boot ROM
  • Add free form options for --start and --download to stm32cubeprogrammer runner
  • Add a STM32CubeProgrammer based script allowing to perform complete board power off/on

Note: documentation update is still missing for ucleo_n657x0_q boards as I'd like to get the DK board doc update approved first before duplicating everything. Both boards doc updated

@erwango
Copy link
Member Author

erwango commented Jan 29, 2025

Back to draft as I miss some runner updates (helpers and tests)

@nashif nashif assigned erwango and unassigned nashif Jan 29, 2025
Implement possibility to specify options for --start and --download
arguments.
These options are implemented as lists to better fit STM32CubeProgrammer
programming model.

This options are required to enable the programming of STM32N6 in USB-DFU
mode, which requires "-d my.bin 0x1 -s noack" arguments list.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Flashing in BOOT-SERIAL mode with stm32cubeprogrammer doesn't support
using serial number.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
@erwango erwango marked this pull request as ready for review January 29, 2025 14:42
When flashing STM32N6 in USB-DFU mode, as required when running test
automation using twister, it is first required to power-off/power-on the
board to set board ready for USB-DFU (thanks to specific BootROM
configuration).
Provide a script that performs this operation using STM32CubeProgrammer.
This scipt could be provided in twister map.yaml file on 'pre_script'
property of board entry.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
This option should be used to load and run binary using "serial boot"
configuration for boot ROM.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
On STM32N6 based series, there is no flash available and tests
are performed using load and run in RAM.
From twister point of view, we should consider a flash is available
with the same size as RAM.
(We may tune these values later as the RAM will actually be shared
between code and variables).

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Introduce a variant to allow loading and running firmware using
BootROM serial boot configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
gautierg-st
gautierg-st previously approved these changes Jan 31, 2025
@@ -108,70 +114,134 @@ USART1. Default settings are 115200 8N1.
Programming and Debugging
*************************

NUCLEO_N657X0_Q board includes an ST-LINK/V3 embedded debug tool interface.
This probe allows to flash the board using various tools.
STM32N6570_DK board includes an ST-LINK/V3 embedded debug tool interface.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok so what's the name of that board then? :)
Overview says "Nucleo-144", the board's full_name is Nucleo N657x0-Q, and here you have something different? (and then ST website seems to have NUCLEO-N657X0-Q with capital X btw :) )

Copy link
Member Author

@erwango erwango Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy pasta. Reverting back to NUCLEO_N657X0_Q Updating to NUCLEO-N657X0-Q

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good :) please fix full_name too to use capital X, if you have a chance

toolchain:
- zephyr
- gnuarmemb
- xtools
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- xtools

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

toolchain:
- zephyr
- gnuarmemb
- xtools
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- xtools

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@erwango
Copy link
Member Author

erwango commented Jan 31, 2025

@kartben PTAL

@erwango erwango assigned kartben and unassigned erwango Jan 31, 2025
gautierg-st
gautierg-st previously approved these changes Jan 31, 2025
@erwango erwango requested a review from kartben January 31, 2025 16:27
marwaiehm-st
marwaiehm-st previously approved these changes Jan 31, 2025
* BOOT1: 0

Build and load an application using ``nucleo_n657x0_q/stm32n657xx/sb`` target (you
can also use the shortenned form: ``nucleo_n657x0_q//sb``)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
can also use the shortenned form: ``nucleo_n657x0_q//sb``)
can also use the shortened form: ``nucleo_n657x0_q//sb``)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks


.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: nucleo_n657x0_q
:goals: build flash


Run a serial host program to connect with your Disco board:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Run a serial host program to connect with your Disco board:
Run a serial host program to connect to you board:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, fixed

- gpio
- uart
vendor: st
variants:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking: not really familiar with this way of describing the variants but wondering if having separate yaml files isn't better for consistency with the 99.9% of the other boards in tree

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this handy to avoid duplicating information. It seems to have been introduced for this purpose (See #77250)
And also I didn't manage to exclude one variant from twister using 2 separate yaml files.

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 <erwan.gouriou@st.com>
Generate a proper Cmake warning when signing tool isn't available.
This also allows not to fail in Github CI.


Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Until MPU support is enabled, disable DCACHE support for
this series of test.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Fix yaml full_name to match ST official reference.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Remove xtool support


Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
@kartben kartben merged commit b5c5ba8 into zephyrproject-rtos:main Feb 3, 2025
51 checks passed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erwango Sorry for the late review, shouldn't this script be in Python for the sake of portability?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Twister Twister area: UART Universal Asynchronous Receiver-Transmitter area: West West utility platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants