hal_delay() not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 3:53 AM - edited ‎2023-11-20 8:04 AM
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:
And that is about it
- Labels:
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 4:31 AM
where you call hal-delay? in INT ? you give all ints same (highest) priority 0 , so Systick cannot be called from same level. -> set tim2 2 , i2c..3 or so.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 4:32 AM
I call it in main function. I will try setting priority and will get back to you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 4:35 AM - edited ‎2023-11-20 8:04 AM
I changed it like so and it still gets stuck at HAL_delay(10);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 4:58 AM - edited ‎2023-11-20 8:04 AM
ok, in main should be no problem anyway.
try: not jump in/on hal-delay() , set cursor one or more lines after the line with delay and use run -> run to line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 5:07 AM
Cant even run the program that way. But when I debugg it doesn't go past the delay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 5:36 AM - edited ‎2023-11-20 8:04 AM
just..why not use the hse ?? (and pllm /2)
+
is program running when just run/start in debug? (and stop with suspend/pause )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 6:10 AM
I tried it with hsi, still not working. Yes, it seems like its running fine but cant really check because the live expression values are not showing for some reason. Also, do I need to do anything in the code to enable delay? I havent done anything, just tried to use it with hal_delay()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 6:24 AM
HAL_Delay(310); -- should just work. (but not: HAL_delay(10); ! d -> D !
if you have correct function call, just go in editor on the word with mouse cursor, you see in popup window the definition. if nothing shows up - wrong.
see on compile also every warning !!! only zero is good ->
<<15:23:20 Build Finished. 0 errors, 0 warnings. (took 3s.872ms) >>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 6:28 AM - edited ‎2023-11-20 8:04 AM
There is a declaration but it has been autogenerated, i didnt do it. I also have 9 warrning but only for unused variables later in the code. I tried 310 and also hal_delay(350), nothing works
