ESP32C3 - Core 0 panic'ed (illegal instruction)

moh.maya
Posts: 7
Joined: Wed Sep 08, 2021 4:23 pm

ESP32C3 - Core 0 panic'ed (illegal instruction)

Postby moh.maya » Mon Apr 18, 2022 6:20 pm

Hello,

I am trying to understand what this error means. I am trying to build and flash the 'Hello World' example project via VS Code, using the Espressif extension when I get this error.

I have 3 prototype boards, and the flashing worked fine for 2 of the boards - I could see 'Hello World' in the serial monitor after flashing. But I got this error for the 3rd board. Is this a hardware issue that I can circumvent?

Thank you!

Code: Select all

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0xe (SPI_FAST_FLASH_BOOT)
Saved PC:0x40052b02
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x1850
load:0x403ce000,len:0xc88
load:0x403d0000,len:0x2dbc
SHA-256 comparison failed:
Calculated: c78f739446bf6e8e038da0fa20391e21a9f51d732c9ca3fb3bc1b2ccc6be8b9e
Expected: a460f8b922b85ed0e4dea286619f81898f94680a193f612bffdffe2fb6dfcc8b
Attempting to boot anyway...
entry 0x403ce000
Guru Meditation Error: Core 0 panic'ed (Illegal instruction)
Core 0 register dump:
PC      : 0x00000000  RA      : 0x403ce016  SP      : 0x3fcde4b0  GP      : 0x00000000
TP      : 0x00000000  T0      : 0x00000000  T1      : 0x00000000  T2      : 0x3fcde59c
S0      : 0x000052d0  S1      : 0x00000005  A0      : 0x00000011  A1      : 0x0000000a
A2      : 0x00000000  A3      : 0x6000001c  A4      : 0x00000000  A5      : 0x3fcde4b0
A6      : 0x80000000  A7      : 0x00000010  S2      : 0x00000000  S3      : 0x3fce0000
S4      : 0x0000ffff  S5      : 0x3ff1c14c  S6      : 0x000052c4  S7      : 0x3fcdf000
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x00000000  T4      : 0x00000080  T5      : 0x05000000  T6      : 0x00000000
MSTATUS : 0x00001881  MCAUSE  : 0x00000002  MTVAL   : 0x00000000  INTLEVEL: 0x00000001


Stack memory:
3fcde4b0: 0x63333034 0x30303065 0x7f7fc600 0x00000000 0x00000000 0x00000000 0x00000000 0x3fcdf000
3fcde4d0: 0x000052c4 0x3ff1c14c 0x0000ffff 0x00000000 0x00000000 0x00000000 0x00000000 0x3fcdf000
3fcde4f0: 0x000052c4 0x3ff1c14c 0x0000ffff 0x3fce0000 0x00000000 0x00000005 0x000052d0 0x40048722
3fcde510: 0x00000000 0x00000000 0x00000000 0x400498ea 0x000052c4 0x0000008b 0x00000000 0x3fcde544
3fcde530: 0x00000000 0x3c0052ef 0x80000000 0x4004a292 0x00000000 0x403ce000 0x3fcde544 0x00000100
3fcde550: 0x600c5200 0x00000005 0x000052d0 0x4004a296 0x2472ed65 0x4cb748f6 0x3fcde668 0x00000000
3fcde570: 0x32623032 0x00000000 0x00010000 0x2f0203e9 0x403ce000 0x403d0000 0x00002dbc 0x000000ee
3fcde590: 0x00030005 0x00000000 0x01000000 0x3c0052d0 0x7533885e 0x94738fc7 0x8e6ebf46 0xfaa08d03
3fcde5b0: 0x211e3920 0x731df5a9 0xfba39c2c 0xccb2c13b 0x9e8bbec6 0x00000000 0x00000000 0x00000000
3fcde5d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x3fcde700 0x00000101 0x00000002
3fcde5f0: 0x94738fc7 0x8e6ebf46 0xfaa08d03 0x211e3920 0x731df5a9 0xfba39c2c 0xccb2c13b 0x9e8bbec6
3fcde610: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde630: 0x00008082 0x00000000 0x00000000 0x05000000 0x00000080 0x00000000 0x00000000 0x00000000
3fcde650: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x80960200
3fcde670: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde690: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde6b0: 0x00029800 0x00000000 0x00000000 0x00000000 0x3ff1ba60 0x3ff1ba70 0x3ff1b9ec 0x00000000
3fcde6d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde6f0: 0x01312d00 0x00000000 0x00000007 0x40047eb6 0x00000000 0x00000000 0x00000000 0x00000000
3fcde710: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde730: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde750: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde770: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde790: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde7b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde7d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde7f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde810: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde830: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde850: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde870: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcde890: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000

hustenhabas
Posts: 18
Joined: Tue Sep 14, 2021 2:18 pm

Re: ESP32C3 - Core 0 panic'ed (illegal instruction)

Postby hustenhabas » Mon Apr 18, 2022 6:48 pm

try using esptool.py erase_flash and then try flashing the app again

do you have this option enabled on sdkconfig? :

"Enable flash encryption on boot"

moh.maya
Posts: 7
Joined: Wed Sep 08, 2021 4:23 pm

Re: ESP32C3 - Core 0 panic'ed (illegal instruction)

