stm32 disco kit running zephyr application from external NOR flash in XiP #73570
Replies: 3 comments
-
Branches are available for the stm32h750b_dk (requires the #73027)
|
Beta Was this translation helpful? Give feedback.
-
restrictions : |
Beta Was this translation helpful? Give feedback.
-
D:/Project2025/zephyrproject/SettonIO/app_mcuboot/hello-world/h750b/mcuboot/zephyr/.config.sysbuild:5: warning: attempt to assign the value 'n' to the undefined symbol BOOT_SWAP_USING_OFFSET I don't know why compiler said undefined symbol BOOT_SWAP_USING_OFFSET. when I build with command: |
Beta Was this translation helpful? Give feedback.
-
The purpose is to run a simple zephyr application on the external NOR flash, in XiP mode of a stm32 disco kit.
The application is a simple hello_word : the application can not use the external NOR itself in anycase.
The target is the stm32h750b_dk discovery kit from STMicroelectronics (more targets to come)
The stm32H750 disco kit has a dual quad-spi flash mt25ql512ab which will be configured in memory mapped mode.
The memory Mapped mode allows code execution directly from the external NOR : eXecute In Place.
The zephyr application is built and linked and flashed for the external NOR with MCUboot.
The mcuboot is always running in the internal flash memory of the stm32 mcu. The mcuboot can identify the image on the external NOR and jumps there for executing in Place.
Few steps to complete :
have the flash_stm32_qspi supporting dual flash mode (for stm32h7 board with dual-qspi flash memories)
define the MPU to have ext_memory region access for execution
Most important is the definitions of the partitions
The internal flash (&flash0) must hold the boot partition (offset = 0x0) plus a (dummy) slot0_partition (offset = 0x10000)
The external memory must hold the slot1 partition where the mcuboot will find binary image to jump to.
The board DTS must select the chosen flash0 and qspi-nor-flash controller :
the zephyr, chosen are flash0 and boot_partition :
kconfig required
the zephyr, chosen is the slot1_partition :
Then the mcuboot and application are built with --sysbuild (refer to https://docs.zephyrproject.org/latest/build/sysbuild/index.html ) with the following command:
west build -p auto -b stm32h750b_dk samples/boards/stm32/hello_world_xip/ --sysbuild -- -DSB_CONFIG_BOOTLOADER_MCUBOOT=y -DCONFIG_FLASH_BASE_ADDRESS=0x90000000
(The CONFIG_FLASH_BASE_ADDRESS gives the address of the external memory where the application will be linked.)
download
Then flash build/mcuboot/zephyr/zephyr.bin at 0x8000000 (internal flash address + offset of the boot_partition)
Then flash build/your_application/zephyr/zephyr.signed.bin at 0x90000000 (external flash address, given by CONFIG_FLASH_BASE_ADDRESS + offset of the slot1_partition)
run
Beta Was this translation helpful? Give feedback.
All reactions