Skip to content
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

stm32h573i_dk can't boot from external flash with mcuboot #87531

Open
Jowllel opened this issue Mar 23, 2025 · 1 comment
Open

stm32h573i_dk can't boot from external flash with mcuboot #87531

Jowllel opened this issue Mar 23, 2025 · 1 comment
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: low Low impact/importance bug

Comments

@Jowllel
Copy link

Jowllel commented Mar 23, 2025

Describe the bug:

I'm trying to boot my application from the external ospi nor flash on the stm32h573i_dk board. My project (MCUBOOT_EXT_Test.zip) is based of the mcuboot sample. When I place the slot0 and slot1 partition in the internal flash everything works as expected, however when I place them in the external flash the code stops, when jumping to the application image. (As shown in the log below) At this point the MCU can't be accessed through the debugger (west attach or STM32CubeProgrammer), because it's in a locked up state.

To Reproduce:

I uploaded my project files as a zip. Build them with sysbuild and flash them to an stm32h573i_dk. And edit the board file (stm32h573i_dk.dts) in the zephyr folder, so the slot0 and slot1 partitions are placed in the ospi nor flash.

MCUBOOT_EXT_Test.zip

CMake Warnings for mcuboot target:

CMake Warning at C:/Users/xxxx/zephyrproject/zephyr/CMakeLists.txt:1011 (message):
  No SOURCES given to Zephyr library: ..__modules__hal__renesas__drivers

  Excluding target from build.


MCUBoot bootloader key file: C:/Users/xxxx/zephyrproject/bootloader/mcuboot/root-rsa-2048.pem
CMake Warning at CMakeLists.txt:367 (message):
  WARNING: Using default MCUboot signing key file, this file is for debug use
  only and is not secure!


CMake Warning at CMakeLists.txt:589 (message):
  Unable to determine erase size of slot0 or slot1 partition, setting to 1
  (this is probably wrong)


CMake Warning at CMakeLists.txt:594 (message):
  Unable to determine write size of slot0 or slot1 partition, setting to 8
  (this is probably wrong)

CMake Warnings for main app target:

