cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 i2c master transmit always returns busy

YKuo.1
Associate II

Hi,

I'm using STM32F429 to talk to TI BQ40Z50 via I2C, and I ran into an issue I have no clue.

First of all, the code simply reads registers, and it works on TI BQ20Z95. The same code doesn't work on BQ40Z50. The HAL library always returns HAL_BUSY, and the error code is 32 (timeout). However, the logic analyzer doesn't have any waveforms. Both SCL and SDA are held high the entire time.

The most puzzling part is that if I disconnect the BQ40Z50, let the STM read registers (reads nothing obviously) several times, and connect the chip back. It works like a charm.

any suggestions I can try?

The I2C is running at 100KHz, with internal pull-up registers.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Bob S
Principal

Internal pull-ups are too weaker than I2C spec calls for. They may work, most of the time, depending on your hardware configuration. The system will be more reliable with external, lower value resistors.

What IS your hardware configuration? Is this a NUCLEO board wired to TI Eval Boards? Are you connecting GND between the boards? Are you powering the TI board from the NUCLEO?

Look at the I2C lines with a scope instead of a logic analyzer. See what voltage levels you are getting.

View solution in original post

2 REPLIES 2
Bob S
Principal

Internal pull-ups are too weaker than I2C spec calls for. They may work, most of the time, depending on your hardware configuration. The system will be more reliable with external, lower value resistors.

What IS your hardware configuration? Is this a NUCLEO board wired to TI Eval Boards? Are you connecting GND between the boards? Are you powering the TI board from the NUCLEO?

Look at the I2C lines with a scope instead of a logic analyzer. See what voltage levels you are getting.

YKuo.1
Associate II

Hi Bob,

Thanks for the insight. it was indeed the internal pull-up issue. it works great with external pull-ups.

Thanks!