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

Cannot boot LVGL apps from external QSPI Flash with MCUBoot #84395

Closed
JarmouniA opened this issue Jan 22, 2025 · 3 comments
Closed

Cannot boot LVGL apps from external QSPI Flash with MCUBoot #84395

JarmouniA opened this issue Jan 22, 2025 · 3 comments
Labels
area: LVGL Light and Versatile Graphics Library Support area: MCUBoot bug The issue is a bug, or the PR is fixing a bug

Comments

@JarmouniA
Copy link
Collaborator

JarmouniA commented Jan 22, 2025

Describe the bug

Cannot boot an app, that uses LVGL, with MCUBoot from external flash on STM32H750B-DK, but I suspect it is not specific to this board (Although I have not yet tested with another one)
I tested with many other apps that do not use LVGL, and everything works as expected, even apps that use the display.
I tested with all available LVGL samples and tests & had the same problem.
Also, I tested with different MCUBoot modes, SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP, DSB_CONFIG_MCUBOOT_MODE_SINGLE_APP..., and with different memory layouts without success.

To Reproduce
Steps to reproduce the behavior:

  1. If you are reproducing on STM32H750B-DK, apply PR mcuboot supports the stm32 external flash in XiP mode mcu-tools/mcuboot#2154 to MCUBoot module repo (you only need the changes in boot/zephyr/boards/stm32h750b_dk.conf, boot/zephyr/boards/stm32h750b_dk.overlay, and boot/zephyr/flash_map_extended.c), with the addition of CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=n CONFIG_BOOT_MAX_IMG_SECTORS=256 in stm32h750b_dk.conf
  2. west build -p always -b stm32h750b_dk samples/hello_world --sysbuild -- -DSB_CONFIG_BOOTLOADER_MCUBOOT=y -DSB_CONFIG_MCUBOOT_MODE_SINGLE_APP=y -DCONFIG_FLASH_BASE_ADDRESS=0x90000000
  3. Add CONFIG_FLASH=y CONFIG_STM32_MEMMAP=y to your app's prj.conf or in stm32h750b_dk.conf
  4. west flash

Alternatively to step 4, you can use STM32CubeProg GUI, select the MT25TL01G_STM32H750B-DISCO external loader (in External loaders at the bottom of left side menu) , and then flash MCUBoot's zephyr.hex and app's zephyr.signed.hex

Expected behavior
Boot the app successfully

Impact
Blocking

Logs and console output

*** Booting MCUboot v2.1.0-rc1-185-gb2299b9fbb41 ***
*** Using Zephyr OS build v4.0.0-3669-ge4164963f22a ***
I: Starting bootloader
I: Bootloader chainload address offset: 0x0
I: Image version: v0.0.0
I: Jumping to the first image slot

Environment (please complete the following information):

  • OS: Linux
  • Toolchain (e.g Zephyr SDK, ...): SDK 0.17.0, default toolchain
  • Commit SHA or Version used: main e416496

Additional context
N/A

@JarmouniA JarmouniA added area: LVGL Light and Versatile Graphics Library Support area: MCUBoot bug The issue is a bug, or the PR is fixing a bug labels Jan 22, 2025
@JarmouniA
Copy link
Collaborator Author

@nordicjm @faxe1008 any idea on what may be causing this?

@faxe1008
Copy link
Collaborator

Hey @JarmouniA,

I just tried running a LVGL app on a mimxrt1060 board with mcuboot and sysbuild and it worked just fine.
Don't have the setup to reproduce your issue, but I'd start by looking into which address mcuboot actually attempts to jump to and if its infact the location of the first image slot and go from there. Can you maybe also attach a debugger and see where the mcu ends up?

@JarmouniA
Copy link
Collaborator Author

Turns out it is an MPU problem, I was able to boot the LVGL app from external QSPI Flash with CONFIG_ARM_MPU=n.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: LVGL Light and Versatile Graphics Library Support area: MCUBoot bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

3 participants