mcuboot supports the stm32 external flash in XiP mode#2154
mcuboot supports the stm32 external flash in XiP mode#2154FRASTM wants to merge 0 commit intomcu-tools:mainfrom
Conversation
|
requires the zephyrproject-rtos/zephyr#81651 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 francois.ramu@st.com" in some commits) |
nordicjm
left a comment
There was a problem hiding this comment.
same for all .dts files, otherwise you can't build a zephyr application for them
|
correct sign-off |
| status = "okay"; | ||
|
|
||
| partitions { | ||
| compatible = "fixed-partitions"; |
There was a problem hiding this comment.
this should be in the upstream zephyr board so it's visible to everything
There was a problem hiding this comment.
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 |
|
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 |
540654e to
374659f
Compare
c821bee to
8d36285
Compare
| #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.
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_INST(0, st_stm32_xspi),1)
does not help linking at the expected address 0x90000000 (stm32h573i_dk)
There was a problem hiding this comment.
only
-DCONFIG_FLASH_BASE_ADDRESS=0x90000000
can link at the correct address of the external flash memory
There was a problem hiding this comment.
@nordicjm Following zephyrproject-rtos/zephyr#88646, we're reusing similar bindings as you or NXP do for external memories (memory mapping address of the memory provided in a second reg cell of the memoy parent node ). I would expect we could align on a common code on mcuboot for this case, but apparently -DCONFIG_FLASH_BASE_ADDRESS=0x90000000 is still required which seems odd to me
Did we missed something ?
There was a problem hiding this comment.
I am checking when the CONFIG_FLASH_BASE_ADDRESS is given by the Kconfig.defconfig for any stm32 soc as follows:
DT_CHOSEN_Z_FLASH := zephyr,flash
DT_COMPAT_XSPI := st,stm32-xspi
DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH))
DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE))
DT_FLASH_PARENT_IS_XSPI := $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_XSPI))
config FLASH_BASE_ADDRESS
default $(dt_node_reg_addr_hex,$(DT_CHOSEN_FLASH_PARENT),1) \
if $(DT_FLASH_PARENT_IS_XSPI)
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))
The CONFIG_FLASH_BASE_ADDRESS is correctly defined = 0x90000000 which is the second reg of the xspi node:
xspi1: spi@47001400 {
compatible = "st,stm32-xspi";
reg = <0x47001400 0x400>, <0x90000000 DT_SIZE_M(256)>;
Then build option -DCONFIG_FLASH_BASE_ADDRESS=0x90000000 is not required anymore and the application is correclty linked for external address of the NOR octo-flash
There was a problem hiding this comment.
Kconfig above looks correct for specifying the base address
There was a problem hiding this comment.
This PR will get the soc/st/stm32/Kconfig.defconfig inherited from the zephyr code which sets the CONFIG_FLASH_BASE_ADDRESS
|
without board overlay files :
Requires the zephyrproject-rtos/zephyr#88579 where the CONFIG_FLASH_BASE_ADDRESS is defined by the soc/st/stm32/Kconfig.defconfig |
| #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)) | ||
| #define FLASH_DEVICE_BASE DT_REG_ADDR_BY_IDX(DT_INST(0, st_stm32_xspi),1) |
|
only boards that have been tested with samples/sysbuild/with_mcuboot/ --sysbuild
|
|
closed by error Refer to #2323 |
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