ESP32-S2 "acting weird" in the office

lmagalhaes
Posts: 9
Joined: Tue Apr 07, 2020 4:20 pm

ESP32-S2 "acting weird" in the office

Postby lmagalhaes » Thu Jul 29, 2021 8:53 am

Hi there,

I've been working from home and developed all the code for the ESP32-S2. It uses wifi and, when it doesn't have the credentials for hthe SSID it starts a webserver, shows a page where you can enter the SSID and pass, etc. The usual. I have many hours in the development of this and the rest where it enables the communication with a webserver after connecting to your network etc.

I've recently came back to the office and the ESPs (two boards) just refuse to work here. They start with their own AP, I connect to them, connect to the webserver but when it's time to serve the page, they just crash. And it's not always the same crash, sometimes it's

Code: Select all

[0;32mI (9654) wifi softAP: get handler - I ran?[0m
[0;32mI (9654) wifi softAP: /[0m
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x4002bf2d  PS      : 0x00060033  A0      : 0x8002b50e  A1      : 0x3ffc9290  
A2      : 0x00000000  A3      : 0xf09d7484  A4      : 0xb0a0b510  A5      : 0x00000397  
A6      : 0x0000000a  A7      : 0x3ffec9d4  A8      : 0x8002be0b  A9      : 0x3ffc9270  
A10     : 0x3ffc94ec  A11     : 0x3f002f60  A12     : 0x3ffecfa2  A13     : 0x3ffec9c0  
A14     : 0x00000023  A15     : 0x3ffec9c0  SAR     : 0x00000004  EXCCAUSE: 0x0000001c  
EXCVADDR: 0xf09d7484  LBEG    : 0x3ffecfa2  LEND    : 0x3ffec9c0  LCOUNT  : 0x40026089  
Core  0 was running in ISR context:
EPC1    : 0x40112943  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x00000000

Backtrace:0x4002bf2a:0x3ffc9290 0x4002b50b:0x3ffc92b0 0x4002b681:0x3ffc92d0 0x400261ae:0x3ffc92e0 0x4001ad9d:0x3ffecb50 |<-CORRUPTED
Other times it's the watchdog

Code: Select all

[0;32mI (5872) wifi softAP: get handler - I ran?[0m
[0;32mI (5872) wifi softAP: /[0m
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Again with the panicking

Code: Select all

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x4002bf2d  PS      : 0x00060033  A0      : 0x8002b50e  A1      : 0x3ffc9290  
A2      : 0x00000000  A3      : 0xf09d7484  A4      : 0xb0a0b510  A5      : 0x00000d42  
A6      : 0x0000000a  A7      : 0x3ffec9d4  A8      : 0x8002be0b  A9      : 0x3ffc9270  
A10     : 0x3ffc94ec  A11     : 0x3f002f60  A12     : 0x3ffecfa2  A13     : 0x3ffec9c0  
A14     : 0x00000024  A15     : 0x3ffec9c0  SAR     : 0x00000004  EXCCAUSE: 0x0000001c  
EXCVADDR: 0xf09d7484  LBEG    : 0x3ffecfa2  LEND    : 0x3ffec9c0  LCOUNT  : 0x40026089  
Core  0 was running in ISR context:
EPC1    : 0x40112943  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x00000000

Backtrace:0x4002bf2a:0x3ffc9290 0x4002b50b:0x3ffc92b0 0x4002b681:0x3ffc92d0 0x400261ae:0x3ffc92e0 0x4001ad9d:0x3ffecb50 |<-CORRUPTED
And so on... I took the two boards back home yesterday, flashed them and they were working fine with no crashes whatsoever. I left them flashed but without credentials, came to the office this morning and the crashes started again. I was suspicious of the USB capabilities of this laptop vs my home workstation, so I connected it to a bench power supply - the same happened. Got the osciloscope and probed the supply line, clean. Probed the EN line, clean. It seems like a firmware issue, but I can't replicate it at home ... regarding the WDT, I have the following piece of code:

Code: Select all

TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCPU(0);
    if(idle_0 == NULL || esp_task_wdt_delete(idle_0) != ESP_OK){
        ESP_LOGI(TAG,"Failed to remove Core 0 IDLE task from WDT");
    }
which should disable it.. I really have no idea of what's going on and I can't get it to work here for some reason. Can anyone give me some pointers please?

lmagalhaes
Posts: 9
Joined: Tue Apr 07, 2020 4:20 pm

Re: ESP32-S2 "acting weird" in the office

Postby lmagalhaes » Thu Jul 29, 2021 9:07 am

Started commenting some of the active tasks and got this little beauty ...

Code: Select all

[0;32mI (3313) wifi softAP: the handlers were registred succesfully[0m
[0;32mI (3323) wifi softAP: server started correctly[0m
I (3873) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<0,0>, prof:1
I (3873) wifi:station: 04:b1:67:45:a7:8a join, AID=1, bgn, 20
[0;32mI (3883) wifi softAP: station 04:b1:67:45:a7:8a join, AID=1[0m
[0;32mI (4183) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2[0m
W (4883) wifi:<ba-add>idx:4 (ifx:1, 04:b1:67:45:a7:8a), tid:0, ssn:87, winSize:64
[0;32mI (5553) wifi softAP: get handler - I ran?[0m
[0;32mI (5553) wifi softAP: /[0m
Guru Meditation Error: Core  0 panic'ed (Memory protection fault). 
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮Gru Meditation Error: Core  0 panic'ed (Double exception). 

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled

er?

ns1668
Posts: 50
Joined: Tue Mar 16, 2021 2:00 pm

Re: ESP32-S2 "acting weird" in the office

Postby ns1668 » Wed Aug 04, 2021 7:24 am

It would probably be useful to enable the core dump (register printout) on system faults - that would at least give you an address where the fault occurred to start debugging.

I was initially going to suggest power supply but you have already looked at that.
Sounds like a tricky problem - but all the best ones are :P

Who is online

Users browsing this forum: No registered users and 88 guests