cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX 6.16 generated code: HAL_GetTick() always returns 0

Jason57
Associate

Hi,

I use cubemx to generate code for STM32CubeIDE, compile is OK, but the initial process run fail with HAL_Delay function, the HAL_GetTick() always return 0 so the program blocked here.

 

attached is my .ioc file, any anyone help for thie issue?

1 ACCEPTED SOLUTION

Accepted Solutions
Jason57
Associate

thanks for your reply, I add 2 seconds in the "max halt timeout" and the problem solved.

View solution in original post

2 REPLIES 2
TDK
Super User

The issue is likely in how and where you're using HAL_Delay in your code. Ensure interrupts stay enabled and ensure the tick interrupt gets serviced.

The TIM6 priority is 0 in the IOC which is the highest. No issues there.

 

If you feel a post has answered your question, please click "Accept as Solution".
Jason57
Associate

thanks for your reply, I add 2 seconds in the "max halt timeout" and the problem solved.