-
Notifications
You must be signed in to change notification settings - Fork 8k
Boards: STM32H750B-DK: Introduce App in Ext Flash variant #97037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Boards: STM32H750B-DK: Introduce App in Ext Flash variant #97037
Conversation
There was a problem hiding this 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.
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]>
95ac7ff
to
573417e
Compare
The following west manifest projects have changed revision in this Pull Request:
Additional metadata changed:
⛔ 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. |
573417e
to
00106a2
Compare
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]>
00106a2
to
b26dafd
Compare
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Though, I think we can get rid of the mcuboot overlay by using stm32h750b_dk
as the mcuboot target. This way, mcuboot is a usual zephyr application running on internal flash.
(Note also that zephyr,code-partition = &boot_partition;
is already defined in mcuboot app.overlay)
To do this, you probably need to add a sysbuild.cmake
file to the board, stating:
if(SB_CONFIG_BOOTLOADER_MCUBOOT)
set_target_properties(mcuboot PROPERTIES BOARD stm32h750b_dk/stm32h750xx)
endif()
and no mcuboot dependency anymore.
Can you have a try and report back (somehow I can't find any stm32h750b_dk here anymore to test it myself) ?
I already thought of that, but the MCUboot App build depends on info specified in ext_flash_app variant dts, an example is info about the slots There are potentially other interdependencies at the sysbuild level as well, I don't think it's a good idea to use different targets. |
It builds on my side. I'm just unable to test it. |
The MCUboot partitions (slot0, slot1...) are not relevant to the base variant, which is supposed to be used with a regular Zephyr app (MCUboot is not a regular app, it's a bootloader) in internal Flash & external Flash is used for storage or whatever,
So why would we put the MCUboot partitions in the common dtsi, and of what use would be the ext_flash_app variant in that case? |
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.