ESP32 Device crashing with __divdf3 in ROM

dalohar
Posts: 33
Joined: Tue Jul 28, 2020 6:42 am

ESP32 Device crashing with __divdf3 in ROM

Postby dalohar » Thu Jun 27, 2024 3:44 am

Hi,

I am following setup.
Device: ESP32-WROVER-E 16 MB
ESP-IDF: v5.1.1

We have encountered an device crash and below is the log for the same.
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x400dd229 PS : 0x00060830 A0 : 0x800dc5d6 A1 : 0x3ffed5f0
0x400dd229: iot_light_fade_with_time at H:/glad-emb/space-automation/esp/rainmaker/firmwares-V3/common/app_led_driver/iot_light.c:445 (discriminator 3)

A2 : 0x00000034 A3 : 0x4051f7f0 A4 : 0x00000040 A5 : 0x0000000d
A6 : 0x3ffd8b94 A7 : 0x409f0738 A8 : 0x800dd222 A9 : 0x3ffed5e0
A10 : 0x000001a5 A11 : 0x40765300 A12 : 0x00000009 A13 : 0x00000165
A14 : 0x7ff00000 A15 : 0x7ff65300 SAR : 0x00000017 EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000034 LBEG : 0x400029ac LEND : 0x400029cb LCOUNT : 0x00000000
0x400029ac: __divdf3 in ROM
0x400029cb: __divdf3 in ROM

Can anyone please help me onthe same to understand what exactly this issue is?

Regards,

Dinesh

MicroController
Posts: 1734
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32 Device crashing with __divdf3 in ROM

Postby MicroController » Thu Jun 27, 2024 6:46 am

The issue is that in or around line 445 in iot_light_fade_with_time(...) in iot_light.c a write to memory address 0x34 was executed, likely because a nullpointer (to a structure or array) was dereferenced.

Don't get thrown off by

Code: Select all

... LBEG : 0x400029ac LEND : 0x400029cb ...
0x400029ac: __divdf3 in ROM
0x400029cb: __divdf3 in ROM
This is just the idf monitor mapping whatever addresses were last put into in the LBEG and LEND registers to code locations. In this specific case, a ROM function for double-precision floating point division happened to be the last one to use a LOOP instruction (setting LBEG and LEND) at some arbitrary time prior to the crash; memcpy is another ROM function which uses LOOP, and because it's used frequently in many programs you'll often find "memcpy in ROM" decoded from LBEG/LEND at this place without it having any connection to the actual cause of the exception.

Who is online

Users browsing this forum: ESP_Roland, Majestic-12 [Bot] and 118 guests