Showing results for 
Search instead for 
Did you mean: 

want to interface vl53l5cx sensor with nordic board

Associate II

i want to interface vl53l5cx sensor with nordic Nrf52840 board but in stm project there are too many register read and write so just i want few register for get the distance from tof sensor so which minimum registers i have to configure ? and initialize of  sensor rd multi function used so it is not working properly  provide me support

Andrew Neil
Evangelist III

@Bhavik_Patel wrote:

in stm project there are too many register read and write so just i want few register 

That doesn't really make sense - if you can read one register, you can read any number of registers!

Once you've got the basic register read & write working, the number of reads & writes shouldn't be an issue!

ST Employee

The register map is our most asked question. And we don't hand it out. There are nearly 1000 registers and although I'm sure you could write the driver, you would hate us forever. 

The first thing the Initialization does is download an 80K bunch of firmware. That should give you some idea of the complexity. 

I know it's big, and I'm sorry about that. Some of the smaller MCUs just are not big enough. 

But it's a powerful sensor, and you get a ton of data from it.

We worked pretty hard to make the integration into your MCU as simple as possible. Actually, it was written for the Cellphone market and has a few abstraction layers that Linux programmers seem to love. It could be smaller, but not by much. 

Try taking the software package as it is. You will need to re-write the Platform.c file to interface to your MCUs I2C bus. As delivered, that file doesn't do anything. But other than calling the functions that initialize and start ranging, you don't have to do much, and we have lots of examples to help.

I'm sure you could write a smaller driver, but wouldn't you rather concentrate on what to do with the data?

Good luck, 

- john

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question. It helps the next guy.
vl53l5cx_check_data_ready in this function there is one p_dev->temp_buffer in this i got all the 4 byte value 0 so where is the problem ? please help me to find out this problem resolution
VL53L5CX_Configuration *p_dev,
uint8_t *p_isReady)
uint8_t status = VL53L5CX_STATUS_OK;
status |= RdMulti(&(p_dev->platform), 0x0, p_dev->temp_buffer, 4);
if((p_dev->temp_buffer[0] != p_dev->streamcount)
&& (p_dev->temp_buffer[0] != (uint8_t)255)
&& (p_dev->temp_buffer[1] == (uint8_t)0x5)
&& ((p_dev->temp_buffer[2] & (uint8_t)0x5) == (uint8_t)0x5)
&& ((p_dev->temp_buffer[3] & (uint8_t)0x10) ==(uint8_t)0x10)
*p_isReady = (uint8_t)1;
p_dev->streamcount = p_dev->temp_buffer[0];

here i attached the source file where all .c file is available so please check it and if any changes required in this .c files then suggest me