cancel
Showing results for 
Search instead for 
Did you mean: 

Conecting sensor VL53L5CX from proximity16click to a NUCLEO-H755ZI-Q I2C

frj12
Associate II

Hi,

I'm new in working to microcontrollers and I have an issue with connecting this sensor to my mcu. I'm using the library en.STSW-IMG023 with the example of the mcu STM32F401RETX. For any reason, when I connect it through I2C, the address doesn't work using the function "isalive". I don't know if I'll have to change something in .c files or in RCC to adapt this code to my STM32 board (I already changed stm32f4xx.h to stm32h7xx.h in the file platform.h). I know I have a long way to learn in this area, but any tip would help me to my project. 

Thanks you.

7 REPLIES 7
Foued_KH
ST Employee

Hello @frj12 , 

Make sure that you are using the correct address.
Connect an oscilloscope and check the SDA and SCL behavior.

Foued

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.

I managed to communicate the sensor and the microcontroller through another i2c connection (i2c4), I was trying to connect it through i2c1. 

My microcontroller has 2 cores, cm4 and cm7, and 3 domains. The RCC is in domain 3 and the i2c1 is in domain 2. I2C4 protocol is in domain 3, so i dont need any bus between domains 2 and 3 for the i2c connection to work. Anyway, I would like to try connecting the sensor and the microcontroller through the i2c1 connection, using the clock signal from domain 3. Could you help me with this problem? I'm not sure how to enable the bus so that they interact with each other. I am using the stm32cubeide software. 

Thanks for your response.

Fran.

Hello @frj12 , 

I think you need first to create a new project without STSW-IMG023 lib using HAL functions ( basic project )  .
Verify your sensor HW connection. 
If it works then you can use the STSW-IMG023 lib.
Which board do you use ?

Foued

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.

I created a project using HAL functions of i2c, and it doesn't work. If I use i2c4, which is in domain 3, I get the connection between the mcu and sensor. 

Fran

The board is NUCLEO-H755ZI-Q with two cores.

which error do you have if you use I2C1?

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.

I don't have any error, it simply can't communicate with the sensor address. However, if I use i2c4 it works with the same address. I reviewed the code and HW connection and it's OK. 

The problem might be in the domains, but I still don't know how to enable the bus between domain 2 and 3.

Thanks for your help.