Skip to main content
Associate
December 16, 2024
Solved

VL53L0X library installation error

  • December 16, 2024
  • 1 reply
  • 1721 views

I have added all the drivers for the VL53L0X API, but I still encounter this error. Why is that?image.png

Best answer by John E KVAM

When interfacing the sensor with your MCU, it is up to you to write the 'platform' layer. This layer actually executes the I2C_read and I2C_write commands.

As delivered, the platform layer is configured to interface to a PC using its internal bus. (It's how ST developed the code.)

No one wants that. 

So, edit the platform.c file - remove all the guts of those functions (references to Windows) . You should be left with a half dozen functions that look like 

VL53L0X_Error VL53L0X_WriteMulti(...) 

Re-write those functions for your MCU. 

Perhaps you don't have to the work. Look in GetHub.com for someone who has already written I2C functions for your MCU. 

- john 

1 reply

Daijr11Author
Associate
December 16, 2024

Help me please!!!!!

John E KVAM
ST Employee
December 16, 2024

When interfacing the sensor with your MCU, it is up to you to write the 'platform' layer. This layer actually executes the I2C_read and I2C_write commands.

As delivered, the platform layer is configured to interface to a PC using its internal bus. (It's how ST developed the code.)

No one wants that. 

So, edit the platform.c file - remove all the guts of those functions (references to Windows) . You should be left with a half dozen functions that look like 

VL53L0X_Error VL53L0X_WriteMulti(...) 

Re-write those functions for your MCU. 

Perhaps you don't have to the work. Look in GetHub.com for someone who has already written I2C functions for your MCU. 

- 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.