Debugging LoadProhibited from Windows 10

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Debugging LoadProhibited from Windows 10

Postby william.ferguson.au » Fri Feb 26, 2021 4:07 am

I'm getting a LoadProhibited out of a library that I have been happily using for several years.

Code: Select all

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

Core  0 register dump:
PC      : 0x400dc335  PS      : 0x00060e30  A0      : 0x800e620c  A1      : 0x3ffda3e0
0x400dc335: ArduinoJson::Internals::JsonSerializer<ArduinoJson::Internals::JsonWriter<ArduinoJson::Internals::DummyPrint> >::serialize(ArduinoJson::JsonVariant const&, ArduinoJson::Internals::JsonWriter<ArduinoJson::In
ternals::DummyPrint>&) at e:\source\wylas\wt_trinity\build/../components/ArduinoJson/src/ArduinoJson/Serialization/JsonSerializerImpl.hpp:45
 (inlined by) ArduinoJson::Internals::JsonSerializer<ArduinoJson::Internals::JsonWriter<ArduinoJson::Internals::DummyPrint> >::serialize(ArduinoJson::JsonVariant const&, ArduinoJson::Internals::JsonWriter<ArduinoJson::
Internals::DummyPrint>&) at e:\source\wylas\wt_trinity\build/../components/ArduinoJson/src/ArduinoJson/Serialization/JsonSerializerImpl.hpp:78

A2      : 0x0000001b  A3      : 0x3ffda540  A4      : 0x0000001b  A5      : 0x0000ff00
A6      : 0x00ff0000  A7      : 0x40404040  A8      : 0x3f40527c  A9      : 0x3ffda3d0
A10     : 0x0000001e  A11     : 0x3f405254  A12     : 0x000000ff  A13     : 0x0000ff00
A14     : 0x00ff0000  A15     : 0xff000000  SAR     : 0x00000001  EXCCAUSE: 0x0000001c
EXCVADDR: 0x0000001f  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xfffffffe

Backtrace:0x400dc332:0x3ffda3e0 0x400e6209:0x3ffda440 0x400e62a3:0x3ffda570 0x400e3cb6:0x3ffda5a0 0x4008df3d:0x3ffda5d0
0x400dc332: ArduinoJson::Internals::JsonSerializer<ArduinoJson::Internals::JsonWriter<ArduinoJson::Internals::DummyPrint> >::serialize(ArduinoJson::JsonVariant const&, ArduinoJson::Internals::JsonWriter<ArduinoJson::In
ternals::DummyPrint>&) at e:\source\wylas\wt_trinity\build/../components/ArduinoJson/src/ArduinoJson/Serialization/JsonSerializerImpl.hpp:44
 (inlined by) ArduinoJson::Internals::JsonSerializer<ArduinoJson::Internals::JsonWriter<ArduinoJson::Internals::DummyPrint> >::serialize(ArduinoJson::JsonVariant const&, ArduinoJson::Internals::JsonWriter<ArduinoJson::
Internals::DummyPrint>&) at e:\source\wylas\wt_trinity\build/../components/ArduinoJson/src/ArduinoJson/Serialization/JsonSerializerImpl.hpp:78

0x400e6209: sendClientConfigRequest() at e:\source\wylas\wt_trinity\build/../components/ArduinoJson/src/ArduinoJson/Serialization/JsonSerializerImpl.hpp:47
 (inlined by) ?? at e:\source\wylas\wt_trinity\build/../components/ArduinoJson/src/ArduinoJson/Deserialization/../Serialization/JsonPrintable.hpp:35
 (inlined by) ?? at e:\source\wylas\wt_trinity\build/../components/ArduinoJson/src/ArduinoJson/Deserialization/../Serialization/JsonPrintable.hpp:96
 (inlined by) sendClientConfigRequest() at e:\source\wylas\wt_trinity\build/../components/wylas-libs/wylas-messages/wt_messages.cpp:134

0x400e62a3: on_connection_changed(event_type) at e:\source\wylas\wt_trinity\build/../components/wylas-libs/wylas-messages/wt_messages.cpp:439 (discriminator 8)

0x400e3cb6: postEventToCallbackTask(void*) at e:\source\wylas\wt_trinity\build/../components/wylas-libs/wylas-messages/wt_event_bus.cpp:55

0x4008df3d: vPortTaskWrapper at E:/Dev/Espressif/esp-idf/components/freertos/port/xtensa/port.c:168
I have spent the last 5 days trying to dig into into and have been frustrated by not being able to get any kind of debugger to attach to the ESP32. Config is:
  • ESP32-WROOM-32D
  • Windows 10 (dev machine)
  • esp-idf release/v4.3
  • Build is CMake from the command line
  • CLion as the IDE
Just trying to start up gdbserver is met with:

Code: Select all

:3333: No connection could be made because the target machine actively refused it.
Can anyone point me at some clear and simple instructions for how to debug the ESP32 from a Windows environment?

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Re: Debugging LoadProhibited from Windows 10

Postby william.ferguson.au » Sun Feb 28, 2021 4:05 am

Anyone?

MichelMayoud
Posts: 1
Joined: Tue Apr 13, 2021 2:02 pm

Re: Debugging LoadProhibited from Windows 10

