2023-08-04 09:10 PM
I have a P-NUCLEO-53L8A1 development kit, which consists of an X-NUCLEO-53L8A1 connected to NUCLEO-F401RE. When I am using the GUI program STSW-IMG041, it can correctly get data. However, I am using the X-CUBE-TOF1 kit from this website link: https://www.st.com/en/ecosystems/x-cube-tof1.html. I compiled the example '53L8A1_SimpleRanging' located in 'en.X-CUBE-TOF1\Projects\NUCLEO-F401RE\Examples\53L8A1', but I encountered an error while running it: 'VL53L8A1_RANGING_SENSOR_Init failed. Check you're using ONLY the center device soldered on the shield, NO satellite shall be connected!' I debugged my code and found that it fails when trying to read the ID:
if (VL53L8CX_ReadID(&(VL53L8CXObj[Instance]), &id) != VL53L8CX_OK)
{
ret = BSP_ERROR_COMPONENT_FAILURE;
}
Since using the GUI program gives me data successfully, I believe the module itself should be fine. However, I can't initialize it using the code.
I look forward to receiving help from all the experts. Thank you very much.
Solved! Go to Solution.
2023-12-20 07:30 AM
i had this issue. I tracked it to a mis-configured I2C. When I added the TOF software to the STM32_CubeMX, I realized the software knew nothing about the hardware configuration. Granted the CubeMX won't let you generate code if you have not assigned the pins, but there is no safeguard if you have them wrong. I ended up with the Nucleo board schematics and the schematic for the X-Nucleo53L8A1, and just tracing out the lines. (As a software guy - it was an enlighening experience.)
But based on my sample set of one, I'd double check the pin assignments.
If the EVAL GUI software works, you know your board works. So I'd not go there.
- john
2023-08-07 12:45 AM
Hello
Can you please confirm that there is no SATEL connected to the X-Nucleo ?
Moreover, can you please confirm that the jumpers are set as stated in the documentation ?
Regards
2023-08-09 01:24 AM
Hello,
I can confirm that the connections and jumpers are correct, because this connection method can correctly collect data using GUI programs
2023-08-09 04:53 AM
Hello
Did you try to load the .bin file delivered at the same place by just doing a drag and drop from the directory to the board ?
We tried on our side and this bin file is workin. For that no SATEL has been connected to the X-Nucleo.
Regards
2023-08-09 09:05 PM
I just copied the 53L8A1_SimpleRanging.bin file in the en.X-CUBE-TOF1\Projects\NUCLEO-F401RE\Examples\53L8A1\53L8A1_SimpleRanging\Binary folder to the directory on the board, but it still can't work.
I modified the Sample Code. If the NCS pin of VL53L8(PB6 in STM32F401) is set to high level, then the communication can be normal. In the sample, this pin is set to low level.
I read the VL53L8 datasheet and his description of this pin is:
I²C: I²C interface reset pin, active high. Toggle this pin from 0 to 1, then back to 0 to reset the I²C slave. 47 kΩ pulldown resistor required to GND.
SPI: Active low chip select. 47 kΩ pullup resistor required to IOVDD.
As shown in the datasheet, this pin takes effect at a high level. According to my understanding, it is in the recovery of I2C communication when it is at a high level, and communication should not be possible at this time. But in fact, when this pin is high, it can communicate. The sample code is consistent with the VL53L8 datasheet, but it is inconsistent with the actual phenomenon? Is there an error in the datasheet? Or is there something wrong with my board, since I don't have the circuit diagrams of these boards, I can't troubleshoot whether there is a problem with the board.
Can you tell me what the level status of this pin should be when it is in use? I will buy a few more modules of this kind to use in the future. I need to know how to use this module in order to program code.
Thanks.
2023-09-08 12:01 AM
Hello
Sorry for the delay in the answer.
You can find the schematic of the boards here on the X-NUCLEO-VL5"L8A1 page.
Can you check the jumper too ?
Regards
2023-12-19 03:00 PM
Hi, I am working on the same board and same application and I am getting the same error. I am very new to this and not very proficient. I was wondering if you could share the the pinout config so simple ranging on the X-NUCLEO-VL5L8A1 ?
Any help from your side is greatly appreciated.
best,
Upasana
2023-12-20 02:38 AM
Hello Upasana,
What is the HW config you are using ? Is it boards available on st.com ?
Are you using SATEL too ?
Regards
2023-12-20 07:30 AM
i had this issue. I tracked it to a mis-configured I2C. When I added the TOF software to the STM32_CubeMX, I realized the software knew nothing about the hardware configuration. Granted the CubeMX won't let you generate code if you have not assigned the pins, but there is no safeguard if you have them wrong. I ended up with the Nucleo board schematics and the schematic for the X-Nucleo53L8A1, and just tracing out the lines. (As a software guy - it was an enlighening experience.)
But based on my sample set of one, I'd double check the pin assignments.
If the EVAL GUI software works, you know your board works. So I'd not go there.
- john
2024-06-24 06:40 AM
I can confirm that it is a pin assignment issue - at least in my case.
It wasn't the I2C but, instead, some of the control pins.
I'm using a 57L8A1 board plugged into a NUCLEO- F401RE board.
I followed the directions in UM3108 to generate the code for the SimpleRanging example and got the same error
VL53L8A1_RANGING_SENSOR_Init failed
Check you're using ONLY the center device soldered on the shield, NO satellite shall be connected !
I realized that the directions in UM3108 apply to the 57L7A1 which has different pin assignments than the 57L8A1. After comparing the schematics, I figured out what needed to be changed to make the code work with the 53L8. I've highlighted the ones that differ in red:
Function | GPIO for 53L7 | GPIO for 53L8 |
I2C1_SCL | PB8 | PB8 |
I2C1_SDA | PB9 | PB9 |
LPn | PB4 | PB0 |
TOF_INT | PA4 | PA4 |
PWR_EN | PB0 | PA7 |
I2C_RESET | PB3 | not needed |
I used the above info to modify what I did on UM3108 pages 16+.
In the end, the GPIO assignments looked like this:
corresponding to page 20 fig 28 of UM3108:
and page 23 fig 34:
Once I made these changes and re-compiled, the SimpleRanging app worked fine.
Brian