cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401: HAL Busy never clears after write

Tyler Arnold
Associate
Posted on January 20, 2018 at 01:48

hi there, 

  I am debugging an issue on the M4 where the SR2 hal busy bit never clears after a write transaction. The slave device asserts clock stretching but releases the clock. 

 0690X00000609P6QAI.png

with some debug added to the hal code, we see the following:

/vendor/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c:5265: I2C_WaitOnFlagUntilTimeout SR2

./vendor/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c:5272: I2C_WaitOnFlagUntilTimeout start: flag 100002 SR2 0

./vendor/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c:5263: I2C_WaitOnFlagUntilTimeout SR1

./vendor/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c:5270: I2C_WaitOnFlagUntilTimeout start: flag 10001 SR1 1

./vendor/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c:725: HAL_I2C_Master_Receive: HAL_I2C_STATE_READY

./vendor/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c:5265: I2C_WaitOnFlagUntilTimeout SR2

./vendor/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c:5272: I2C_WaitOnFlagUntilTimeout start: flag 100002 SR2 2

./vendor/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c:5281: I2C_WaitOnFlagUntilTimeout poll: flag 100002 SR2 2

./vendor/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c:5292: I2C_WaitOnFlagUntilTimeout to: flag 100002 SR1 0 SR2 2

./vendor/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c:730: HAL_I2C_Master_Receive: HAL_BUSY, start = 42211, end = 42274

0 REPLIES 0