-
Notifications
You must be signed in to change notification settings - Fork 749
mcuboot supports the stm32 external flash in XiP mode #2154
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?
Conversation
requires the zephyrproject-rtos/zephyr#82275 which introduces the nucleo_h7s3l8 target |
@FRASTM Any plans to move forward with this PR? some CI issues to be fixed (Primarily caused by missing "Signed-off-by: Francois RAMU [email protected]" in some commits) |
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.
same for all .dts files, otherwise you can't build a zephyr application for them
*/ | ||
/ { | ||
chosen { | ||
zephyr,flash = &flash0; |
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.
this should be in the board dts in zephyr
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.
it is in each board dts for zephyr, so I think I can remove it from each overlay
correct sign-off |
|
||
/ { | ||
chosen { | ||
zephyr,flash = &flash0; |
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.
this whole file shouldn't be needed since flash is already set here: https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/st/nucleo_h7s3l8/nucleo_h7s3l8.dts#L22 and code partition will be applied automatically via app.overlay
status = "okay"; | ||
|
||
partitions { | ||
compatible = "fixed-partitions"; |
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.
this should be in the upstream zephyr board so it's visible to everything
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.
The xspi1 node is not enabled in the zephyr boards/st/stm32h7s78_dk/
then moving the overlay from mcuboot to zephyr board DTS will create a dependency with another next PR in zephyr (a PR to add the xspi1 node)
d81f77a
to
500f4bd
Compare
These fixes seem a bit unclear to me. What do I need to change about the stm32h573i_dk board files, so I can use MCUBoot with XIP. My Issue is described in: zephyrproject-rtos/zephyr#87531 |
With CONFIG_STM32_MEMMAP flag get NOR flash 32 bytes header Read the NOR flash to get header of the image. The FLASH_DEVICE is now the external NOR defined by the board device tree to be the first qspi/ospi/xspi instance (not necessarily zephyr, flash-controller) Signed-off-by: Francois Ramu <[email protected]>
Define the stm32 disco board configuration to set the STM32 XIP mode that will enable the MemoryMapped mode. See Kconfig of the stm32 soc. Choose the mcu_boot partition where to build ../bootloader/mcuboot/boot/zephyr Signed-off-by: Francois Ramu <[email protected]>
rebased on the main branch c8470fb tested on the nucleo_h7s3l8 where the external flash is MX25UW25645GXDI00
|
@Jowllel, I will go with the stm32h573 disco kit in the coming days to execute from external flash |
3d5f95b
to
540654e
Compare
Define the stm32 disco board configuration to set the STM32 XIP mode that will enable the MemoryMapped mode. Gives larger sector size for the external NOR flash See Kconfig of the stm32 soc. Choose the mcu_boot partition where to build ../bootloader/mcuboot/boot/zephyr Signed-off-by: F. Ramu <[email protected]>
Define the stm32 nucleo board configuration to set the STM32 XIP mode that will enable the MemoryMapped mode. Gives larger sector size for the external NOR flash See Kconfig of the stm32 soc. Choose the mcu_boot partition where to build ../bootloader/mcuboot/boot/zephyr Signed-off-by: F. Ramu <[email protected]>
Define the stm32h573 board configuration to set the STM32 XIP mode that will enable the MemoryMapped mode. Gives larger sector size for the external NOR flash See Kconfig of the stm32 soc. Choose the mcu_boot partition where to build ../bootloader/mcuboot/boot/zephyr Signed-off-by: Francois Ramu <[email protected]>
/ { | ||
chosen { | ||
zephyr,flash = &flash0; | ||
zephyr,code-partition = &boot_partition; |
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.
zephyr,code-partition = &boot_partition;
is redundant, already in app.overlay, same remark for other overlays.
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.
CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=n
CONFIG_BOOT_MAX_IMG_SECTORS=256
needed here (potentially for other boards as well, I only have access to this one).
#define FLASH_DEVICE_ID SPI_FLASH_0_ID | ||
#if DT_NODE_HAS_STATUS(DT_INST(0, st_stm32_xspi_nor), okay) | ||
#define FLASH_DEVICE_NODE DT_INST(0, st_stm32_xspi_nor) | ||
#define FLASH_DEVICE_BASE DT_REG_ADDR(DT_INST(0, st_stm32_xspi_nor)) |
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.
Shouldn't this be changed following #88646?
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.
Yes, the FLASH_DEVICE_BASE is now given by the parent of the "st,stm32-xspi-nor" node. However
#define FLASH_DEVICE_BASE DT_REG_ADDR_BY_IDX(DT_PARENT(FLASH_DEVICE_NODE), 1)
does not help linking at the expected address 0x90000000 (stm32h573i_dk)
New version of the old PR #1891
Adding the stm32h7s3l8 nucleo board
Following zephyrproject-rtos/zephyr#76305
Build the application with sysbuild for the nucleo_h7S3L8 :
west build -p auto -b nucleo_h7s3l8 samples/boards/st/hello_world_xip --sysbuild -- -DSB_CONFIG_BOOTLOADER_MCUBOOT=y