cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing Pololu VL53L8CX with Nucleo-G071RB using STM32 cube ide

AbhishekMitra
Associate II

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

8 REPLIES 8
lukaskn
Associate II

Hi,

have you checked the code examples provided along the VL53L8CX Ultra lite driver? They might be helpful for you. 

Andrew Neil
Evangelist III

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.

 

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. 


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.

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

😁

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.

 

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)

 

 WhatsApp Image 2024-08-13 at 5.26.41 PM.jpegVL53L8CX_pinout.jpg

Hi John,

 

Can you share any reference videos/documents? with the kind of wiring i have done will the process work?

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

 https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-moocs/STM32G0_workshop_MOOC.html

 


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.