Running network and setting up GATT server causes Guru Mediation Error
Hello! I am running MicroPython v1.22.1 on 2024-01-05; ESP32C3 module with ESP32C3.
I have built a web server with micropython before and have used the aioble module as well in another project. Now, in a new project that will use both network and aioble. I am in the setting up the GATT server and connecting to wifi and when I run the script I get this error and micropython reboots.
I'll link the log here:
MPY: soft reboot
Guru Meditation Error: Core 0 panic'ed (Load access fault). Exception was unhandled.
Core 0 register dump:
MEPC : 0x40384592 RA : 0x403844dc SP : 0x3fcd8d70 GP : 0x3fc97e00
TP : 0x3fc9e97c T0 : 0x00000000 T1 : 0x00000000 T2 : 0x00000000
S0/FP : 0xffffffff S1 : 0x00000000 A0 : 0x00000000 A1 : 0xffffffff
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x00000000 A5 : 0x3fca0000
A6 : 0x00000000 A7 : 0x00000000 S2 : 0x3fca0000 S3 : 0x3fc9fa28
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000005 MTVAL : 0x00000000
MHARTID : 0x00000000
Stack memory:
3fcd8d70: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8d90: 0x00000000 0x3fca0000 0x00000000 0x40383fc2 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8db0: 0x00000000 0x00000000 0x00000000 0x42033ec0 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8dd0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
3fcd8df0: 0xa5a5a5a5 0xa5a5a5a5 0x0000015c 0x3fcd8d50 0x3fca1674 0x3fc9ac38 0x3fc9ac38 0x3fcd8dfc
3fcd8e10: 0x3fc9ac30 0x00000004 0x00000000 0x00000000 0x3fcd8dfc 0x00000000 0x00000015 0x3fcd7df8
3fcd8e30: 0x626d696e 0x685f656c 0x0074736f 0x00000000 0x00000000 0x3fcd8df0 0x00000015 0x00000000
3fcd8e50: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x3fca1c5c 0x3fca1cc4 0x3fca1d2c
3fcd8e70: 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x42121560 0x00000000
3fcd8e90: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8eb0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8ed0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8ef0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8f10: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8f30: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8f50: 0x00000000 0x3f000000 0x000037b1 0x3fca1674 0x3fca1674 0x00000000 0x00000000 0x00000000
3fcd8f70: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8f90: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8fb0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8fd0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd8ff0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd9010: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd9030: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd9050: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd9070: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd9090: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd90b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd90d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd90f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd9110: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd9130: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd9150: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
ELF file SHA256: 03a427956fd9ca12
Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x403807a8
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0xe8c
load:0x403cc710,len:0x6ec
load:0x403ce710,len:0x2b24
entry 0x403cc710
MicroPython v1.22.1 on 2024-01-05; ESP32C3 module with ESP32C3
Type "help()" for more information.
ESP32 4MB RAM Guru Meditation Crash On Initializing UART
Good Evening and Merry Christmas!
I was doing an ESP32 Micropython project that happens to use a serial port (UART 1) and decided I needed more RAM. After ordering a TTGO T8 V1.7 (ESP32, 4MB RAM, integrated MicroSD port) and setting up the most recent MicroPython build for SPI RAM, it would always reboot with a guru meditation error when I ran my code. After some poking around I found out that either declaring or initiating a UART would cause a guru meditation error and reset the ESP32. On the same board, the non-SPI RAM build does not do this. I tested this on the 3 most recent ESP32 SPIRAM builds from the download page.
Here's an example of this error on a freshly flashed copy of Micropython with nothing in boot.py:
MicroPython v1.12 on 2019-12-20; ESP32 module (spiram) with ESP32
Type "help()" for more information.
>>> from machine import UART
>>> uart = UART(1,baudrate=19200)
^[[0;32mI (27310) uart: ALREADY NULL^[[0m
>>>
>>>
>>> uart.init()
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400dfc04 PS : 0x00060930 A0 : 0x800d2d91 A1 : 0x3ffc2300
A2 : 0x3f8177c0 A3 : 0x000000b1 A4 : 0x3ffc2320 A5 : 0xffddcccc
A6 : 0x00000001 A7 : 0x000000ff A8 : 0x00000019 A9 : 0x3ffc22e0
A10 : 0xffddcccc A11 : 0x00000001 A12 : 0x00000001 A13 : 0x3ffb32c0
A14 : 0x00000003 A15 : 0x3ffc24c0 SAR : 0x00000000 EXCCAUSE: 0x0000001c
EXCVADDR: 0xffddcce8 LBEG : 0x400d2fa8 LEND : 0x400d3000 LCOUNT : 0x00000000
ELF file SHA256: 0000000000000000000000000000000000000000000000000000000000000000
Backtrace: 0x400dfc04:0x3ffc2300 0x400d2d8e:0x3ffc2320 0x400f5c30:0x3ffc2360 0x400d3003:0x3ffc2380 0x400d28dd:0x3ffc23a0 0x400d67a1:0x3ffc23c0 0x40104b32:0x3ffc2440 0x40104db4:0x3ffc24e0 0x400f5b1c:0x3ffc2520 0x40092d59:0x3ffc2550
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_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:4844
load:0x40078000,len:10532
load:0x40080400,len:6736
entry 0x400806f0
^[[0;32mI (534) psram: This chip is ESP32-D0WD^[[0m
^[[0;32mI (534) spiram: Found 64MBit SPI RAM device^[[0m
^[[0;32mI (534) spiram: SPI RAM mode: flash 40m sram 40m^[[0m
^[[0;32mI (537) spiram: PSRAM initialized, cache is in low/high (2-core) mode.^[[0m
^[[0;32mI (544) cpu_start: Pro cpu up.^[[0m
^[[0;32mI (548) cpu_start: Application information:^[[0m
^[[0;32mI (553) cpu_start: Compile time: Dec 20 2019 07:52:43^[[0m
^[[0;32mI (559) cpu_start: ELF file SHA256: 0000000000000000...^[[0m
^[[0;32mI (565) cpu_start: ESP-IDF: v3.3^[[0m
^[[0;32mI (570) cpu_start: Starting app cpu, entry point is 0x40083d90^[[0m
^[[0;32mI (562) cpu_start: App cpu up.^[[0m
^[[0;32mI (1446) spiram: SPI SRAM memory test OK^[[0m
^[[0;32mI (1446) heap_init: Initializing. RAM available for dynamic allocation:^[[0m
^[[0;32mI (1446) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM^[[0m
^[[0;32mI (1453) heap_init: At 3FFBA658 len 000259A8 (150 KiB): DRAM^[[0m
^[[0;32mI (1459) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM^[[0m
^[[0;32mI (1465) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM^[[0m
^[[0;32mI (1472) heap_init: At 400973F0 len 00008C10 (35 KiB): IRAM^[[0m
^[[0;32mI (1478) cpu_start: Pro cpu start user code^[[0m
^[[0;32mI (155) cpu_start: Chip Revision: 1^[[0m
^[[0;33mW (155) cpu_start: Chip revision is higher than the one configured in menuconfig. Suggest to upgrade it.^[[0m
^[[0;32mI (158) cpu_start: Starting scheduler on PRO CPU.^[[0m
^[[0;32mI (0) cpu_start: Starting scheduler on APP CPU.^[[0m
MicroPython v1.12 on 2019-12-20; ESP32 module (spiram) with ESP32
Type "help()" for more information.
>>>
>>>
>>>
Apologies for odd formatting, that was copied straight from upycraft and it handles characters a bit weirdly.