cancel
Showing results for 
Search instead for 
Did you mean: 

I2C issue on STM32F746G with VL53L1X breakout board.

FCost.11
Associate

Hello everyone,

I've a problem with the communication I2C. I've generated the I2C communication base code with STCubeMX for the STM32F746G discovery board.

And I got an error at I2C_WaitOnTXISFlagUntilTimeout(). Because NACK is detected.

I've also tested the sensor on a Nucleo L476 with the example program from the lite API of the sensor and it works.

Both programs are similar and I cannot find out why I have NACK.

I've test the I2C communication with an other sensor (MPU-6050 ) and it's works

Thank you for your Help

2 REPLIES 2
KnarfB
Principal III

Have you checked I2C signal integrity with a scope? Also, try to lower I2C frequency and check. What signal levels are you using?

John E KVAM
ST Employee

this might be better asked on the STM32 site. The sensor only responds if it's addressed. A NAK is generated if you get the address wrong. At least I think so. I only see the world from the sensor side.

One extremely common problem with the I2C is getting the address wrong. One takes the 7-bit address and shifts if left 1 bit. The LSB then become the write/read bit.

So address 0x29 becomes 0x52 or 0x53 depending on weither one is reading (0x53) or writing (0x52). The problem is some people spec the addess as 0x29 (Base address) and some use 0x52 as the write adddress. Could that be the issue?

if you get the address wrong, you end up with a NAK - or a timeout.


In order 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. It helps the next guy.