Skip to main content
Associate
August 9, 2024
Question

Interfacing Pololu VL53L8CX with Nucleo-G071RB using STM32 cube ide

  • August 9, 2024
  • 2 replies
  • 2464 views

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

2 replies

Associate II
August 9, 2024

Hi,

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

Associate
August 13, 2024

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.

 

Andrew Neil
Super User
August 9, 2024

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.

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
John E KVAM
ST Employee
August 12, 2024

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. 

Andrew Neil
Super User
August 12, 2024

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

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.