Skip to main content
LShan.11
Visitor II
February 26, 2022
Solved

I am trying to make use of the VL53L0X API on stm32cubeide but I've encountered some issues coming from the file vl53l0x_i2c_win_serial_comms.c. Apparently INFINITE, WAIT_OBJECT_0 aren't declared and HANDLE is an unknown type name.

  • February 26, 2022
  • 1 reply
  • 1501 views

I thought HANDLE was part of the stm32 hal library so I tried including stm32h7xx_hal.h however it did not resolve the issue

This topic has been closed for replies.
Best answer by John E KVAM

I hate the way that code was delivered. The platform layer (VL53L0_platform.c) was written to communicate to a Windows PC. And nobody does that. Well, apparently one guy did. But nobody else.

Our instructions tell you to gut the VL53L0_platform.c file and rewrite it for your MCU.

But that's silly - you are using an STM32.

So here is what I think you should do.

Create a different project using a VL53L3CX. This L3 sensor is supported by the X-cube so it will be included.

When you create the code for this project there will be a VL53L3_platform.c

Then compare this VL53L3_platform.c to the VL53L0_platform.c function names.

It will give you a good head start. You might have to fix a few things, but the basic communication is there and it should be easy. (I know - famous last words.)

You can also try finding a VL53L0_platform.c on GitHub.

Good luck,

  • john

1 reply

John E KVAM
John E KVAMBest answer
ST Employee
March 3, 2022

I hate the way that code was delivered. The platform layer (VL53L0_platform.c) was written to communicate to a Windows PC. And nobody does that. Well, apparently one guy did. But nobody else.

Our instructions tell you to gut the VL53L0_platform.c file and rewrite it for your MCU.

But that's silly - you are using an STM32.

So here is what I think you should do.

Create a different project using a VL53L3CX. This L3 sensor is supported by the X-cube so it will be included.

When you create the code for this project there will be a VL53L3_platform.c

Then compare this VL53L3_platform.c to the VL53L0_platform.c function names.

It will give you a good head start. You might have to fix a few things, but the basic communication is there and it should be easy. (I know - famous last words.)

You can also try finding a VL53L0_platform.c on GitHub.

Good luck,

  • john