cancel
Showing results for 
Search instead for 
Did you mean: 

Where to locate missing windows.h files for VL53L0X API?

MGryb.1
Associate

Where to locate missing header files for VL53L0X API?

Hi all

I am currently trying to integrate the VL53L0X sensor to a STM32L053 discovery board using CubeMX and Cube IDE, but I haven't had the best of luck...

I am inexperienced regarding the integration of sensors and I2C.

I have downloaded the API and API user manual. I have read the datasheet for the VL53L0X which only seems to provide me with two addresses for reading and writing (0x52 and 0x53). The datasheet seem to rely on the API library provided by ST, making it hard (or impossible for a newbie such as myself) to integrate otherwise.

Now my issue is: after downloading the API and including all c-files and header-files provided under the API folder (core and platform) I am unable to build the project and get an error message that the windows.h, Windows.h and SERIAL_COMMS.h files do not exist.

I do not understand why windows.h is needed, but it seems to complicate issues when I try to remove the #include. The SERIAL_COMMS.h sounds important and also (as expected) gives complications when removed.

Does anyone know how to resolve this issue? Is there anyone who also struggle with this issue?

3 REPLIES 3
John E KVAM
ST Employee

The code shipped with the VL53L0X make a big mistake. It contains code for interfacing to you PC - which is NOT what you want.

the file platform.c (which might be something like VL53L0X_platfom.c) needs to contain code for the MCU you have - not for the PC.

the easiest thing to do is go to CUBEMX and download code for the VL53L3CX.

It will contain the platform file written for the VL53 sensors.

Then go find the Platform.c and platform.h files in your VL53L0X project.

And I'm sorry for the hassle.

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

Dear sir,

i'm facing exactly same kind of problem.

your suggestion given here appears to solve my problem.

but as per your suggestion how to do the following part

"the easiest thing to do is go to CUBEMX and download code for the VL53L3CX."

i have VL53L0X.

i have already wasted nearly two weeks to solve this problem, but unable to do it.

waiting for your response

Jon HYSLOP
ST Employee

You can find a working platform.c at https://github.com/lamik/VL53L0X_API_STM32_HAL/blob/master/Drivers/VL53L0X/platform/src/vl53l0x_platform.c

I performed a Google search for STM32 VL53L0X GitHub where I found this example. Please give this a try.