warning: MCUBOOT_UPDATE_FOOTER_SIZE (defined at subsys/dfu/Kconfig:55) was assigned the value
'0x3031' but got the value ''. Check these unsatisfied dependencies: MCUBOOT_IMG_MANAGER (=n),
IMG_MANAGER (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MCUBOOT_UPDATE_FOOTER_SIZE and/or look up
MCUBOOT_UPDATE_FOOTER_SIZE in the menuconfig/guiconfig interface. The Application Development
Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
might be helpful too.

CMake Warning at C:/Users/xxxx/zephyrproject/zephyr/CMakeLists.txt:1011 (message):
  No SOURCES given to Zephyr library: ..__modules__hal__renesas__drivers

  Excluding target from build.


-- Including signing script: C:/Users/xxxx/zephyrproject/zephyr/cmake/mcuboot.cmake
CMake Warning at C:/Users/xxxx/zephyrproject/zephyr/cmake/mcuboot.cmake:71 (message):
  slot0_partition write block size devicetree parameter is missing, assuming
  write block size is 4
Call Stack (most recent call first):
  C:/Users/xxxx/zephyrproject/zephyr/cmake/mcuboot.cmake:245 (zephyr_mcuboot_tasks)
  C:/Users/xxxx/zephyrproject/zephyr/CMakeLists.txt:2053 (include)


Logs and console output:

D: Flash @0x8000000 initialized. BS: 16
D: Block 0: bs: 8192 count: 256
D: XSPI Init'd
D: Delay Block Init
D: Reset Mem (SPI/STR)
D: Status Match cb
D: Mem Ready (SPI/STR)
D: XSPI configuring Octo SPI mode
D: Status Match cb
D: Status Match cb
D: Status Match cb
D: Status Match cb
I: XSPI flash config is OCTO / DTR
I: Read SFDP from externalFlash
D: ospi-nor-flash@90000000: SFDP v 1.8 AP fd with 5 PH
D: PH0: ff00 rev 1.7: 20 DW @ 40
I: Read SFDP from externalFlash
D: ospi-nor-flash@90000000: 64 MiBy flash
D: Erase 4096 with 20
D: Erase 65536 with d8
D: Address width: 4 Bytes
D: Page size 256 bytes
D: Flash size 67108864 bytes
D: Using read mode: 0, instr: 0x0, dummy cycles: 0
D: Using write instr: 0x12ED
D: PH1: ff87 rev 1.1: 28 DW @ 90
D: layout page 256 not compatible with erase size 4096
D: erase size will be used as layout page size
D: layout 16384 x 4096 By pages
D: MemoryMap mode enabled
I: Memory-mapped NOR-flash at 0x90000000 (0x4000000 bytes)
*** Booting MCUboot  ***
*** Using Zephyr OS build 4.1.99 ***
I: Starting bootloader
D: Memory-mapped read from 0x90000000, len 32
D: Memory-mapped read from 0x9006a000, len 32
D: Memory-mapped read from 0x90069ff0, len 16
D: Memory-mapped read from 0x90069fc0, len 1
D: Memory-mapped read from 0x90069fd0, len 1
D: Memory-mapped read from 0x90069fe0, len 1
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
D: Memory-mapped read from 0x900d1ff0, len 16
D: Memory-mapped read from 0x900d1fc0, len 1
D: Memory-mapped read from 0x900d1fd0, len 1
D: Memory-mapped read from 0x900d1fe0, len 1
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
D: Memory-mapped read from 0x90000000, len 32
D: Memory-mapped read from 0x9006a000, len 32
D: Memory-mapped read from 0x90069ff0, len 16
D: Memory-mapped read from 0x90069fc0, len 1
D: Memory-mapped read from 0x90069fd0, len 1
D: Memory-mapped read from 0x90069fe0, len 1
D: Memory-mapped read from 0x900d1ff0, len 16
D: Memory-mapped read from 0x900d1fc0, len 1
D: Memory-mapped read from 0x900d1fd0, len 1
D: Memory-mapped read from 0x900d1fe0, len 1
I: Image index: 0, Swap type: none
D: Memory-mapped read from 0x90000000, len 256
D: Memory-mapped read from 0x90000100, len 256
D: Memory-mapped read from 0x90000200, len 256
D: Memory-mapped read from 0x90000300, len 256
D: Memory-mapped read from 0x90000400, len 256
D: Memory-mapped read from 0x90000500, len 256
D: Memory-mapped read from 0x90000600, len 256
D: Memory-mapped read from 0x90000700, len 256
D: Memory-mapped read from 0x90000800, len 256
D: Memory-mapped read from 0x90000900, len 256
D: Memory-mapped read from 0x90000a00, len 256
D: Memory-mapped read from 0x90000b00, len 256
D: Memory-mapped read from 0x90000c00, len 256
D: Memory-mapped read from 0x90000d00, len 256
D: Memory-mapped read from 0x90000e00, len 256
D: Memory-mapped read from 0x90000f00, len 256
D: Memory-mapped read from 0x90001000, len 256
D: Memory-mapped read from 0x90001100, len 256
D: Memory-mapped read from 0x90001200, len 256
D: Memory-mapped read from 0x90001300, len 256
D: Memory-mapped read from 0x90001400, len 256
D: Memory-mapped read from 0x90001500, len 256
D: Memory-mapped read from 0x90001600, len 256
D: Memory-mapped read from 0x90001700, len 256
D: Memory-mapped read from 0x90001800, len 256
D: Memory-mapped read from 0x90001900, len 256
D: Memory-mapped read from 0x90001a00, len 256
D: Memory-mapped read from 0x90001b00, len 256
D: Memory-mapped read from 0x90001c00, len 256
D: Memory-mapped read from 0x90001d00, len 256
D: Memory-mapped read from 0x90001e00, len 256
D: Memory-mapped read from 0x90001f00, len 256
D: Memory-mapped read from 0x90002000, len 256
D: Memory-mapped read from 0x90002100, len 256
D: Memory-mapped read from 0x90002200, len 256
D: Memory-mapped read from 0x90002300, len 256
D: Memory-mapped read from 0x90002400, len 256
D: Memory-mapped read from 0x90002500, len 256
D: Memory-mapped read from 0x90002600, len 256
D: Memory-mapped read from 0x90002700, len 256
D: Memory-mapped read from 0x90002800, len 256
D: Memory-mapped read from 0x90002900, len 256
D: Memory-mapped read from 0x90002a00, len 256
D: Memory-mapped read from 0x90002b00, len 256
D: Memory-mapped read from 0x90002c00, len 256
D: Memory-mapped read from 0x90002d00, len 256
D: Memory-mapped read from 0x90002e00, len 256
D: Memory-mapped read from 0x90002f00, len 256
D: Memory-mapped read from 0x90003000, len 256
D: Memory-mapped read from 0x90003100, len 256
D: Memory-mapped read from 0x90003200, len 256
D: Memory-mapped read from 0x90003300, len 256
D: Memory-mapped read from 0x90003400, len 256
D: Memory-mapped read from 0x90003500, len 256
D: Memory-mapped read from 0x90003600, len 256
D: Memory-mapped read from 0x90003700, len 256
D: Memory-mapped read from 0x90003800, len 256
D: Memory-mapped read from 0x90003900, len 256
D: Memory-mapped read from 0x90003a00, len 256
D: Memory-mapped read from 0x90003b00, len 256
D: Memory-mapped read from 0x90003c00, len 256
D: Memory-mapped read from 0x90003d00, len 256
D: Memory-mapped read from 0x90003e00, len 256
D: Memory-mapped read from 0x90003f00, len 256
D: Memory-mapped read from 0x90004000, len 256
D: Memory-mapped read from 0x90004100, len 256
D: Memory-mapped read from 0x90004200, len 256
D: Memory-mapped read from 0x90004300, len 256
D: Memory-mapped read from 0x90004400, len 256
D: Memory-mapped read from 0x90004500, len 256
D: Memory-mapped read from 0x90004600, len 256
D: Memory-mapped read from 0x90004700, len 256
D: Memory-mapped read from 0x90004800, len 256
D: Memory-mapped read from 0x90004900, len 256
D: Memory-mapped read from 0x90004a00, len 256
D: Memory-mapped read from 0x90004b00, len 256
D: Memory-mapped read from 0x90004c00, len 256
D: Memory-mapped read from 0x90004d00, len 256
D: Memory-mapped read from 0x90004e00, len 256
D: Memory-mapped read from 0x90004f00, len 256
D: Memory-mapped read from 0x90005000, len 256
D: Memory-mapped read from 0x90005100, len 256
D: Memory-mapped read from 0x90005200, len 256
D: Memory-mapped read from 0x90005300, len 256
D: Memory-mapped read from 0x90005400, len 256
D: Memory-mapped read from 0x90005500, len 256
D: Memory-mapped read from 0x90005600, len 256
D: Memory-mapped read from 0x90005700, len 256
D: Memory-mapped read from 0x90005800, len 256
D: Memory-mapped read from 0x90005900, len 256
D: Memory-mapped read from 0x90005a00, len 256
D: Memory-mapped read from 0x90005b00, len 256
D: Memory-mapped read from 0x90005c00, len 256
D: Memory-mapped read from 0x90005d00, len 256
D: Memory-mapped read from 0x90005e00, len 256
D: Memory-mapped read from 0x90005f00, len 256
D: Memory-mapped read from 0x90006000, len 256
D: Memory-mapped read from 0x90006100, len 256
D: Memory-mapped read from 0x90006200, len 256
D: Memory-mapped read from 0x90006300, len 256
D: Memory-mapped read from 0x90006400, len 256
D: Memory-mapped read from 0x90006500, len 256
D: Memory-mapped read from 0x90006600, len 256
D: Memory-mapped read from 0x90006700, len 256
D: Memory-mapped read from 0x90006800, len 256
D: Memory-mapped read from 0x90006900, len 256
D: Memory-mapped read from 0x90006a00, len 256
D: Memory-mapped read from 0x90006b00, len 256
D: Memory-mapped read from 0x90006c00, len 256
D: Memory-mapped read from 0x90006d00, len 256
D: Memory-mapped read from 0x90006e00, len 50
D: Memory-mapped read from 0x90006e32, len 4
D: Memory-mapped read from 0x90006e36, len 4
D: Memory-mapped read from 0x90006e3a, len 32
D: Memory-mapped read from 0x90006e5a, len 4
D: Memory-mapped read from 0x90006e5e, len 32
D: Memory-mapped read from 0x90006e7e, len 4
D: Memory-mapped read from 0x90006e82, len 256
I: Bootloader chainload address offset: 0x0
I: Image version: v0.0.0
I: Jumping to the first image slot
D: Memory-mapped read from 0x90000400, len 8

Environment (please complete the following information):

  • OS: Windows 11
  • Toolchain: Zephyr SDK, CLion
  • Zephyr: 4.1.99
@Jowllel Jowllel added the bug The issue is a bug, or the PR is fixing a bug label Mar 23, 2025
@JarmouniA JarmouniA added the platform: STM32 ST Micro STM32 label Mar 24, 2025
@JarmouniA
Copy link
Collaborator

@Jowllel it would be more helpful for people who want to help if you could provide a git branch instead of a zip file, and reproduce the issue with a Zephyr sample (for example samples/sysbuild/with_mcuboot) if possible.
FYI there is this PR mcu-tools/mcuboot#2154 that hasn't been merged yet in upstream MCUBoot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants