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 in place (XiP).

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

Board doc preview https://builds.zephyrproject.io/zephyr/pr/97037/docs/boards/st/stm32h750b_dk/doc/index.html

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...

@JarmouniA JarmouniA force-pushed the fix_h750b-dk_ext_flash_app branch from 95ac7ff to 573417e Compare October 6, 2025 21:19
@github-actions
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

All manifest checks OK

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 2 times, most recently from 00106a2 to b26dafd Compare October 6, 2025 21:34
@JarmouniA JarmouniA marked this pull request as ready for review October 7, 2025 07:19
@JarmouniA
Copy link
Contributor Author

@erwango You should probably take the PR assignment, as it is only touching STM32 area (except for the minor tests' changes to add the board variant to platform_allow lists).

erwango
erwango previously approved these changes Oct 21, 2025
@erwango erwango assigned erwango and unassigned d3zd3z Oct 21, 2025
@JarmouniA
Copy link
Contributor Author

@etienne-lms Could you take a look, thanks!

maass-hamburg
maass-hamburg previously approved these changes Oct 22, 2025
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
in place (uses MCUboot's swap-using-offset mode, set via Sysbuild).

The new variant requires on MCUboot app side: a board/SoC DT overlay to
set the internal Flash & Flash controller as the chosen 'zephyr,flash' &
'zephyr,flash-controller', and CONFIG_STM32_MEMMAP=y (this was upstreamed
to MCUboot.)

Change external Flash memory attribute "zephyr,memory-attr" to
DT_MEM_ARM_MPU_FLASH, since ATTR_MPU_IO (corresponds to
"DEVICE_NON_SHAREABLE & P_RW_U_NA") is actually for memory-mapped devices
(with registers...) and was causing access issues with apps like LVGL that
would freeze the target. Also, change the size of the external flash
"zephyr,memory-region" node, since we only need to define accesss rights
to the memory space actually used by the external flash chips, not the
total addresssable QSPI memory.

The 2nd QSPI NOR contoller node was removed, since it does not reflect the
actual hardware layout, that has only one controller and the 2 NOR flash
chips are connected to it in parallel with a shift register.

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
Add stm32h750b_dk/stm32h750xx/ext_flash_app target to CI platforms

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
Add stm32h750b_dk/stm32h750xx/ext_flash_app target to CI platforms.

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
Add stm32h750b_dk/stm32h750xx/ext_flash_app target to CI platforms of
the Hawkbit sample.

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
Copy link
Member

@maass-hamburg maass-hamburg left a comment

Choose a reason for hiding this comment

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

As things should be 😌

@sonarqubecloud
Copy link

@jhedberg jhedberg merged commit caa21ac into zephyrproject-rtos:main Oct 23, 2025
23 checks passed
@JarmouniA JarmouniA deleted the fix_h750b-dk_ext_flash_app branch October 23, 2025 08:43
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.

9 participants