Repository navigation
boot/mcuboot: Update commit version - #3894
Open
daniel-p-carvalho wants to merge 1 commit into
Open
daniel-p-carvalho wants to merge 1 commit into
daniel-p-carvalho wants to merge 1 commit into
Conversation
Update the MCUboot version to include the fix for flash_area_get_sector() in the NuttX port (mcu-tools/mcuboot#2908). The function looked up the flash device by fa_off + off, which only succeeded for off == 0. For any other offset it returned 0 without filling the sector, so the caller used uninitialized stack values. With MCUBOOT_SWAP_USING_MOVE this made the loader erase pages in a loop and left the primary slot corrupted. Assisted-by: Claude Code:claude-sonnet-5-5 Signed-off-by: Daniel P. Carvalho <[email protected]>
cederom
requested review from
acassis,
linguini1,
michallenc and
xiaoxiang781216
October 21, 2026 10:51
cederom
approved these changes
Oct 21, 2026
cederom
left a comment
Contributor
There was a problem hiding this comment.
Thank you @daniel-p-carvalho for fixing the issue directly on the upstream project! :-)
jerpelea
approved these changes
Oct 21, 2026
xiaoxiang781216
approved these changes
Oct 21, 2026
michallenc
approved these changes
Oct 21, 2026
Contributor
|
@daniel-p-carvalho need reduce the firmware size: |
Contributor
Author
|
The overflow comes from the size of the new MCUboot (about 370 bytes more) on a configuration that already uses 99.7% of its flash, not from this change. I sent apache/nuttx#20909, which enables LTO in same70-qmtech:mcuboot-loader as same70-xplained already does, and lists other ways to save flash. Once it is merged this CI check should pass on a re-run. |
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
Update
CONFIG_MCUBOOT_VERSIONtod6267bdb7f60a00f068b750f9efa2b6cb36bf47e, which includes mcu-tools/mcuboot#2908.The NuttX port of
flash_area_get_sector()looked the flash device up byfa_off + off, which only succeeds foroff == 0. For any other offset it returned-errno(0) without filling the sector, and MCUboot used uninitialized stack values as the erase offset and size. WithMCUBOOT_SWAP_USING_MOVEthe loader then erased pages in a loop and left the primary slot corrupted, with no error and no reset. The fix looks the device up by flash area id and returns an offset relative to the area.Impact
Users of
boot/mcubootget the MCUboot revision with the fixedflash_area_get_sector(). Without it,MCUBOOT_SWAP_USING_MOVEdoes not work on the NuttX port. No change to Kconfig symbols or the build process; only the default of the version string changes. Users who pin their ownMCUBOOT_VERSIONare not affected.Testing
Host: Linux x86_64,
arm-none-eabi-gcc15.2.1.Target: custom STM32G474RE board (out-of-tree,
CONFIG_ARCH_BOARD_CUSTOM), MCUboot loader withMCUBOOT_SWAP_USING_MOVE, 2 x 192 KB slots, based on nuttx7e652be44dand apps2d68f38f7.Before: the loader erased pages in a loop and the primary slot was corrupted (
flash_area_erase: ID:1 offset:134271849 length:536870996in the MCUboot log).After, without any local patch:
mcuboot_confirmand reset: v2 stays, no new swap.