Skip to content

Commit a65bacc

Browse files
committed
[STM32F4] Master receive sequential - fix for HAL I2C
in case of 2 consecutives calls to HAL_I2C_Master_Sequential_Receive_IT with the Xfer mode I2C_FIRST_AND_LAST_FRAME, the second trasnfer does not start at all. It seems this is because the previous state is maintained as I2C_STATE_MASTER_BUSY_RX and therefore the START condition will not be generated
1 parent a50dc77 commit a65bacc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_i2c.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3960,7 +3960,8 @@ static HAL_StatusTypeDef I2C_MasterReceive_BTF(I2C_HandleTypeDef *hi2c)
39603960
__HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_ERR);
39613961

39623962
hi2c->State = HAL_I2C_STATE_READY;
3963-
3963+
hi2c->PreviousState = I2C_STATE_NONE;
3964+
39643965
if(hi2c->Mode == HAL_I2C_MODE_MEM)
39653966
{
39663967
hi2c->Mode = HAL_I2C_MODE_NONE;

0 commit comments

Comments
 (0)