Postby moh.maya » Mon Apr 18, 2022 7:41 pm

hustenhabas wrote:
Mon Apr 18, 2022 6:48 pm
try using esptool.py erase_flash and then try flashing the app again

do you have this option enabled on sdkconfig? :

"Enable flash encryption on boot"



Thank you!

The 'Enable flash encryption on boot' option is currently not selected; I hesitate to, since the tooltip says
'Note: After first boot, the system will be permanently encrypted. Re-flashing an excrypted system is complicated and not always possible.'
Would you suggest I enable the option in this instance?

I used

Code: Select all

idf.py -p COM3 erase-flash
The terminal output (pasted below) indicated that the flash erase was successful:

Code: Select all

C:\Users\moh.maya\esp\esp-idf\components/esptool_py/esptool/esptool.py -p COM3 -b 460800 --before default_reset --after hard_reset --chip esp32c3 erase_flash"...
esptool.py v3.2-dev
Serial port COM3
Connecting....
Chip is ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: a0:76:4e:6c:6c:4c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Erasing flash (this may take a while)...
Chip erase completed successfully in 32.9s
Hard resetting via RTS pin...
Done
after which I got the following output on the serial monitor

Code: Select all

invalid header: 0xffffffff
invalid header�ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x1 (POWERON),boot:0xe (SPI_FAST_FLASH_BOOT)
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
I then re-flashed the hello world example. However, I continue to get the same / similar error as the 1st post.

Code: Select all

Build:Feb  7 2021
rst:0x1 (POWERON),boot:0xe (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x16b4
load:0x403ce000,len:0x930
load:0x403d0000,len:0x2d40
SHA-256 comparison failed:
Calculated: 62eabb53b0ff441f20a7a59f5484f5501436c379f729e15ebb7e3f174f2ce0b5
Expected: 3de4e4a65b974d4bccd976bdffa02eb4791d95f9afb9ca1c1fb5b70aa09a4f34
Attempting to boot anyway...
entry 0x403ce000
I (48) boot: ESP-IDF v4.4 2nd stage bootloader
I (49) boot: compile time 00:00:40
I (49) boot: chip revision: 3
I (50) boot.esp32c3: SPI Speed      : 80MHz
I (55) boot.esp32c3: SPI Mode       : DIO
I (60) boot.esp32c3: SPI Flash Size : 4MB
Guru Meditation Error: Core 0 panic'ed (Illegal instruction)
Stack dump detected
Core 0 register dump:
PC      : 0x403ce5a6  RA      : 0x403ce3a8  SP      : 0x3fcde450  GP      : 0x00000000
TP      : 0x00000000  T0      : 0x60002000  T1      : 0x5c000007  T2      : 0x0fffffff
S0      : 0x00000000  S1      : 0x3fcd7000  A0      : 0x3fcde450  A1      : 0x60002000
A2      : 0x60002000  A3      : 0xefffffff  A4      : 0x00000003  A5      : 0x60008000
A6      : 0x00000000  A7      : 0xf7ffffff  S2      : 0x00000004  S3      : 0x3fce0000
S4      : 0x00000000  S5      : 0x3ff1c14c  S6      : 0x00004d54  S7      : 0x3fcdf000
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x80000000  T4      : 0x00ac2008  T5      : 0x00000007  T6      : 0x03ffffff
MSTATUS : 0x00001881  MCAUSE  : 0x00000002  MTVAL   : 0xc23ece07  INTLEVEL: 0x00000001

chegewara
Posts: 2306
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32C3 - Core 0 panic'ed (illegal instruction)

Postby chegewara » Tue Apr 19, 2022 1:26 am

moh.maya wrote:rst:0x1 (POWERON),boot:0xe (SPI_FAST_FLASH_BOOT)
I would suggest to compare this line with other boards. I am not sure, but it looks like problem with bootstrap pins (maybe bad soldering?).

moh.maya
Posts: 7
Joined: Wed Sep 08, 2021 4:23 pm

Re: ESP32C3 - Core 0 panic'ed (illegal instruction)

Postby moh.maya » Tue Apr 19, 2022 11:13 am

chegewara wrote:
Tue Apr 19, 2022 1:26 am
moh.maya wrote:rst:0x1 (POWERON),boot:0xe (SPI_FAST_FLASH_BOOT)
I would suggest to compare this line with other boards. I am not sure, but it looks like problem with bootstrap pins (maybe bad soldering?).
Hello,

I see the same line in the boards that are working (and the sha256 comparison failure / difference). So not sure if this is the reason for this board not working.

Thank you! :)

hustenhabas
Posts: 18
Joined: Tue Sep 14, 2021 2:18 pm

Re: ESP32C3 - Core 0 panic'ed (illegal instruction)

Postby hustenhabas » Tue Apr 19, 2022 5:46 pm

https://docs.espressif.com/projects/esp ... -instr-msg

this might help. Can you post the code?

ESP_Sprite
Posts: 9577
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32C3 - Core 0 panic'ed (illegal instruction)

Postby ESP_Sprite » Wed Apr 20, 2022 1:00 am

I still think it may be a hardware error... do you happen to have a (known-good) esp32c3 devboard you can flash this to? Do you have a schematic of your board you can share?

Who is online

Users browsing this forum: No registered users and 121 guests