Postby MichelMayoud » Tue Apr 13, 2021 5:49 pm

Hi,
I have a problem similar, I read on internet that it could be linked to a insufficient power supply.
I'm using an ESP32 ttgo board and I have a similar issue that I can't fixe.
My program send a http request and it works most of time but with a random frequency it crashes with following return :
" 00:07:54.986 -> Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
00:07:54.986 -> Core 1 register dump:
00:07:54.986 -> PC : 0x400014fd PS : 0x00060730 A0 : 0x800d2b8d A1 : 0x3ffb1f00
00:07:54.986 -> A2 : 0x88000000 A3 : 0x87fffffc A4 : 0x000000ff A5 : 0x0000ff00
00:07:54.986 -> A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x3ffb1ed0
00:07:54.986 -> A10 : 0x3ffb1f40 A11 : 0x00000000 A12 : 0x3ffbddd8 A13 : 0x0000ff00
00:07:54.986 -> A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x00000000 EXCCAUSE: 0x0000001c
00:07:54.986 -> EXCVADDR: 0x88000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff
00:07:54.986 ->
00:07:54.986 -> ELF file SHA256: 0000000000000000
00:07:54.986 ->
00:07:54.986 -> Backtrace: 0x400014fd:0x3ffb1f00 0x400d2b8a:0x3ffb1f10 0x400d1179:0x3ffb1f30 0x400d13b2:0x3ffb1f70 0x400d14b5:0x3ffb1f90 0x400d2c69:0x3ffb1fb0 0x4008692d:0x3ffb1fd0 "
I tried to use tinyGSM library and softwareserial with AT request, both give the same issue.

- Board version SIM800L IP5306 20190610
- Development tool : EDI Arduino,

I installed a tool "ESP Exception Decoder" that give me the last executed code, just as an example, with the message obove, I get the following return with the last executed code before the crash:

"Decoding stack results
0x400d2b8a: uartBegin at C:\Users\miche\OneDrive\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.5\cores\esp32\esp32-hal-uart.c line 194
0x400d1179: SoftwareSerial::begin(unsigned int, SoftwareSerialConfig, signed char, signed char, bool, int, int) at C:\DOSSIER MICHEL\APICULTURE\RUCHES CONNECTEES\DEVELOPPEMENT\ARDUINO\libraries\EspSoftwareSerial\src\SoftwareSerial.cpp line 100
0x400d13b2: circular_queue ::for_each(Delegate const&) at c:\users\miche\onedrive\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits/atomic_base.h line 396
0x400d14b5: SoftwareSerial::rxBits(unsigned int const&) at C:\DOSSIER MICHEL\APICULTURE\RUCHES CONNECTEES\DEVELOPPEMENT\ARDUINO\libraries\EspSoftwareSerial\src\SoftwareSerial.cpp line 481
0x400d2c69: uartBegin at C:\Users\miche\OneDrive\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.5\cores\esp32\esp32-hal-uart.c line 227
0x4008692d: vPortCPUAcquireMutex at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/portmux_impl.inc.h line 107."

My next step is to test another version of ESP ttgo board : SIM800L IP5306 20200811 on witch the power controler seems to be more effective.

Best regards

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: Debugging LoadProhibited from Windows 10

Postby Vader_Mester » Wed Apr 14, 2021 7:18 am

william.ferguson.au wrote:
Fri Feb 26, 2021 4:07 am
I'm getting a LoadProhibited out of a library that I have been happily using for several years.

Can anyone point me at some clear and simple instructions for how to debug the ESP32 from a Windows environment?
Hi,

LoadProhibited is thrown when an address is out of valid address space.

EXCVADDR shows the address that throws this exception.

In your dump EXCVADDR is 0x0000001f. This is of couse invalid. Normal address range is between 0x3fxxxxxx - 0x6xxxxxxx.
LoadProhibited happens when there is a NULL pointer (0x00000000) somewhere which is not handled in code (NULL pointer must be always checked and not used.

0x0000001F is a value which comes when you incrementing this said NULL pointer, say, when you are traversing a string or buffer in a loop. It can also happen when you want to access a structure (in this case can be a JSON structure maybe), which you did not properly initialized, or the pointer to the structure itself is NULL, but you want to access something in the structure which produces this address, which is relative to this null pointer by 0x1F.

It must be a kind of bug in the ArduinoJson library, or your implementation of using the library where you have missed checking if a structure is properly initialized, not related to power problems.

Some idea of how check a NULL pointer.

Code: Select all

something_t *foo = functionThatReturnsPointerOfsomething_t();
if(!foo) { //true if foo is NULL
      Serial.println("Foo is NULL, exiting");
      //Code comes here if foo is NULL
   } else {
      //code comes here to handle if foo is OK
   }
You can also use

Code: Select all

if(foo == NULL) { //true if foo is NULL
or

Code: Select all

if(foo != NULL) { //true if foo is NOT NULL
and then put the code for handling NULL into an } else { in the end. It depends on how do you want to read your code. It's your preference, but it must not be ommited, otherwise you'll have issues.

Here you can find this in the official docs, as well as the valid address range which should not fail.
https://docs.espressif.com/projects/esp ... prohibited

Regards,
Ben (Vader)

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

Who is online

Users browsing this forum: No registered users and 90 guests