Skip to main content
Explorer II
July 20, 2024
Question

HAL_Delay blocks the entire program

  • July 20, 2024
  • 2 replies
  • 1857 views

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.

    2 replies

    Graduate II
    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.

    yaxsomoAuthor
    Explorer II
    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

    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...

    yaxsomoAuthor
    Explorer II
    July 20, 2024

    Thank you for replying!

    Is this HAL priority changeable on the NVIC configuration? 

    Super User
    July 20, 2024

    Sure...

    AScha3_0-1721507076664.png

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