I am trying to run the Example4_MaxOutput.ino example from the library “SparkFun_VL53L5CX_Arduino_Library” for the VL53L5CX board. I previously ran the Example1_DistanceArray.ino example and it worked fine, output as expected on the serial monitor. But when I run the max output example I get this repeating error on the serial monitor:
13:49:56.002 -> Rebooting...
13:49:56.049 -> ESP-ROM:esp32s3-20210327
13:49:56.049 -> Build:Mar 27 2021
13:49:56.049 -> rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
13:49:56.049 -> Saved PC:0x420253a6
13:49:56.049 -> SPIWP:0xee
13:49:56.049 -> mode:DIO, clock div:1
13:49:56.049 -> load:0x3fce3808,len:0x44c
13:49:56.049 -> load:0x403c9700,len:0xbe4
13:49:56.049 -> load:0x403cc700,len:0x2a68
13:49:56.049 -> entry 0x403c98d4
13:49:57.170 -> SparkFun VL53L5CX Imager Example
13:49:57.170 -> Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
13:49:57.217 ->
13:49:57.217 -> Core 1 register dump:
13:49:57.217 -> PC : 0x420249f5 PS : 0x00060630 A0 : 0x820018f8 A1 : 0x3fcebd20
13:49:57.217 -> A2 : 0x3fc96110 A3 : 0x00000080 A4 : 0x00000000 A5 : 0x00000000
13:49:57.217 -> A6 : 0x0000002b A7 : 0x0000e100 A8 : 0x00000000 A9 : 0x3fcebce0
13:49:57.217 -> A10 : 0x00000001 A11 : 0x00000000 A12 : 0x00000000 A13 : 0x00000000
13:49:57.263 -> A14 : 0x3fcec6bc A15 : 0x00000000 SAR : 0x00000017 EXCCAUSE: 0x0000001d
13:49:57.263 -> EXCVADDR: 0x00000005 LBEG : 0x400570e8 LEND : 0x400570f3 LCOUNT : 0xffffffff
13:49:57.263 ->
13:49:57.263 ->
13:49:57.263 -> Backtrace: 0x420249f2:0x3fcebd20 0x420018f5:0x3fcebd40 0x420040c2:0x3fcebd70
13:49:57.263 ->
13:49:57.263 ->
13:49:57.263 ->
13:49:57.263 ->
13:49:57.263 -> ELF file SHA256: 52f61c8fec9343d4
Could you help me get this working? I am using a new ESP32S3 dev board with 16MB flash and 8MB PSRAM. This continues if I reset or power cycle the board or restart the serial monitor.
Here is the stack trace from the ESP8266:
0x402014b5: SparkFun_VL53L5CX_IO::writeMultipleBytes(unsigned short, unsigned char*, unsigned short) at C:\Users\perigalacticon\OneDrive\Documents\Arduino\libraries\SparkFun_VL53L5CX_Arduino_Library\src\SparkFun_VL53L5CX_IO.cpp:63
0x40201404: TwoWire::endTransmission() at C:\Users\perigalacticon\AppData\Local\arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\Wire\Wire.cpp:180
0x40201938: WrMulti(VL53L5CX_Platform*, unsigned short, unsigned char*, unsigned int) at C:\Users\perigalacticon\OneDrive\Documents\Arduino\libraries\SparkFun_VL53L5CX_Arduino_Library\src\platform.cpp:82
0x40202883: vl53l5cx_init(VL53L5CX_Configuration*) at C:\Users\perigalacticon\OneDrive\Documents\Arduino\libraries\SparkFun_VL53L5CX_Arduino_Library\src\vl53l5cx_api.cpp:298
0x402013dc: TwoWire::endTransmission(unsigned char) at C:\Users\perigalacticon\AppData\Local\arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\Wire\Wire.cpp:171
0x402016b1: SparkFun_VL53L5CX::begin(unsigned char, TwoWire&) at C:\Users\perigalacticon\OneDrive\Documents\Arduino\libraries\SparkFun_VL53L5CX_Arduino_Library\src\SparkFun_VL53L5CX_Library.cpp:38
0x40201404: TwoWire::endTransmission() at C:\Users\perigalacticon\AppData\Local\arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\Wire\Wire.cpp:180
0x40202bdc: HardwareSerial::write(unsigned char const*, unsigned int) at C:\Users\perigalacticon\AppData\Local\arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\HardwareSerial.h:193
0x4020174d: SparkFun_VL53L5CX::begin(unsigned char, TwoWire&) at C:\Users\perigalacticon\OneDrive\Documents\Arduino\libraries\SparkFun_VL53L5CX_Arduino_Library\src\SparkFun_VL53L5CX_Library.cpp:68
0x40202e50: Print::println() at C:\Users\perigalacticon\AppData\Local\arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\Print.cpp:182
0x40204199: __delay at C:\Users\perigalacticon\AppData\Local\arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\core_esp8266_wiring.cpp:57
0x4020109b: setup at C:\Users\perigalacticon\OneDrive\Documents\Arduino\libraries\SparkFun_VL53L5CX_Arduino_Library\examples\Example1_DistanceArray\Example1_DistanceArray.ino:36
0x402034f4: loop_wrapper at C:\Users\perigalacticon\AppData\Local\arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\core_esp8266_main.cpp:198
Further info, on the ESP8266 the exception decoder points to line 38 which is :
myImager.setWireMaxPacketSize(128);
If I change this to 32 or comment it out I get more exceptions with a large variety of messages.
Commenting out line 38 made it work as expected for the ESP32S3. Setting it to 32 didn’t work. Thanks anyway!