stm32/N657X0: fix signing for Rev.B silicon and document flashing pro…#19290
Open
Mrpli wants to merge 1 commit into
Open
stm32/N657X0: fix signing for Rev.B silicon and document flashing pro…#19290Mrpli wants to merge 1 commit into
Mrpli wants to merge 1 commit into
Conversation
|
Code size report: |
f4f148f to
4e89504
Compare
Signed-off-by: Mrpli <woe2468@outlook.com>
4e89504 to
1114402
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request fixes mboot boot failures on NUCLEO-N657X0-Q boards with Rev B silicon. The STM32N657X0 chip has two silicon revisions that require different FSBL signing header versions:
STM32_N6_HEADER_VERSION = 2.1STM32_N6_HEADER_VERSION = 2.3Currently
mpconfigboard.mkdefaults to 2.1, causing Rev B boards to fail booting afterdeploy-trusted. The signing header version is updated to 2.3 in this PR.Additionally, STM32CubeProgrammer v2.21.0 and later no longer auto-align the binary payload to a 0x400-byte boundary. The
--alignflag has been added to theSTM32_SigningTool_CLIinvocation in bothstm32/Makefileandstm32/mboot/Makefile; otherwise, the signing step fails with an alignment error andfirmware-trusted.binwill not be generated correctly.The board documentation (
board.md) has been extended to cover:--alignrequirement for STM32CubeProgrammer v2.21.0+.Testing
Hardware tested:
Test steps:
--alignfix:Without
--alignthe signing step fails with an alignment error; with the flag added,firmware-trusted.binis generated correctly.Documentation:
board.mdrenders correctly and all added information is accurate.Trade-offs and Alternatives
Defaulting to header version 2.3 means Rev Z (Cut 1.1) users must manually override with STM32_N6_HEADER_VERSION=2.1.However, Rev Z boards are no longer manufactured; all currently shipping boards use Rev B, so this change matches real-world hardware.
Alternatives considered:
1.Runtime header version detection:
The chip revision cannot be easily read before the FSBL is loaded, so build‑time selection is the only practical approach.
2.Using the USB DFU method only:
The DFU method relies on mboot being active, which fails on Rev B without the correct header version. The documented ST‑LINK alternative provides a fallback that works regardless of the mboot DFU state.
Generative AI
I used generative AI tools when creating this PR, but a human has checked the
code and is responsible for the code and the description above.