2023-08-02 03:26 AM
If I write HAL_Delay in the main function, then code execution gets stuck at this place.
int main
{
HAL_Delay(1);
}
Code execution does not exit the loop at this point.
while((HAL_GetTick() - tickstart) < wait)
I think because the SysTick_Handler interrupt is not executed and therefore uwTick is not incremented.
I set the SysTick timer to high priority, but nothing changed.
Why is SysTick_Handler not being executed?
SysTick_Handler should execute every 1 millisecond and increment the uwTick variable.
HAL_Delay in the while loop works correctly, HAL_Delay does not work in the main function.
Solved! Go to Solution.
2023-08-02 03:32 AM
Hello,
you should probably call:
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
before the call to HAL_Delay()
2023-08-02 03:32 AM
Hello,
you should probably call:
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
before the call to HAL_Delay()
2023-08-02 03:39 AM
Thanks.
:rolling_on_the_floor_laughing: I need to get some good sleep.