Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples fail to run on ESP8266 #4

Closed
jarkman opened this issue Feb 10, 2022 · 5 comments
Closed

Examples fail to run on ESP8266 #4

jarkman opened this issue Feb 10, 2022 · 5 comments

Comments

@jarkman
Copy link

jarkman commented Feb 10, 2022

I've just been trying to bring up Example1_DistanceArray with a VL53L5CX (https://www.sparkfun.com/products/18642) on an ESP8266 (a Wemos D1 Mini Pro).

I get something similar to the other forum participants trying to run this on ESP8266 in the thread at https://forum.sparkfun.com/viewtopic.php?p=231366, an endless reset loop with

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

The ExceptionDecoder tool gives me the stack trace below. It suggests that readMultipleBytes is somehow running off the end of its buffer, but I can't see how that might happen.

Hope that helps, thanks!

Exception 3: LoadStoreError: Processor internal physical address or data error during load or store
PC: 0x40201524: SparkFun_VL53L5CX_IO::readMultipleBytes(unsigned short, unsigned char*, unsigned short) at /home/richard/Arduino/libraries/SparkFun_VL53L5CX_Arduino_Library/src/SparkFun_VL53L5CX_IO.cpp line 82
EXCVADDR: 0x4023b439

Decoding stack results
0x40201511: SparkFun_VL53L5CX_IO::readMultipleBytes(unsigned short, unsigned char*, unsigned short) at /home/richard/Arduino/libraries/SparkFun_VL53L5CX_Arduino_Library/src/SparkFun_VL53L5CX_IO.cpp line 82
0x40201460: SparkFun_VL53L5CX_IO::begin(unsigned char, TwoWire&) at /home/richard/Arduino/libraries/SparkFun_VL53L5CX_Arduino_Library/src/SparkFun_VL53L5CX_IO.cpp line 27
0x40201a26: _vl53l5cx_send_xtalk_data(VL53L5CX_Configuration*, uint8_t) at /home/richard/Arduino/libraries/SparkFun_VL53L5CX_Arduino_Library/src/vl53l5cx_api.cpp line 165
0x40202973: vl53l5cx_init(VL53L5CX_Configuration*) at /home/richard/Arduino/libraries/SparkFun_VL53L5CX_Arduino_Library/src/vl53l5cx_api.cpp line 318
0x40201438: SparkFun_VL53L5CX_IO::isConnected() at /home/richard/Arduino/libraries/SparkFun_VL53L5CX_Arduino_Library/src/SparkFun_VL53L5CX_IO.cpp line 34
0x40201460: SparkFun_VL53L5CX_IO::begin(unsigned char, TwoWire&) at /home/richard/Arduino/libraries/SparkFun_VL53L5CX_Arduino_Library/src/SparkFun_VL53L5CX_IO.cpp line 27
0x40202d54: Print::write(char const*) at /home/richard/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/Print.h line 59
0x40201786: SparkFun_VL53L5CX::startRanging() at /home/richard/Arduino/libraries/SparkFun_VL53L5CX_Arduino_Library/src/SparkFun_VL53L5CX_Library.cpp line 220
0x40202fc8: Stream::readString() at /home/richard/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/Stream.cpp line 248
0x402042c9: __pinMode(uint8_t, uint8_t) at /home/richard/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/core_esp8266_wiring_digital.cpp line 39
0x402010ab: setup() at /tmp/arduino_modified_sketch_534223/Example1_DistanceArray.ino line 41
0x40203634: user_rf_pre_init() at /home/richard/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/core_esp8266_phy.cpp line 353
0x40100db1: realloc(void*, size_t) at /home/richard/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/umm_malloc/umm_malloc.cpp line 1113

@PPVJM
Copy link
Contributor

PPVJM commented Feb 10, 2022

I will investigate and get back to you as soon as I have any update on this.

@jarkman
Copy link
Author

jarkman commented Feb 10, 2022 via email

@PPVJM PPVJM transferred this issue from sparkfun/SparkFun_Qwiic_ToF_Imager_VL53L5CX Feb 10, 2022
@PPVJM
Copy link
Contributor

PPVJM commented Feb 14, 2022

I was able to reproduce the issue and found the cause of the problem. Will work on a fix on the next days.

@jarkman
Copy link
Author

jarkman commented Feb 14, 2022

Thanks! There's also some helpful-looking comment in the forum, I haven't tried the suggested workaround yet:
https://forum.sparkfun.com/viewtopic.php?f=68&t=57066&sid=ff28e9a5a183a7748b1d82aefe5363cf

@nseidle
Copy link
Member

nseidle commented Mar 3, 2022

This was resolved [via forums](https://forum.sparkfun.com/viewtopic.php?f=68&t=57066&sid=ff28e9a5a183a7748b1d82aefe5363cf:

"It's now working if you set Arduino IDE -> Tools -> "Byte/Word access to IRAM/PROGME (very slow)"
In addition, disable the software watchdog with ESP.wdtDisable() before if (myImager.begin() == false) and then re-enable it with ESP.wdtEnable(3000)"

@nseidle nseidle closed this as completed Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants