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

I get this error message every time I try to utilize the sensor with Serial or Wifi communication.

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

I have tried for weeks to understand what is happening but I’ve had to accept I simply don’t understand. The most I can make out is it has something to do with a read or write address and a buffer.

The end goal is to be able to communicate to the microcontroller over wifi, imitate a reading on command , and receive the reading back.

Thanks

That error (LoadProhibited, StoreProhibited) happens when application attempts to read from or write to an invalid memory location. The address which was written/read is found in EXCVADDR register in the register dump. If this address is zero, it usually means that application attempted to dereference a NULL pointer. If this address is close to zero, it usually means that application attempted to access member of a structure, but the pointer to the structure was NULL. If this address is something else (garbage value, not in 0x3fxxxxxx - 0x6xxxxxxx range), it likely means that the pointer used to access the data was either not initialized or was corrupted. Use https://github.com/me-no-dev/EspExceptionDecoder to get the dump

This post about where certain variables are declared https://stackoverflow.com/questions/633 … ited-error and/or this one https://github.com/espressif/arduino-esp32/issues/3634 might help shed some light :smiley:

Thanks TS-Russell, I understand that and have read the resources. However, that is literally where my understanding stops, I have no understanding of how to resolve it.

The sensor sample code works just fine, the serial call response works fine, but in the same sketch it fails.

I’ll post a dump but I’ve followed the rabbit hole and I can’t see what needs to change

Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x4014bca0  PS      : 0x00060e30  A0      : 0x800d7f4d  A1      : 0x3ffb1ec0  
A2      : 0x00000000  A3      : 0x00000049  A4      : 0x3ffb8218  A5      : 0x00000000  
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x00000100  A9      : 0x00000001  
A10     : 0x00000000  A11     : 0x00000000  A12     : 0x00000000  A13     : 0x00000001  
A14     : 0x00060c20  A15     : 0x00000000  SAR     : 0x0000000a  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000126  LBEG    : 0x4008c67d  LEND    : 0x4008c68d  LCOUNT  : 0xffffffff  

ELF file SHA256: 0000000000000000

Backtrace: 0x4014bca0:0x3ffb1ec0 0x400d7f4a:0x3ffb1ee0 0x400d8035:0x3ffb1f00 0x400d8088:0x3ffb1f20 0x400d809b:0x3ffb1f40 0x400d80e9:0x3ffb1f60 0x400d0b05:0x3ffb1f80 0x400da7b1:0x3ffb1fb0 0x4008e1fe:0x3ffb1fd0

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4

The decoder points towards this section in the wire library

void TwoWire::beginTransmission(uint16_t address)
{
    transmitting = 1;
    txAddress = address;
    txIndex = txQueued; // allow multiple beginTransmission(),write(),endTransmission(false) until endTransmission(true)
    txLength = txQueued;
    last_error = I2C_ERROR_OK;
}

Maybe this will also be useful.

PC: 0x4014bce4: TwoWire::beginTransmission(int) at C:\Users\\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\Wire\src\Wire.cpp line 156
EXCVADDR: 0x00000126

Decoding stack results
0x4014bce4: TwoWire::beginTransmission(int) at C:\Users\\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\Wire\src\Wire.cpp line 156
0x400d7f8e: AS7265X::readRegister(unsigned char) at C:\Users\\Documents\Arduino\libraries\SparkFun_Spectral_Triad_AS7265X\src\SparkFun_AS7265X.cpp line 539
0x400d8079: AS7265X::virtualWriteRegister(unsigned char, unsigned char) at C:\Users\\Documents\Arduino\libraries\SparkFun_Spectral_Triad_AS7265X\src\SparkFun_AS7265X.cpp line 516
0x400d80cc: AS7265X::selectDevice(unsigned char) at C:\Users\\Documents\Arduino\libraries\SparkFun_Spectral_Triad_AS7265X\src\SparkFun_AS7265X.cpp line 400
0x400d80df: AS7265X::getCalibratedValue(unsigned char, unsigned char) at C:\Users\\Documents\Arduino\libraries\SparkFun_Spectral_Triad_AS7265X\src\SparkFun_AS7265X.cpp line 269
0x400d812d: AS7265X::getCalibratedA() at C:\Users\\Documents\Arduino\libraries\SparkFun_Spectral_Triad_AS7265X\src\SparkFun_AS7265X.cpp line 208
0x400d0b85: loop() at C:\Users\\AppData\Local\Temp\arduino_modified_sketch_674402/sketch_sep06a.ino line 56
0x400da7f5: loopTask(void*) at C:\Users\\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32\main.cpp line 23
0x4008e1fe: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143

OK, this is also above my head as well…but I’m going to through out a guess that the ESP32 compiler is mad at the TwoWire library? I found this https://github.com/espressif/arduino-esp32/issues/977 where someone had luck separating the calls