Resolved! HAL delay doesn't match the value
I am using an STM32 MCU. When I use the HAL_Delay function with a parameter of 1000 for example, I see that the delay is shorter than it should be. I have checked that HAL_IncTick(), but it works correctly and it is placed inside the SysTick_Handler....