Why is the UID changing when accessed to? Also, what are the best ways to debug an I/O error?
- November 10, 2020
- 3 replies
- 2459 views
Hey guys and gals,
I have:
- Bought the P-NUCLEO-53L3A2 Eval kit which includes: X-NUCLEO-53L3A2 expansion board and NUCLEO-F401RE;
- Downloaded the sample code for single ToF acquisition;
- Started to modify code for ToF multi acquisition.
Issues I have encountered:
- When adding the LEFT and RIGHT ToFs ensure you solder them otherwise the XSHUT pin voltage might not work as intended and you might get an I/O error;
- The code API documentation has some details not mentioned in the UM2778.pdf e.g. VL53LX_SetDistanceMode should be called after VL53LX_DataInit();
- After setting the distance mode it does not change said distance mode;
- device UID seems to change.
What I would need help or tips:
- Why is the UID changing?
- How do I properly set the distance mode?
- When should I run the calibration functions?
The code used is attached. Oh, and I used the STM32Cube IDE just fyi.
Output log>
VL53L1X Examples...
Setting XSHUT pin ON...
Waiting device to boot...
Reading device UID: 7555855411574540485
Setting Device Address to 0x52
Setting XSHUT pin OFF...
Setting XSHUT pin ON...
Waiting device to boot...
Reading device UID: 34401660361561757125
Setting Device Address to 0x53
Setting XSHUT pin OFF...
Setting XSHUT pin ON...
Waiting device to boot...
Reading device UID: 30870942771574540485
Setting Device Address to 0x54
Setting XSHUT pin OFF...
Setting XSHUT pin ON for ALL DEVICES...
XSHUT set for device UID: 536871480536871512
XSHUT set for device UID: 00
XSHUT set for device UID: 536871480536871512
Ranging loop starts
1342341161561363653 DISTANCE MODE: 1
1342341161561363653 DISTANCE MODE: 1
VL53LX_WaitDeviceBooted failed: error = -13
Thanks in advance,
Francisco