Skip to main content
Associate III
July 20, 2024
Question

HAL_Delay blocks the entire program

Hello everyone. I have a big problem with my custom STM32H7 board, in particular with HAL_Delay.

When I add a line on my main.c file to simply print on SWV, the first time seems to work, but after it does not work anymore. It prints the first time, and after it seems stuck in HAL_Delay indefinitely.. Could someone help me debug this issue? I'll put the .ioc file below,

 

Thanks in advance.

This topic has been closed for replies.

7 replies

Tesla DeLorean
Guru
July 20, 2024

Is SysTick or whatever you've selected as the timing source started? After HAL_Init()?

Look at which TIM or SysTick was started?

Check Handler enabled in NVIC

Check IRQHandler is used, and calling HAL_IncTick()

Use some basic diagnostic and inspection methods.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
yaxsomoAuthor
Associate III
July 20, 2024

Thank you for the fast response. Here's the NVIC configuration : 

yaxsomo_0-1721506616341.png

The Timebase source is SysTick 

yaxsomo_1-1721506641211.png
Here's my main.c file

I'm pretty new to this part of STM32, so I don't really know what to do exactly ahah

AScha.3
Super User
July 20, 2024

Hi,

so you do something wrong.

Maybe set priority of HAL to low. Lower than ...whatever you call.

Very simple error...

If you feel a post has answered your question, please click on " Best Answer ".
yaxsomoAuthor
Associate III
July 20, 2024

Thank you for replying!

Is this HAL priority changeable on the NVIC configuration? 

AScha.3
Super User
July 20, 2024

Sure...

AScha3_0-1721507076664.png

So set it to higher (closer to 0 ) prio...

If you feel a post has answered your question, please click on " Best Answer ".