cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_Delay problem!!!!!

DNguy.18
Associate II

Hello everyone!!!

I get a problem with HAL_Delay function. When I use STM32CubeMX creat my simple project (blink a led with STM32F4 Discovery Kit) everything is OK with HAL_Delay() function.

But when I creat a same project without using STM32CubeMX, HAL_Delay() function seem not working. I don't know why.

Anyone can help me!! Thank you very much!!!!

4 REPLIES 4
S.Ma
Principal

Make your own delay using basic timer and dependencies may decrease.

Make sure to initialize the SysTick interrupt and that the interrupt calls the HAL functions to advance the internal tick count.​

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

I have created project by STM32CubeMX but I can't find SysTick interrupt but it is OK. I copy this code to Keil uVision5 and HAL_Delay() not working.

JObr
Associate II

You can put this to main.c, it works for me:

void SysTick_Handler(void) {
    HAL_IncTick();
}