cancel
Showing results for 
Search instead for 
Did you mean: 

vl53l1

Tommi Kaivola
Associate
Posted on June 25, 2018 at 09:59

I am trying to make a driver for the vl531x proximity sensor. I am using the X-NUCLEO-53L1A1 Expansion Board with a Nordic pca10040 development board for NRF52832 processor.

The sensor is responding to I2C reads and writes, but not to the given address 0x52. Instead, 0x42 and 0x43 work, as well as 0x29, which makes the most sense as it is 0x52 shifted right by one bit.

I am using the vl53l1x_api provided by ST. I have implemented the necessary HAL interfaces, such as IIC and timer.

The sensor does give responses to the IIC writes and reads, but the answers are not what expeceted.

Examples:

vl53l_platform: VL53L1_RdByte, index: 0x10F

cfx_vl53lxx_drv: Model_ID: 0x1

vl53l_platform: VL53L1_RdByte, index: 0x110

cfx_vl53lxx_drv: Module_Type 0x1

The answer to both registers is 1, when they should be 0xea and 0xcc respectively.

The VL53L1_FIRMWARE__SYSTEM_STATUS register has the value 0x16, which is different from the expected 0x01, giving the impression that the device is not booted properly.

When trying to make a measurement, the measurement struct has value 0xff for both the range and status fields.

As the register contents are not documented, and the driver comprises hard coded hex values to which the return values are compared, i have no means of figuring out what is wrong, and if the fault is in my IIC driver implementation, HW configuration, or if the sensor is damaged in some way and i should try a new one.

What would be your suggestion on how to proceed?

#vl53l1x #proximity-sensors
3 REPLIES 3
Tommi Kaivola
Associate
Posted on June 25, 2018 at 17:54

Never mind, I changed my HW platform and all works now. I probably had some problem with the Nucleo board.

LInno
Associate

Hi Tommi,

I'm basically doing what you did, i.e. writing a driver to handle the VL53L1X with an nRF52832.

I can successfully read the registers you have mentioned but when I try to initialize with VL53L1_DataInit() i get an error with code -13. After some digging, I found out that this error comes from VL53L1_set_inter_measurement_period_ms() and I can't figure out why.

Have you faced the same problem? Any suggestion?

Thank you very much,

Gino

Did you find out what the problem was?