Skip to main content
Sid Price
Associate III
November 25, 2021
Solved

Vl53L3CX and X-CUBE-TOF1 v2.0.0 issue

  • November 25, 2021
  • 7 replies
  • 2782 views

I have a simple ranging project generated by CubeMX using X-Cube-TOF1 v2.0.0. The host is Nucleo-L452.

Initialization of the VL53L2CX appears to work without errors, however when the "VL53LX_run_device_test" function runs it fails after the timeout, returning -7 (timeout).

Please could you help to debug/resolve this issue.

This topic has been closed for replies.
Best answer by Sid Price

I think I have found and resolved the issue.

The SATEL board was being powered from the Nucleo 5V rail. The Nucleo has 3.3V I/O. When I switched the SATEL board to use the 3.3V rail the sample application appears to work.

Sid

7 replies

Julien NGUYEN
ST Employee
November 26, 2021

Hi Sid Price,

Have you tested with the pre-compiled project found in C:\Users\user_name\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-TOF1\2.0.0\Projects\NUCLEO-F401RE\Examples\53L3A2\53L3A2_SimpleRanging\Binary or it is a project created by you using CUBE-MX ?

Please note that the pre-compiled project has been built for the NUCLEO-F401RE only and can not be run on the NUCLEO-L452RE.

I don't have the NUCLEO-L452RE board with me to test for you, but if you have a NUCLEO-F401RE in your hand please try both the pre-compiled project and a new simple ranging created by your self using CUBE-MX, then I will able to assist you. Thanks, Julien

Sid Price
Sid PriceAuthor
Associate III
November 26, 2021

Hi Julien,

The project is generated by CubeMX for Nucleo-L452.

I do have a Nucleo-F401RE and I can try the binary and also generating a CubeMX project for it later today and report back.

Note that I am using the the VL53L3CX-SATEL breakout board for my project.

Regards,

Sid

Sid Price
Sid PriceAuthor
Associate III
November 26, 2021

Julien, the project binary is for 53L3A2, I am using 53L3CX, it is compatible?

Sid

Julien NGUYEN
ST Employee
November 26, 2021

Hi Sid, if you are using the blue color VL53L3CX-SATEL PCB delivered with the X-NUCLEO-53L3A2 you need to add to pull up resistors ( 2.2k to 4.7 k ohms) on the SDA and SCL lines. If you use the green color VL53L3CX-SATEL PCB sold separately you don't need to add the pull up resistors. Julien

Sid Price
Sid PriceAuthor
Associate III
November 27, 2021

Hi Julien, I have the separate SATEL PCBs (green).

I2C appears to be working correctly the ID of the 53L3CX is read and there are many I2C interactions before the project attempts to run the test code.

Sid

Sid Price
Sid PriceAuthor
Associate III
November 30, 2021

@Julien NGUYEN​ I am still stuck on this issue, both Nucleo-L452RC and Nucleo-F401RE show the symptom. As I said, it does not appear to be an I2C issue because the device is identified through I2C and other commands as part of the setup work.

Sid

Julien NGUYEN
ST Employee
November 30, 2021

Hi Sid, Could you please send me a picture of the connection you did between the VL53L3CX-SATEL and the Nucleo-F401RE ?

Have you connected the XSHUT pin to the PA1 and the GPIO1 pin to the PA4 as shown below ? Julien

0693W00000GZWwfQAH.png

Sid Price
Sid PriceAuthor
Associate III
December 4, 2021

@Julien NGUYEN​ Excuse my delayed response, the forum does not send me a notification when a new post is made. Is there a setting for that?

My hookup looks the same as yours.

0693W00000HnYBJQA3.png

Sid Price
Sid PriceAuthor
Associate III
December 4, 2021

@Julien NGUYEN​ More information for you is that if I define VL53LX_LOG_ENABLE the firmware works. There is a flood of data from the sensor sent to the serial port and if I capture that I see that the ranging is working.

This suggests there is some kind of timing error in the code. Changing the I2C speed to "normal" does not change the symptoms.

Are you able to reproduce the problem?

Sid Price
Sid PriceAuthorBest answer
Associate III
December 11, 2021

I think I have found and resolved the issue.

The SATEL board was being powered from the Nucleo 5V rail. The Nucleo has 3.3V I/O. When I switched the SATEL board to use the 3.3V rail the sample application appears to work.

Sid