2023-03-07 05:38 PM
I understand that within the datasheet for the VL53L4CD, there is the ULD that is meant to be used instead of referencing the sensors registers directly with the STM32CubeIDE software.
I have download the ULD software for the VL53L4CD (STSW-IMG026) and I am unsure how to implement it within STMCubeIDE (where the files need to go).
I have also downloaded the X-CUBE-TOF1 software though STMCubeMX. Which allows me to select the NUCLEO-L031K6 board, VL53L4CD sensor and setup before generating the code. Is this the correct way of using the sensor and board?
2023-03-08 09:36 AM
Ok here is what you want to do.
STart with the absolutely latest version of the STM32CubeIDE.
You can start a project from scratch and call out our Nucleo-L031K6 board.
you can configure your project to include the X-CUBE-ToF.
It's not going to be completely simple however.
You need to configure the proper I2C, the shutdown PIO and the Interrupt pin.
But you can do it. Just don't get frustrated, and do a lot of google searches.
(and have a schematic of your boards. That helps.)
But I have a tip for you.
Go to ST.com and download the X-CUBE-ToF.
It has example code of completed projects running on the Nucleo-F401RE board.
it will show you what the configuration looks like and give you some good hints.
The X-CUBE-ToF code is not exactly the same as the IMG026, but they are very similar.
2023-03-08 07:48 PM
Thanks John,
I have downloaded the X-Cube-ToF1 software and configured it for my board, specifying the I2C, GPIO and Interrupt pin.
I see that the generated code includes a way of reading the sensor.
So to check that the code generated correctly, I built the program to check.
This resulted in this error.
Now I could be mistaken, but the example code does not contain this line. Commenting this line out does resolve the error, but I am unsure if it may cause other problems.
The code now successfully generates and I have uploaded it to my board.
Reading though the examples within the X-CUBE-ToF1 files, it seem to be very similar to what my code has generated, but I can not veiw anything from the USART output.
Working with this sensor is still new to me, so I am unsure in how I should be proceeding.
Thanks,
George
2023-03-09 09:18 AM
Very strange - I generated some code and it does not have that line.
Based on your request - and some others - I wrote a tutorial on STM32CubeIDE projects and ToF sensors.
Could you read over this PPT look for any differences.
Especially check out the baud rate of the terminal emulator.
2023-03-09 04:40 PM
Thanks John,
I believe I have found what causes that specific line of code to be generated.
I was changing the configurations to LL, as that is what I am required to code in for the moment.
Changing everything to HAL resolved the issue.
Is it possible to still achieve the same result with LL?
2023-03-10 08:20 AM
I have no idea. I'm an expert with the ToF board, but really kind of a rookie with the STM32 tools.
That ppt presentation was kind of my first attempt.
Might want to pose that question to the STM32 community.