Skip to content

Conversation

@TD-JBL
Copy link
Contributor

@TD-JBL TD-JBL commented Nov 19, 2025

Similarly to what is done for stm32h7s78_dk board in #97992, introduce an ext_flash_app board variant aiming at being chainloaded by MCUBoot.
Requires mcuboot counter part (mcu-tools/mcuboot#2510) to allow MCUBoot to run on internal flash.

Need / waiting for mcu-tools/mcuboot/pull/2554.

Tested with

  • without sysbuild: samples/hello_world with nucleo_h7s3l8 (app in internal flash)
  • with sysbuild: samples/hello_world with nucleo_h7s3l8/stm32h7s3xx/ext_flash_app (mcuboot + app in external flash)
  • with sysbuild: samples/sysbuild/with_mcuboot with nucleo_h7s3l8/stm32h7s3xx/ext_flash_app (mcuboot + app in external flash)

endchoice

choice MCUBOOT_MODE
default MCUBOOT_MODE_SINGLE_APP
Copy link
Contributor

Choose a reason for hiding this comment

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

direct xip?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied that from the stm32h7s78_dk board. Not too familiar with mcuboot modes. Is MCUBOOT_MODE_DIRECT_XIP the better way?

Copy link
Contributor

Choose a reason for hiding this comment

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

they are different modes, single slot means you use slot 0 and cannot do any updates from the app, MCUboot must have serial recovery mode to update slot 0, with direct-xip you can load firmware updates to the opposing slot and MCUboot will boot the highest version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the update. On my custom board I will later most likely use MCUBOOT_MODE_SWAP_USING_OFFSET, but here I am completely open to what we want to set. Open for suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

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

can use any, if this works with swap using offset, would just default to that

Copy link
Member

Choose a reason for hiding this comment

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

FYI, MCUBOOT_MODE_SINGLE_APP had smaller footprint and using any other would blow over the 64K Flash available. See #97992 (comment). There is probably something to fix but I didn't had time to investigate further.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to MCUBOOT_MODE_SWAP_USING_OFFSET, it is used on the stm32h750b_dk and we have no footprint issues during compilation.

Copy link
Member

Choose a reason for hiding this comment

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

we have no footprint issues during compilation

Interesting, I'll have a cross check on stm32h7s78_dk.

@TD-JBL
Copy link
Contributor Author

TD-JBL commented Nov 21, 2025

rebased because of merge conflicts

Add write-block-size and erase-block-size attributes to xspi nor flash
connected to xspi2. This is needed for mcuboot to handle flash access
of the ext_flash. The changes in the node structure is taken from the
stm32h7s78_dk board.

Update zephyr,flash-controller in samples/sysbuild/with_mcuboot/boards
/nucleo_h7s3l8.overlay to have CONFIG_STM32_APP_IN_EXT_FLASH set when
direct parent of flash is not XSPI but only the parent of the flash-
controller.

Signed-off-by: Thomas Decker <[email protected]>
@TD-JBL TD-JBL force-pushed the nucleo_h7s3l8_ext_app_flash branch from 0a9ca9e to e0490cf Compare November 24, 2025 07:29
@TD-JBL
Copy link
Contributor Author

TD-JBL commented Nov 24, 2025

rebased because of merge conflicts

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

Looks ok, but please also update board documentation (you'll find examples for other boards)

@TD-JBL TD-JBL force-pushed the nucleo_h7s3l8_ext_app_flash branch from e0490cf to 34d99ac Compare November 24, 2025 09:22
@zephyrbot zephyrbot requested a review from erwango November 24, 2025 09:26
@TD-JBL TD-JBL force-pushed the nucleo_h7s3l8_ext_app_flash branch from 34d99ac to 4249378 Compare November 24, 2025 09:34
@TD-JBL
Copy link
Contributor Author

TD-JBL commented Nov 24, 2025

Added documentation (copied and adapted from stm32h750b_dk). Also changed to MCUBOOT_MODE_SWAP_USING_OFFSET.

Add ext_flash_app variant to nucleo_h7s3l8 to allow building
applications running on ext flash.

Based on Erwan Gouriou's work on stm32h7s78_dk in PR zephyrproject-rtos#97992
(which is based on A.Jarmouni's work on stm32h750_dk in PR 97037).

Signed-off-by: Thomas Decker <[email protected]>
…iant

Now that ext_flash_app variant is available, it should be used for
mcuboot related apps on this board.

Delete boards/nucleo_h7s3l8.overlay (and boards/stm32h7s78_dk.overlay)
which are not needed anymore.

Signed-off-by: Thomas Decker <[email protected]>
@TD-JBL TD-JBL force-pushed the nucleo_h7s3l8_ext_app_flash branch from 4249378 to 49e4af0 Compare November 24, 2025 09:50
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants