Guru Meditation Error with idf v4

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
ttmetro
Posts: 104
Joined: Mon Jul 31, 2017 12:44 am

Guru Meditation Error with idf v4

Post by ttmetro » Mon Dec 14, 2020 4:40 am

I have no problem with esp32-idf3-20200902-v1.13.bin (current ESP32 binary on micropython.org) but with the version compiled with IDF 4 I get the error at the end of this message. Same for binaries I compiled myself (with IDF 4).

Does anyone have suggestions for analyzing the backtrace? I've tried https://github.com/tve/esp32-backtrace but the program produces no output (for this I'm using a self-compiled version to have access to the elf file).

My setup is a bit special: I run Micropython on the ESP32 on particle.io Argon: an nrf52840 with an esp32 as wifi co-processor. The latter can be accessed only via the nrf52. To program I use https://github.com/adafruit/Adafruit_Ci ... iniesptool - a version of esptool written for micropython that runs on the nrf52. As mentioned, it uploads the IDF 3 binary without problem (and the md5 checksums check out). The same IDF 4 binary runs fine on "standalone ESP32" flashed with the standard ESP32 tool.

The reason I mention this is that possibly esptool.py performs extra steps with IDF 4 binaries that the "miniesptool" does not.

Suggestion for diagnosing most appreciated!

Bernhard

```
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5148
load:0x40078000,len:12880
load:0x40080400,len:3484
entry 0x40080630
I (539) cpu_start: Pro cpu up.
I (539) cpu_start: Application information:
I (539) cpu_start: Compile time: Sep 2 2020 03:04:09
I (542) cpu_start: ELF file SHA256: 0000000000000000...
I (548) cpu_start: ESP-IDF: v4.0.1
I (553) cpu_start: Starting app cpu, entry point is 0x40082830
I (0) cpu_start: App cpu up.
I (563) heap_init: Initializing. RAM available for dynamic allocation:
I (570) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (576) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (582) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (588) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM
I (595) heap_init: At 3FFCAD78 len 00015288 (84 KiB): DRAM
I (601) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (607) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (613) heap_init: At 4009E9D8 len 00001628 (5 KiB): IRAM
I (620) cpu_start: Pro cpu start user code
I (638) spi_flash: detected chip: generic
I (639) spi_flash: flash io: dio
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x40119934: 00000b46 1db98700 e0d62181
Core 0 register dump:
PC : 0x40119938 PS : 0x00060f30 A0 : 0x80082751 A1 : 0x3ffe3bc0
A2 : 0x3ffbf128 A3 : 0x3ffbf128 A4 : 0x3ffae270 A5 : 0x3ffae270
A6 : 0x3ffc6bdc A7 : 0x3ffe3b74 A8 : 0x00400000 A9 : 0x00400000
A10 : 0x00000000 A11 : 0x00000000 A12 EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

ELF file SHA256: 0000000000000000

Backtrace: 0x40119935:0x3ffe3bc0 0x4008274e:0x3ffe3c00 0x40082a43:0x3ffe3c50 0x400793f0:0x3ffe3c90 |<-CORRUPTED

Rebooting...
```
Bernhard Boser

ttmetro
Posts: 104
Joined: Mon Jul 31, 2017 12:44 am

Re: Guru Meditation Error with idf v4

Post by ttmetro » Sun Dec 20, 2020 6:17 pm

Not a solution, but a small step towards diagnostic information:

Code: Select all

elf=$IOT49/iotpython/ports/esp32/build-GENERIC_OTA/application.elf
backtrace="0x4011aa95:0x3ffe3be0 0x40082763:0x3ffe3c20 0x4008298d:0x3ffe3c70 0x4007943c:0x3ffe3c90"
arm-none-eabi-addr2line -a -f -e $elf $backtrace
output

Code: Select all

0x4011aa95
spi_flash_cache2phys
??:?
0x40082763
start_cpu0_default
??:?
0x4008298d
call_start_cpu0
??:?
0x4007943c
??
??:0
Seems to indicate the problem occurs during startup, before micropython is even running. Don't know how to get the file names and line numbers.

I'm now trying to compile with IDF 3, of course now without running into new problems ...
Bernhard Boser

ttmetro
Posts: 104
Joined: Mon Jul 31, 2017 12:44 am

Re: Guru Meditation Error with idf v4

Post by ttmetro » Sun Dec 20, 2020 7:04 pm

I've recompiled with idf v3.3 and the error is gone. No idea why.

Also, when trying to compile with idf 3 I got undefined errors. Fixed by adding a line to sdconfig.base. Not sure why I got these errors nor if this is the correct fix, but it ***works*** in my case.

Code: Select all

# v3.3-only (renamed in 4.0)
CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y
----> CONFIG_LOG_BOOTLOADER_LEVEL=CONFIG_LOG_BOOTLOADER_LEVEL_WARN  <--- line added
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=n
Bernhard Boser

Post Reply