cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Busy flag always set

Pedram
Associate III
Posted on September 06, 2017 at 16:16

Hello

i using STM32F103ZET6 & STM32CubeMX V4.22.0 & Firmware F1 V1.6

i want Send Data Via I2c But HAL_I2C_Master_Transmit Return HAL_BUSY 

i Remove My I2c device (AT24C512) but Still 

HAL_I2C_Master_Transmit  Return 

HAL_BUSY 

How can I fix this problem?

Thank

4 REPLIES 4
Posted on September 06, 2017 at 16:25

Do you have external pull up resistors on the SDA/SCL pins?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pedram
Associate III
Posted on September 06, 2017 at 17:07

I thought I found the problem

When I comment on the code below, it works correctly and 

HAL_I2C_Master_Transmit

 Return HAL_TIMEOUT

__HAL_AFIO_REMAP_I2C1_ENABLE();

but why ?

Posted on September 06, 2017 at 16:31

yes i do , i using resistors 10k on sda/scl 

But HAL_I2C_Master_Transmit Return HAL_BUSY 
Posted on September 06, 2017 at 16:50

Ok, then look at how the pins vs peripheral are initialized, the F1 parts were always a bit awkward in terms of when the I2C bus was enabled wrt the state of the pins. Not familiar with HAL implementation on the F1.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..