Skip to main content
Associate II
September 11, 2023
Solved

STM32 I2C Busy Error

  • September 11, 2023
  • 6 replies
  • 11436 views

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

    This topic has been closed for replies.
    Best answer by Foued_KH

    Hello @younginpark , 

    Which STM32 board do you use ?
    I recommend you to use an oscilloscope to check SDA and SCL behavior.

    Foued

    6 replies

    Foued_KH
    Foued_KHBest answer
    ST Employee
    September 11, 2023

    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
    Super User
    September 11, 2023

    Hello @younginpark 

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

    Best regards.

    II

    Associate II
    September 11, 2023

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

    LCE
    Principal II
    September 11, 2023

    Probably an I2C STOP command missing somewhere.

    Associate II
    September 11, 2023

    Could you please explain in detail?

    LCE
    Principal II
    September 11, 2023

    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