2024-08-09 02:09 AM - edited 2024-08-09 02:10 AM
Hi Everyone,
I am trying to interface TOF - VL53L8CX with Nucleo-G071RB using stm32 cube ide. I need support in setting up the code. I am referring to most of the datasheets and manuals but i am unable to get a correct code.
Ref-
1) https://www.pololu.com/product/3419
2) https://os.mbed.com/platforms/ST-Nucleo-G071RB/#nucleo-pinout
Thanks
Abhishek Mitra
2024-08-09 03:16 AM - edited 2024-08-09 04:17 AM
Hi,
have you checked the code examples provided along the VL53L8CX Ultra lite driver? They might be helpful for you.
2024-08-09 03:25 AM - edited 2024-08-09 03:27 AM
The operation of the VL53L8CX doesn't change according to what board it's mounted on.
See the VL53L8CX Product Page for details of its performance & behaviour, and other supporting materials - Application Notes, software, etc:
These are all linked from the Pololu page: https://www.pololu.com/product/3419/resources - they specifically suggest the Ultra Lite Driver API - as @lukaskn noted.
2024-08-12 08:42 AM
All of the folks above are correct. But I'd like to chime in as well.
there is a bit of software that might help - It' the STM32CubeMX. It's free, just download from ST.com.
This bit of code - works with the STM32CubeIDE, but its job is to help you establish all your overhead code.
It's got a graphical user interface, that helps you configure all your clocks and PIOs and imports all the ST code you need.
If you have a ST MCU board - like your Nucleo-G071RB - it knows all about those as well.
But if you are trying to put the MCU on your own board, it will help you configure all your PIOs and clocks and serial ports.
Once you have a valid configuration, you can hit the 'generate program' button and poof, you have all the set-up code you need.
Actually, it's not that easy, but if you can read a schematic, you can do it.
And the ToF/VL53L8CX is just one of the sensors the program knows about.
It can suck in the code for you.
2024-08-12 09:06 AM
@John E KVAM wrote:STM32CubeMX ... works with the STM32CubeIDE.
Recent versions of STM32CubeIDE have the STM32CubeMX functionality built-in - so no need for a separate download & install.
:beaming_face_with_smiling_eyes:
2024-08-13 04:51 AM
Hi Lukaskn,
Yaa, i am checking the ULD provided in (https://www.st.com/en/embedded-software/stsw-img040.html) and, i am referring the (Example_1_ranging_basic) code. As i am new the STM Cube IDE and its programming environment, i am unable to see any output in the console.
2024-08-13 05:13 AM
Hi Andrew Neil,
As i am referring to the support material, i am unable to build/generate the main.c code required for testing the TOF sensor connected with Nucleo-G071RB. Refer attached image. I am using following pin connection -
1. VIN of TOF -> 3.3V of Nucleo-G071RB
2. GND of TOF -> GND of Nucleo-G071RB
3. SDA, SCL of TOF -> SDA(D14)/SCL(D15) of Nucleo-G071RB
4. SPI_I2C_N of TOF -> GND of Nucleo-G071RB as (driving it low selects I²C mode)
2024-08-13 05:28 AM
Hi John,
Can you share any reference videos/documents? with the kind of wiring i have done will the process work?
2024-08-13 11:04 AM
Yes it will work. I've seen it work with ST's satellite boards.
But here's the trick.
1. I download STM32CubeMX separately from the STM32CubeIDE. I know Andrew Neal says they are integrated - but I've had better luck running them separately. It might be superstition on my part.
I produced a video on how to create a project. It does NOT use the VL53L8CX but nearly everything is the same.
I also have a couple of references to the STM32 Massive Open Online Courses.
Do some searching here - there is a lot of info.
https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-moocs.html
STM32 MOOCs (Massive Open Online Courses) - STMicroelectronics