Esp32 crashing problem

Hi community…
I was updating my libs when i discovered than some of them are not anymore supported.

lib_deps = 
	me-no-dev/AsyncTCP@^1.1.1
	me-no-dev/ESP Async WebServer@^1.2.3

In order to be able to compile i had to use the ltest version

	ESP32Async/AsyncTCP
	ESP32Async/ESPAsyncWebServer

and moreover update my platform to .6.3.2

I was able to compile but now when i try to send data with ssl and wifi with mqtt my system is crashing… I was wondering if some of them had this issue or if you can share the old libs… thanks

rst:0x1 (POWERON_RESET),boot:0x12 (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:0x3fff0030,len:1184
load:0x40078000,len:13192
load:0x40080400,len:3028
entry 0x400805e4
E (556) esp_core_dump_flash: No core d�f�␆␗$�X.]Z�Z�␋�֫��VRH�␔␒�S�S%�Y.\5�KW�E���}���͡�␂r��␚�ɕ�"յ�����ѥѥ���2�չ��jR�␅ ␒R&�W+QW�Y.&�KZX�K,]�,'&MMW��␖�(�]��V�W�kV5��J�␂���J␂�␂z␂�␂�␂���␂j��␂
␅%J␂������␂B�5R�[ 38][V][Preferences.cpp:352] getUChar(): nvs_get_u8 fail: fota NOT_FOUND
[ 38][E][Preferences.cpp:483] getString(): nvs_get_str len fail: fota_url NOT_FOUND
[ 41][E][Preferences.cpp:483] getString(): nvs_get_str len fail: fota_command NOT_FOUND
[ 51][V][Preferences.cpp:352] getUChar(): nvs_get_u8 fail: is_setup_done NOT_FOUND
[ 57][E][Preferences.cpp:483] getString(): nvs_get_str len faiListing directory: /
FILE: embedded.txt SIZE: 3018
FILE: rsa_key.pub SIZE: 800
Reading file: /board_ec.txt
− failed to open file for reading
[ 190][W][SPIFFS.cpp:71] begin(): SPIFFS Already Mounted!
1221
1676
73
88
E (360) uart: uaEthernet cable is not connected.
Joined LAN with IP 0.0.0.0
Starting LAN
Waiting on time sync…
NTP failed!!
Current date + time: 01/01/70 - 12:00AM
NTP sync failed, time is behind…
[ 13612][E][Preferences.cpp:483] getString(): nvs_get_str len fail: rec_ssid NOT_FOUND
[ 13614][E][Preferences.cpp:483] getString(): nvs_get_str len fail: rec_password NOT_FOUND
[ 13637][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 0 - WIFI_READY
[ 13729][V][WiFiGeneric.cpp:340] _arduino_event_cb(): STA Started
[ 13730][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 2 - STA_START
[ 13734][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
Connecting to Wi-Fi
[ 13844][V][WiFiGeneric.cpp:355] _arduino_event_cb(): STA Connected: SSID: 769D4F, BSSID: f8:da:0c:76:9d:55, Channel: 6, Auth: WPA_WPA2_PSK
[ 13846][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
…[ 17370][V][WiFiGeneric.cpp:369] _arduino_event_cb(): STA Got New IP:192.168.0.49
[ 17371][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 7 - STA_GOT_IP
[ 17374][D][WiFiGeneric.cpp:1098] _eventCallback(): STA IP: 192.168.0.49, MASK: 255.255.255.0, GW: 192.168.0.1
.[ 17753][W][SPIFFS.cpp:71] begin(): SPIFFS Already Mounted!
Waiting on time sync…
Connecting to AWS IOT
[ 21145][V][ssl_client.cpp:62] start_ssl_client(): Free internal heap before TLS 106680
[ 21146][V][ssl_client.cpp:68] start_ssl_client(): Starting socket
[ 21198][V][ssl_client.cpp:146] start_ssl_client(): Seeding the random number generator
[ 21200][V][ssl_client.cpp:155] start_ssl_client(): Setting up the SSL/TLS structure…
[ 21204][V][ssl_client.cpp:178] start_ssl_client(): Loading CA cert
[ 21216][V][ssl_client.cpp:234] start_ssl_client(): Loading CRT cert
[ 21220][V][ssl_client.cpp:243] start_ssl_client(): Loading private key
[ 21226][V][ssl_client.cpp:254] start_ssl_client(): Setting hostname for TLS session…
[ 21229][V][ssl_client.cpp:269] start_ssl_client(): Performing the SSL/TLS handshake…
[ 22906][D][ssl_client.cpp:282] start_ssl_client(): Protocol is TLSv1.2 Ciphersuite is TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
[ 22906][D][ssl_client.cpp:284] start_ssl_client(): Record expansion is 29
[ 22913][V][ssl_client.cpp:290] start_ssl_client(): Verifying peer X.509 certificate…
[ 22920][V][ssl_client.cpp:298] start_ssl_client(): Certificate verified.
[ 22927][V][ssl_client.cpp:313] start_ssl_client(): Free internal heap after TLS 60816
[ 22935][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 23 bytes…
[ 23047][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 33 bytes…
[ 23052][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 31 bytes…
AWS IoT Connected!
NORMAL_STATE!
IOT IS MODBUS
{“serial”:“123456789”,“time”:“2025-02-06T22:37:31Z”,“bootTimestamp”:“2025-02-06T22:37:31Z”,“fw”:“1.0.0”,“hw”:“0.0.1”,“wifiSsid”:“769D4F”,“ethernet”:0,“ipAddress”:“\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000”,“status”:"BOO
Error: ‘parity_bit’ not found in NVS! Using default.
[ 23082][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 278 bytes…
Modbus Role: 1, Baudrate: 9600, Data Bits: 8, Stop Bits: 1, PaGuru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x400dfadb PS : 0x00060130 A0 : 0x800dfad8 A1 : 0x3ffd9aa0
A2 : 0x00000000 A3 : 0x00000001 A4 : 0x3ffb4d10 A5 : 0x000000fa
A6 : 0x00000000 A7 : 0x00000a00 A8 : 0x801705e8 A9 : 0x3ffd9a80
A10 : 0x00000000 A11 : 0x00000001 A12 : 0x3ffb4d10 A13 : 0x00000017
A14 : 0x00000000 A15 : 0xff000000 SAR : 0x0000000a EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4008462d LEND : 0x40084635 LCOUNT : 0x00000027

Backtrace: 0x400dfad8:0x3ffd9aa0 0x400dfad5:0x3ffd9ac0 0x400d4cb9:0x3ffd9ae0 0x400db699:0x3ffd9b00 0x400d3cc4:0x3ffd9c70 0x400d3693:0x3ffd9c90

You should check your code. Form the messages I can see that you’re at least trying to initialize SPIFFS multiple times!

Also check why the key’s in Prefences not found.

But the root cause of the crash is clearly:

Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.

You’re writing to an invalid memory location. There can be multiple reasons:

  • writing to a location that has not been allocated
  • writing to a location that has been released before
  • writing to an array but out of bounds (int arr[3]; arr[5] = 42;)

A good way to find out where the crash happens is to use the exception decoder in platformio.ini:

monitor_filters = esp32_exception_decoder

This should give you a hint where to look.

Example:

Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400d1698  PS      : 0x00060530  A0      : 0x800d3645  A1      : 0x3ffb2240  
A2      : 0x00000000  A3      : 0x00000003  A4      : 0x00000001  A5      : 0xffffffff
A6      : 0xffffffff  A7      : 0x00000020  A8      : 0x00000000  A9      : 0x0000002a  
A10     : 0x0000000d  A11     : 0x3f400120  A12     : 0x00000000  A13     : 0x0001c200  
A14     : 0x00000001  A15     : 0x0000000b  SAR     : 0x0000000c  EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000000  LBEG    : 0x40086161  LEND    : 0x40086171  LCOUNT  : 0xfffffffc  


Backtrace: 0x400d1695:0x3ffb2240 0x400d3642:0x3ffb2270 0x40088be9:0x3ffb2290
  #0  0x400d1695 in setup() at src/main.cpp:8
  #1  0x400d3642 in loopTask(void*) at C:/Users/boris/.platformio/packages/framework-arduinoespressif32-src-77c8e93767360b28deee4aedf5d0a1ab/cores/esp32/main.cpp:59
  #2  0x40088be9 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139

In this case #0 leads to “setup() at src/main.cpp:8

Example program of this crash:

#include <Arduino.h>

void setup() {
    Serial.begin(115200);
    Serial.println("Hello World");
 
    int* intPtr;
    *intPtr = 42;
}

void loop() {}

A look at line 7 to 8:

    int* i;
    *i = 42; //<-- here does the crash happen as the memory for the int ist not allocated yet