Skip to main content
PPopo.1
Senior
April 16, 2023
Question

hal_delay() not working

  • April 16, 2023
  • 54 replies
  • 21722 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.

54 replies

Karl Yamashita
Principal
April 17, 2023

Upload the schematic

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
PPopo.1
PPopo.1Author
Senior
April 18, 2023
Associate
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.