Troubles with HAL_GetTick() in the I2C_WaitOnFlagUntilTimeout functions on a STM32G473 MCU
I am currently using the v1.6.1 of STM32CubeIDE and a STM32G473 MCU.
I have implemented an I2C bus and have noticed a major bug with the I2C_WaitOnFlagUntilTimeout functions. There is this condition:
if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U))
which is supposed to guarantee that the program doesn't get stuck into the while loop above (while (__HAL_I2C_GET_FLAG(hi2c, Flag) == Status)), but the tick value stop incrementing as soon as the program enters the function for a reason I don't understand. I have tried to increase the preempt priority of System tick timer (by lowering the value) but it didn't change a thing.
Does anyone know how to fix that?
