      }
  
    /* Loop until the transfer is complete. */
+@@ -737,6 +737,10 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
+   start = clock_systimer();
+   do
+     {
++      /* Calculate the elapsed time */
++
++      elapsed = clock_systimer() - start;
++
+       /* Check for STOP condition */
+ 
+       cr1 = stm32_i2c_getreg(priv, STM32_I2C_CR1_OFFSET);
+@@ -753,9 +757,6 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
+           return;
+         }
+ 
+-      /* Calculate the elapsed time */
+-
+-      elapsed = clock_systimer() - start;
+     }
+ 
+   /* Loop until the stop is complete or a timeout occurs. */
 diff --git NuttX/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c NuttX/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c
-index 312e0b4..193ccb8 100644
+index 312e0b4..b2da861 100644
 --- NuttX/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c
 +++ NuttX/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c
 @@ -7,7 +7,7 @@

     }
 
   /* Loop until the transfer is complete. */
diff --git NuttX/nuttx/arch/arm/src/stm32f7/stm32_i2c.c NuttX/nuttx/arch/arm/src/stm32f7/stm32_i2c.c
index d089db9..1b5951d 100644
--- NuttX/nuttx/arch/arm/src/stm32f7/stm32_i2c.c
+++ NuttX/nuttx/arch/arm/src/stm32f7/stm32_i2c.c
@@ -897,15 +897,15 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
 
   do

diff --git NuttX/nuttx/arch/arm/src/stm32/stm32_i2c.c NuttX/nuttx/arch/arm/src/stm32/stm32_i2c.c
index 631ba66..669e0db 100644
--- NuttX/nuttx/arch/arm/src/stm32/stm32_i2c.c
+++ NuttX/nuttx/arch/arm/src/stm32/stm32_i2c.c
@@ -7,7 +7,7 @@
