cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_Delay not working

MGiov.2
Associate

hello, i´m using stm32f103c8t6 and cubeIDE to write a simple blink code. The program get stuck in the HAL_Delay call. I noticed that the program blocks in the second call of HAL_GetTick(void).

I tried adding this to stm32f1xx_it.c as suggested in other post in this forum:

void SysTick_Handler(void)
 
{
 
 
 /* USER CODE BEGIN SysTick_IRQn 0 */
 
  /* USER CODE END SysTick_IRQn 0 */
 
 
  HAL_IncTick();
 
 
  HAL_SYSTICK_IRQHandler();
 
  /* USER CODE BEGIN SysTick_IRQn 1 */
 
 
  /* USER CODE END SysTick_IRQn 1 */
 
}

but without results, any ideas to get this function to work proprerly?

2 REPLIES 2
Javier1
Principal

are you calling hal_delay() inside an interruption by any chance?

we dont need to firmware by ourselves, lets talk
andy2399
Senior

Is the SysTick timer enabled ?

Andy