2023-12-05 11:18 AM
I have read most of the replies to posts that had the same problem that I am having with HAL_Delay() not working. None of the solutions that I tried worked.
It is apparent that the interrupt handler is never getting executed so any attempt to use HAL_Delay() just locks up the firmware. In an earlier version of this firmware, I did not have any problems, but now I have not been able to restore operation.
Help! (thanks in advance)
Solved! Go to Solution.
2023-12-05 12:32 PM
Going to be hard to debug without seeing code, so we can only provide generic advice.
2023-12-05 11:41 AM
Hello @DavidNaviaux
HAL_Delay function depends on SysTick interrupt, so if you don't assign proper priorities to that, you may have a problem with the HAL_Delay.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-12-05 12:01 PM
Per the advice in one of the responses to others with this problem, I have added this line of code immediately following the execution of the SystemClock_Config() function in main.c, but it did not solve the problem.
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
I then forced the vector table location to Flash with the line of code below the at the end of the SystemInit() function in the system_stm32g4xx.c file, again no success:
SCB->VTOR = FLASH_BASE | 0x00000000U;
I have written my own timing functions and they work fine. Unfortunately, it seems like HAL_Delay() is required by
many of the HAL_ functions and my code won't work unless that function is working.
2023-12-05 12:32 PM
Going to be hard to debug without seeing code, so we can only provide generic advice.
2023-12-05 01:06 PM
Maybe a .ioc file would help diagnosis.
2023-12-12 06:45 PM
TDK,
The problem continued to plague me. Sometimes it worked fine until I made a small change in the code that should not have done anything. However, I did find a couple of misused pointers that may have been the root cause. I have not had the problem with the SysTick for several days and I have done quite a bit of development work.
Thanks, David
2024-07-01 04:32 PM - edited 2024-07-01 08:28 PM
I hit the same issue when upgrading from L4 HAL from 1.17.1 to 1.17.2.
Reverting stm32l4xx_hal_timebase_tim.c to the version from 1.17.1 fixed it for me.
Update: More in-depth debugging revealed that the root cause of the issues was that I was calling HAL_Delay() from a FreeRTOS thread, rather than calling osDelay(). This issue was hidden by previous releases.