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

STM b_u585i_iot02a MCUboot crash #49056

Closed
JiiZR opened this issue Aug 15, 2022 · 2 comments
Closed

STM b_u585i_iot02a MCUboot crash #49056

JiiZR opened this issue Aug 15, 2022 · 2 comments
Assignees
Labels
area: MCUBoot 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

@JiiZR
Copy link

JiiZR commented Aug 15, 2022

Describe the bug
MCUboot crashes with latest Zephyr codes.

I: OSPI flash config is OPI / DTR
E: ***** BUS FAULT *****
E: Precise data bus error
E: BFAR Address: 0xff0000cc
E: r0/a1: 0x00000000 r1/a2: 0x2000002c r2/a3: 0x00000000
E: r3/a4: 0x00800000 r12/ip: 0x00000001 r14/lr: 0x08003825
E: xpsr: 0x69000000
E: Faulting instruction address (r15/pc): 0x08005b8c
E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
E: Current thread: 0x200001b8 (unknown)
E: Halting system

First I tried to disable OSPI driver from menuconfig (STM32 Octo SPI Flash driver)
but there is some linking problems:
c:/gnu_arm_embedded/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: zephyr/libzephyr.a(flash_map_default.c.obj):(.rodata.default_flash_map+0x5c): undefined reference to `__device_dts_ord_97'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Then I disabled chip, \bootloader\mcuboot\boot\zephyr\dts.overlay:

&mx25lm51245 {
status = "disabled";
};

and after this MCUboot boots OK. This is workaround for this crash.

To Reproduce
Steps to reproduce the behavior:

  1. west build -p auto -b b_u585i_iot02a boot\zephyr
  2. west flash

Expected behavior
boot without crash

*** Booting Zephyr OS build zephyr-v3.1.0-3576-g6825d8412340 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: primary slot
I: Swap type: none
E: Unable to find bootable image

Impact

Logs and console output

Environment (please complete the following information):

  • OS: Windows
  • Toolchain (e.g Zephyr SDK, ...)
  • Commit SHA or Version used

Additional context

@JiiZR JiiZR added the bug The issue is a bug, or the PR is fixing a bug label Aug 15, 2022
@mmahadevan108 mmahadevan108 added the priority: low Low impact/importance bug label Aug 16, 2022
@erwango erwango assigned ABOSTM and FRASTM and unassigned erwango and ABOSTM Aug 22, 2022
@FRASTM
Copy link
Collaborator

FRASTM commented Aug 24, 2022

Could be a bootloader/mcuboot/boot/zephyr/boards/b_u585i_iot02a.overlay file made of

&mx25lm51245 {
 status = "disabled";
};

This overlay file is found by build operation :
Found devicetree overlay: ../boards/b_u585i_iot02a.overlay

@erwango erwango assigned erwango and unassigned FRASTM Aug 29, 2022
@erwango
Copy link
Member

erwango commented Aug 31, 2022

After anaylis of the crash, it appears this is a duplicated of #49715:
After initialization of the OSPI driver, the stack is corrupted with elements of the SFDP table:

z_sys_init_run_level (level=0, level@entry=2)
    at /local/mcu/zephyrproject/zephyr/kernel/device.c:73
73			if (dev != NULL) {
(gdb) 
CPU in Non-Secure state
CPU in Non-Secure state
0x08005b5e	73			if (dev != NULL) {
(gdb) 
CPU in Non-Secure state
CPU in Non-Secure state
77				if (rc != 0) {
(gdb) p dev
$3 = (const struct device *) 0xff0000c0

@erwango erwango closed this as completed Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: MCUBoot 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

6 participants