cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_Delay blocks the entire program

yaxsomo
Associate III

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.

6 REPLIES 6

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
Up vote any posts that you find helpful, it shows what's working..

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
Chief II

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 "Accept as Solution".

Thank you for replying!

Is this HAL priority changeable on the NVIC configuration? 

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 "Accept as Solution".

If you see the screenshot that i sent, it is already set to 0..