Skip to main content
wasp.lahis
Visitor II
August 10, 2020
Question

STM32L4 - HAL_I2C_STATE_BUSY_RX issue

  • August 10, 2020
  • 2 replies
  • 1104 views

I'm having trouble with i2c communication. In my i2c bus, i have 4 boards (STM32L4 Sensortiles) and sometimes one of them blocks the bus and the others stop communicating consequently. When I reset that one that blocks the bus, all boards starting working again.

In my debugs, this bug happened when HAL_I2C_GetState(&hi2c3) returns HAL_I2C_STATE_BUSY_RX, even my others i2c functions HAL_I2C_Slave_Receive_IT and HAL_I2C_Slave_Transmit_IT returns HAL_OK:

0693W000003OstZQAS.png

Any ideas what I'm doing wrong? Thanks.

    This topic has been closed for replies.

    2 replies

    T J
    Senior III
    August 10, 2020

    I believe the problem with IIC being dodgy is the clock source and pin speed.

    make sure your IIC clock source is above 2MHz and set the pin to very fast.

    prain
    Visitor II
    August 11, 2020

    HAL_I2C_STATE_BUSY_RX is a temporary state. It should return to idle state. step into code and check. Usually the transmit/receive complete interrupt resets the HAL to idle state.