Skip to content

Conversation

JarmouniA
Copy link
Contributor

@JarmouniA JarmouniA commented Oct 6, 2025

Introduce a board variant for storing an app in external QSPI NOR Flash and chainloading it with MCUboot (which is placed in internal Flash) to be executed either in place (XiP) (MCUBOOT_MODE_DIRECT_XIP, set by default in board's Kconfig.sysbuild) or to be loaded to RAM and be executed there (MCUBOOT_MODE_RAM_LOAD).

The ext Flash memory partition also allows for using the Swap-using-offset & swap-using-move MCUboot image upgrade algorithms, eventhough it's not optimal as it has same-sized slots.

The new variant requires a board DT overlay on the MCUboot side (mcu-tools/mcuboot#2479) to set the internal Flash & Flash controller as the chosen 'zephyr,flash' & 'zephyr,flash-controller'. This way, no overlay will be needed at the Zephyr user app level.

west build -p always -b stm32h750b_dk/stm32h750xx/ext_flash_app samples/modules/lvgl/demos --sysbuild

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.

@JarmouniA I was wondering if snippets could be used instead of adding a target each time we need to introduce an ext_mem app. Did you look at this possibility ?
Just thinking out loud, maybe the combination with sysbuild doesn't work great.

@JarmouniA
Copy link
Contributor Author

@JarmouniA I was wondering if snippets could be used

Not sure what we would put in them, maybe an ext Flash-specific snippet, but then the internal Flash is not necessarily the same, its sector size...

Many Zephyr subsystems as well MCUboot rely on the write-block-size and
erase-block-size properties, of the chosen Flash device in DT,
to determine the optimal parameters for using the flash & its partitions.

Include the soc-nv-flash binding in STM32 External NOR Flash binding so
that those two properties can be specified in the external Flash node
in board DT.

Until now, the workaround for STM32 boards using MCUboot has been to
disable CONFIG_BOOT_MAX_IMG_SECTORS_AUTO in MCUboot's board extra conf
and to set CONFIG_BOOT_MAX_IMG_SECTORS manually depending on the app slot
size & the NOR Flash sector size.

Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
Pull in the necessary MCUboot bits, will be removed before merging the PR.

Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
@JarmouniA JarmouniA force-pushed the fix_h750b-dk_ext_flash_app branch from 95ac7ff to 573417e Compare October 6, 2025 21:19
Copy link

github-actions bot commented Oct 6, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
mcuboot mcu-tools/mcuboot@d5b0dcb mcu-tools/mcuboot#2479 mcu-tools/mcuboot#2479/files

Additional metadata changed:

Name URL Submodules West cmds module.yml Blobs
mcuboot

DNM label due to: 1 project with PR revision and 1 project with metadata changes

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-mcuboot DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Oct 6, 2025
@JarmouniA JarmouniA force-pushed the fix_h750b-dk_ext_flash_app branch from 573417e to 00106a2 Compare October 6, 2025 21:31
Introduce a board variant for storing an app in external QSPI NOR Flash
and chainloading it with MCUboot (placed in internal Flash) to be
executed either in place (XiP) (set by default, MCUBOOT_MODE_DIRECT_XIP)
or to be loaded to RAM and be executed there (MCUBOOT_MODE_RAM_LOAD).
The new variant requires a board DT overlay on the MCUboot side
to set the internal Flash & Flash controller as the chosen 'zephyr,flash'
& 'zephyr,flash-controller'.

Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
Add stm32h750b_dk/stm32h750xx/ext_flash_app target to CI platforms

Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
Add stm32h750b_dk/stm32h750xx/ext_flash_app target to CI platforms.

Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
@JarmouniA JarmouniA force-pushed the fix_h750b-dk_ext_flash_app branch from 00106a2 to b26dafd Compare October 6, 2025 21:34
Copy link

sonarqubecloud bot commented Oct 6, 2025

Please retry analysis of this Pull-Request directly on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants