cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with initialization of VL53L1X

AL_HM
Associate

Hi, I am looking for a ToF sensor using VL53L1X.
We are currently developing a ToF sensor using VL53L1X.
I have a question about the sample API VL53L1X_UltraLowPower you are using.
Whenever I execute VL53L1X_ULP_CheckForDataReady within VL53L1X_ULP_SensorInit(), it always TimeOut.
After examining the contents a little more, it seems that the problem is caused by the difference between the values of &temp and int_pol obtained by the VL53L1X_ULP_GPIO__TIO__HV_STATUS command. (This is the location in the picture).

In other words.
・What does it mean to do this setting
・What does the value of temp mean?
・What does &temp return?
I need answers to these three questions. The microcontroller in use is EFR32MG22

Also, if I use VL53L1X_ULP_GPIO_HV_MUX__CTRL, 0x11 is returned and int_pol is set to 1. Please let me know if this is even the correct behavior.

 

I would be glad to answer your questions!

Best Regards.

 

AL_HM_2-1738847675154.png

 

AL_HM_3-1738847737661.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

I'm going to guess this is due to an I2C error. Why? Because it's always an I2C error.

I'm going to add some code to an attachment. Call this code just after everything comes up. Before the init, but a good few milliseconds after the sensor comes up.

All it does in check the big endian vs little endian. And half the people get it wrong. 

But it's not obviously wrong. All the byte reads and writes work just fine.

So give this a shot.

- john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

View solution in original post

2 REPLIES 2
John E KVAM
ST Employee

I'm going to guess this is due to an I2C error. Why? Because it's always an I2C error.

I'm going to add some code to an attachment. Call this code just after everything comes up. Before the init, but a good few milliseconds after the sensor comes up.

All it does in check the big endian vs little endian. And half the people get it wrong. 

But it's not obviously wrong. All the byte reads and writes work just fine.

So give this a shot.

- john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
AL_HM
Associate

Hello. @John E KVAM 
Sorry it took me so long to reply.

Thanks to you the problem has been solved.
As you said, there was a mistake in the way the data was put into the i2c buffer.
Thank you for your kind reply.

I really appreciate it.

 

Best Regards.