cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L8CX with stm32f407vgt6

Rituraj
Senior

I am trying to use VL53l8cx with STM32F407VGT6 to find depth . I have previously worked with VL53l5cx and VL53l1cx  and was comfortab;e with both of these .  I am unable to use this sensor at all as everytime a hard fault arises .

 

I have been able to use it on Arduino but wasnt able to use it with any st controller or dev board.  

The link to the projects is below:

 

https://drive.google.com/drive/folders/1tsidyGcB8i_SaHW2IKRrtKeJuAWvVb6X?usp=drive_link

 

https://drive.google.com/drive/folders/17VWmdfnXCuZRXwIgr5QM44ov2SjAzd09?usp=drive_link

 

This is where the hardfault occurs :

Rituraj_0-1728285114831.png

 

2 REPLIES 2
John E KVAM
ST Employee

I just posed this on a similar query:

The VL53L8CX actually has an MCU in it, and that 80K of code you write to it to start the sensor is the Firmware running in that sensor. 

As such a 'register map' would more reasonably be called an interface protocol. But we do communicate over the i2C using addresses - and for all the world it's a register map. But a pretty complex one. 

There are a couple of ways you can hook up that stm32f4 discovery. If you are using the VL53L8-satel, you might be having a known issue with the SPI (Our supply stuffed the wrong level shifter.) 

Solved: VL53L8CX SPI doesn't work properly - STMicroelectronics Community

Check your board for the wrong part.

It was also noted that if you run the SPI too slowly it has an issue. 3Mbits seems to work just fine. 

But you should be able to get the sensor running with the I2C. 

The startup code downloads some 80K and we have to change pages to get it all downloaded. That's register 0x7fff.

When running all the communication is done on the same page.

If using a non-ST MCU sometimes the I2C cannot make those large I2C transfers, and one has to break them into smaller chunks. (This is not your issue, but it happens to others. )

Don't give up on the APi so quickly please. Running this beast with a register map can be done, but it took us years. And you would end up hating ST. The API is validated and well tested. It has lots of advantages. 

 

See if any of that solves your issue. 

As you are not getting the firmware to download, it limits the issue to either an SPI part issue, the SPI speed issue or a mis-configured I2C. 


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.

@Rituraj wrote:

I am unable to use this sensor at all as every time a hard fault arises .


On debugging Hard Faults:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/708193/highlight/true#M51