Olimex Support Forum

ARM => ST => Topic started by: josephma on April 16, 2024, 09:52:04 AM

Title: STM32-E407 SysTick Issue in STM32 CUBE IDE
Post by: josephma on April 16, 2024, 09:52:04 AM
I have setup an STM32 Project in CUBE IDE v1.15.0 which is the latest version. I am trying to blink the LED on the board.
But the issue is whenever I call the HAL_Delay() function, the program goes into an infinite loop. Otherwise when I comment out HAL_Delay() and try to single step my code to toggle the LED status, it works.
I presume there is some issue with the SysTick interrupt. I tried assigning highest priority of 0 to SysTick, but to no use.
Please help me to sort out this issue.
Title: Re: STM32-E407 SysTick Issue in STM32 CUBE IDE
Post by: LubOlimex on April 16, 2024, 10:12:08 AM
Probably something about the interrupt priorities, but it is super popular issue you will find more info in STCube forums than here:

https://community.st.com/t5/stm32-mcus-embedded-software/hal-delay-issue-infinite-loop/td-p/583197

https://stackoverflow.com/questions/53899882/hal-delay-stuck-in-a-infinite-loop
Title: Re: STM32-E407 SysTick Issue in STM32 CUBE IDE
Post by: josephma on April 17, 2024, 09:36:13 AM
Thanks for the reply. I checked out the threads shared by you. It mentions about raising the interrupt priority of SysTick, which I did but achieved no success. The problem still persists.
Title: Re: STM32-E407 SysTick Issue in STM32 CUBE IDE
Post by: LubOlimex on April 17, 2024, 09:38:20 AM
Is LTDC lower priority tho?

"All delay and timeout HAL functions rely on a counter incremented in the SysTick handler. If you are using any of these functions in another interrupt, you have to make sure that the SysTick interrupt has a higher priority than that interrupt. Otherwise, the SysTick handler is never called and you will end up in an infinite loop, as the counter will never be increased."