2024-02-28 09:18 AM
I'm having a bit of trouble talking to the VL53L5Cx...
I'm appearing to download firmware ok, by all accolunts vl53l5cx_init() is returning with VL53L5CX_STATUS_OK and vl53l5cx_start_ranging() likewise.
However, the response on the I2C bus to vl53l5cx_check_data_ready() is 0xFF, 0x05, 0xC5, 0x81 - thus the check fails and is_Ready returns 0.
Any help what those bytes being returned mean, and therefore clues as to what I've done wrong?
The device consumption is in the order 28mA, and I cannot see any light with an IR camera...
Thanks
Kevin
Solved! Go to Solution.
2024-02-28 09:35 AM
Ah ha - found the answer to my problem here: https://community.st.com/t5/imaging-sensors/vl53l5cx-driver-vl53l5cx-init-fails/td-p/156622/page/2 (length of reads... u8 and u32)
Make sure your implementation (as you call from platform.c) of I2C read and write can handle the u32s where appropriate! RdMulti() for example passes a u32 for size.
In my case I've just made them as follows now:
bool I2C_Read ( I2C_PORT i2c, u8 addr, u8 data[], u32 count )
bool I2C_Write16 ( I2C_PORT i2c, u8 addr, u16 reg, u8 data[], u32 count )
bool I2C_WriteRead ( I2C_PORT i2c, u8 addr, u8 wData[], u32 wCount, u8 rData[], u32 rCount )
Happy day!
2024-02-28 09:35 AM
Ah ha - found the answer to my problem here: https://community.st.com/t5/imaging-sensors/vl53l5cx-driver-vl53l5cx-init-fails/td-p/156622/page/2 (length of reads... u8 and u32)
Make sure your implementation (as you call from platform.c) of I2C read and write can handle the u32s where appropriate! RdMulti() for example passes a u32 for size.
In my case I've just made them as follows now:
bool I2C_Read ( I2C_PORT i2c, u8 addr, u8 data[], u32 count )
bool I2C_Write16 ( I2C_PORT i2c, u8 addr, u16 reg, u8 data[], u32 count )
bool I2C_WriteRead ( I2C_PORT i2c, u8 addr, u8 wData[], u32 wCount, u8 rData[], u32 rCount )
Happy day!