cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 I2C Busy Error

younginpark
Associate II

I2C was used in stm32, but
In the picture below, I am using the Write and Read functions, but the error message “busy” appears. Is there a way to resolve this?
I'll post pictures and code together.

Error busy.PNG

Main.PNG

  

1 ACCEPTED SOLUTION

Accepted Solutions
Foued_KH
ST Employee

Hello @younginpark , 

Which STM32 board do you use ?
I recommend you to use an oscilloscope to check 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.

View solution in original post

6 REPLIES 6
Foued_KH
ST Employee

Hello @younginpark , 

Which STM32 board do you use ?
I recommend you to use an oscilloscope to check 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.

Issamos
Lead II

Hello @younginpark 

I think you have the same problem as in this post. You may need to use external pull-up.

Best regards.

II

I currently have SDA and SCL pull-up resistors installed. Is there another reason?
4.7K Resister

LCE
Principal

Probably an I2C STOP command missing somewhere.

Could you please explain in detail?

LCE
Principal

Typical I2C transfer is:

- master issues I2C start

- master writes command / address byte(s)

- master reads or writes data

- master issues I2C stop


If I2C bus is not stopped correctly, with both SDA and SCL pin in tristate / HI after the last transfer, then I guess that HAL I2C detects that and issues the BUSY error.
Next guess is that in HAL's I2C stop the internal state is reset from BUSY to IDLE, so if stop is not sent, then bus and state are still busy.

Edit: Check with a scope, especially bus state after last transfer