cancel
Showing results for 
Search instead for 
Did you mean: 

uwTick not incrementing.. (HAL_Delay())

ckim
Associate II
Posted on December 04, 2015 at 07:58

Hi,

I called HAL_Delay(500); but inside the function, the return value of HAL_GetTick() is zero. What can be wrong? 

Thanks in advance.

EDIT : oops, when I set a break point at line A below, I see tickstart is always 0 even when I press F10 keys many times because it can never progress. If I remove the break point and set a breakpoint there later, I see increased tickstart value. Because I called HAL_Delay(500); inside while loop, every time I see increment, it is incremented in unit of 500 ticks.  I was confused by the way debugger works.

__weak void HAL_Delay(__IO uint32_t Delay)

{

  uint32_t tickstart = 0;

  tickstart = HAL_GetTick();

  while((HAL_GetTick() - tickstart) < Delay)   <=== line A

  {

  }

}

Chan

1 REPLY 1
Posted on December 04, 2015 at 14:27

Can we keep this in [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/HAL_Delay%28%29%20not%20working.%20help%20%28newbie%29&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx&currentviews=16]ONE thread?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..