diff --git a/arch/arm/src/stm32h7/stm32_i2c.c b/arch/arm/src/stm32h7/stm32_i2c.c index 14ea09e631..042e45ceee 100644 --- a/arch/arm/src/stm32h7/stm32_i2c.c +++ b/arch/arm/src/stm32h7/stm32_i2c.c @@ -1423,7 +1423,9 @@ static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv) * it otherwise. */ - if (priv->msgc > 0) + /* Check if there are multiple messages and the next is a continuation */ + + if (priv->msgc > 1) { next_norestart = (((priv->msgv + 1)->flags & I2C_M_NOSTART) != 0); } diff --git a/arch/arm/src/stm32l4/stm32l4_i2c.c b/arch/arm/src/stm32l4/stm32l4_i2c.c index 8bce93048f..7df5e2c892 100644 --- a/arch/arm/src/stm32l4/stm32l4_i2c.c +++ b/arch/arm/src/stm32l4/stm32l4_i2c.c @@ -1593,7 +1593,9 @@ static inline void stm32l4_i2c_sendstart(FAR struct stm32l4_i2c_priv_s *priv) * it otherwise. */ - if (priv->msgc > 0) + /* Check if there are multiple messages and the next is a continuation */ + + if (priv->msgc > 1) { next_norestart = (((priv->msgv + 1)->flags & I2C_M_NOSTART) != 0); }