zephyr: Espressif HAL5.1 - Core panic'ed on EPS32S3 with hello_world sample

Describe the bug When I compile the hello_world example with the main version of Zephyr, the MCU crashes. This issue has arisen since a few days ago (transition to HAL5.1).

I’m using a custom board based on the ESP32S3 SOC (ESP32-S3-WROOM-2-N32R8V), but to check I used the board esp32s3_devkitc/esp32s3/procpu in Zephyr, since hello_world doesn’t use any external hardware and drivers.

Compiled with : west build -b esp32s3_devkitc/esp32s3/procpu .\samples\hello_world --pristine

To Reproduce Steps to reproduce the behavior:

  1. west build -b esp32s3_devkitc/esp32s3/procpu .\samples\hello_world --pristine
  2. west flash

Impact Zephyr doesn’t start well. (Guru Meditation Error: Core 0 panic’ed (IllegalInstruction))

Logs and console output

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x40050f3f
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:2
load:0x3fc8d1d8,len:0x186c
load:0x40374000,len:0x91b8
SHA-256 comparison failed:
Calculated: 4a27f71faf34de04864aae173eae34d25fba7a4d62a02981b4992fec4ed976a9
Expected: 00000000a0550000000000000000000000000000000000000000000000000000
Attempting to boot anyway...
entry 0x40377784
I (89) boot: ESP Simple boot
I (89) boot: compile time Apr 11 2024 15:56:11
W (89) boot: Unicore bootloader
W (90) spi_flash: Octal flash chip is using but dio mode is selected, will automatically swich to Octal mode
I (97) spi_flash: detected chip: mxic (opi)
I (101) spi_flash: flash io: opi_str
W (104) spi_flash: Detected size(32768k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (117) boot: chip revision: v0.1
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction)
Core 0 register dump:
PC      : 0x42001f50  PS      : 0x00060b30  A0      : 0x8037caf4  A1      : 0x3fceb490
A2      : 0x00000001  A3      : 0x3c010d83  A4      : 0x3c010d8d  A5      : 0x00000078
A6      : 0x3c010d83  A7      : 0x00000009  A8      : 0x803796d4  A9      : 0x3fceb4a0
A10     : 0x00000001  A11     : 0x3c010d83  A12     : 0x3c010d8d  A13     : 0x3fceb4c0
A14     : 0x3fceb4a0  A15     : 0x0000000c  SAR     : 0x00000004  EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000  LBEG    : 0x40056f5c  LEND    : 0x40056f72  LCOUNT  : 0x00000000

Backtrace: 0x42001f50:0x3fceb490 0x4037caf1:0x3fceb4e0 0x4037c64f:0x3fceb510 0x4037c7a8:0x3fceb530 0x40377787:0x3fceb550 0x40045c01:0x3fceb570 0x40043ab6:0x3fceb6f0 0x40034c45:0x3fceb710

and booting in a loop !

Environment (please complete the following information):

  • OS: Windows 11 Pro
  • Zephyr SDK zephyr-sdk-0.16.5
  • Commit SHA or Version used f0212367dc

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (21 by maintainers)

Commits related to this issue

Most upvoted comments

I also have the same issue (genuine ESP32-S3-DevKitC-1 v1.1) and from the module marking it has a ESP32-S3-WROOM-2-N32R8V module…

@Piziwate I was able to reproduce now in a octal flash SPI (same as yours). Will check the issue.

Very glad to hear that. Indeed the current main works for me, too. The first working commit for me is 795ac34f291c, directly after a HAL update (the commit of the HAL change itself did not compile).

In the ESP HAL, a bisect between the commit from the HAL update reveals that commit 30ae474a7f55 (hal: gcc: Compiler flag for strict volatile bitfields) is the one that fixes the problem.

This commit is not currently on v3.7-branch, and indeed, the boot loop occurs there. Cherry-picking the commit mentioned above restores functionality.

@sylvioalves any chance to get this change backported? I would love to be able to use the LTS release on my ESP32S3.

@celinakalus Sounds we should. Although that change fixed the issue, I do need to verify it properly.

I am also eager for a fix. If anyone has a workaround please share!

I got the same issue on latest main, anything new ?

@sylvioalves , I don’t know if your modifications also concerned my issue. I ran a test again this morning and I’m still experiencing continuous restarts with the same message!