Skip to main content
Graduate
April 16, 2023
Question

hal_delay() not working

  • April 16, 2023
  • 22 replies
  • 14345 views

So I've created a project and am trying to use the HAL_delay(10); but it gets stuck at this function when im trying to debug.

I have been changing the clock and enabling the TIM2 so I don't know if i've messed something up. Here are the settings that I have:


_legacyfs_online_stmicro_images_0693W00000biAmBQAU.png
_legacyfs_online_stmicro_images_0693W00000biAmGQAU.png
_legacyfs_online_stmicro_images_0693W00000biAmVQAU.png
_legacyfs_online_stmicro_images_0693W00000biAmaQAE.png
_legacyfs_online_stmicro_images_0693W00000biAmfQAE.png 

And that is about it

    This topic has been closed for replies.

    22 replies

    Graduate II
    April 17, 2023

    Upload the schematic

    PPopo.1Author
    Graduate
    April 18, 2023

    There you go sir

    Visitor II
    May 8, 2025

    The debug is the problem. Systick stop working during a debug-session. Since my app is a single thread I replaced every HAL_Delay with a normal loop with some NOP() that made up a delay_1us()....

    I haven't found a solution to this problem. To much work when it can be solved with a simple loop.