I recently received a VL53L4CX and I am having issues getting it to work. I tried VL53L4CX _Sat_HelloWorld example but the output stalls after SerialPort.println("Starting..."); It looks like the device never responds with new data. I tried both the Huzzah32 Feather (3405) and the new ESP32 Feather V2 (5400) and both operate the same way. I tried using the VL53L4CD_Sat_HelloWorld example, which is for a different sensor but I saw a post about it, and that does work. Albeit the sensor does seem to perform strangely when the distance is beyond 1.8 or 1.9 meters.
From one of the other posts I read the the sensor was tested and the confirmed the code works, can you tell me what micro controller board you used?
Thanks. Mike
VL53L4CX
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: VL53L4CX
Are you connecting the sensor using the STEMMA QT connector and a STEMMA QT cable?
If not, please post photos of your setup showing how everything is connected.
If not, please post photos of your setup showing how everything is connected.
- mdede
- Posts: 31
- Joined: Sat Jan 19, 2019 9:04 pm
Re: VL53L4CX
Yes I am. I have not tried the pins of the sensor board yet.
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: VL53L4CX
Try power cycling everything and then run the sketch again. That way the VL53L4CX will be more in a known state when the sketch runs.
- mdede
- Posts: 31
- Joined: Sat Jan 19, 2019 9:04 pm
Re: VL53L4CX
I tried using Tera Term for a serial monitor, because I find sometimes the one in the Arduino IDE doesn't respond after a removal of the USB cable to the device I am programing, and when I pull out the USB cable and plug it back in the ESP32-S2 boots up and the code then stalls at "Starting..."
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 271414342, 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:0x3fff0030,len:1184
load:0x40078000,len:12812
load:0x40080400,len:3032
entry 0x400805e4
Starting...
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 271414342, 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:0x3fff0030,len:1184
load:0x40078000,len:12812
load:0x40080400,len:3032
entry 0x400805e4
Starting...
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: VL53L4CX
Problem recreated and new issue opened here:
https://github.com/stm32duino/VL53L4CX/issues/2
Can keep an eye on that to see what progress gets made on resolving.
If you need something working now, can either switch to another platform (SAMD M0 / M4 boards work). Or manually hack your local copy of the ESP32 BSP to up the buffer size. See issue thread for where that is defined in ESP32 BSP.
https://github.com/stm32duino/VL53L4CX/issues/2
Can keep an eye on that to see what progress gets made on resolving.
If you need something working now, can either switch to another platform (SAMD M0 / M4 boards work). Or manually hack your local copy of the ESP32 BSP to up the buffer size. See issue thread for where that is defined in ESP32 BSP.
- mdede
- Posts: 31
- Joined: Sat Jan 19, 2019 9:04 pm
Re: VL53L4CX
I was able to get the example to finally work with the STM32F405 Feather. I will try and look in to your hacking suggestion. Thanks
- mdede
- Posts: 31
- Joined: Sat Jan 19, 2019 9:04 pm
Re: VL53L4CX
I was able to get this example sketch to work on the ESP32 but, like you suggested, modifying the buffer size in the Wire.h file in the ESP32 core files to 256. Thanks for the suggestion. I would not have thought the buffer size would have caused this issue.
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: VL53L4CX
Cool. Glad that worked. STM actually responded to the issue I posted. Looks like they understand the issue and have actually fixed something similar in another driver. So good chance they'll get it resolved.
- mdede
- Posts: 31
- Joined: Sat Jan 19, 2019 9:04 pm
Re: VL53L4CX
Fantastic! Thanks so much for your assistance!!
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: VL53L4CX
Please update to the 1.0.1 release of the library:
https://github.com/stm32duino/VL53L4CX/ ... /tag/1.0.1
which *hopefully* fixes things.
https://github.com/stm32duino/VL53L4CX/ ... /tag/1.0.1
which *hopefully* fixes things.
- mdede
- Posts: 31
- Joined: Sat Jan 19, 2019 9:04 pm
Re: VL53L4CX
I downloaded the GitHub repository and tried it and it does work now. I will try the new release as well but I am sure it will work.
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: VL53L4CX
Yep. Should be the same thing. The release just lets it get pulled in via Arduino's Library Manager.
Please be positive and constructive with your questions and comments.