When HAL_Delay function is called, the processor (STM32F746NG-DISCO) is stuck in the HAL_delay function. I tried changing the HAL_Delay() function for debugging as below
__weak void HAL_Delay(uint32_t Delay)
{
uint32_t tickstart = HAL_GetTick();
uint32_t wait = Delay;
/* Add a freq to guarantee minimum wait */
if (wait < HAL_MAX_DELAY)
{
wait += (uint32_t)(uwTickFreq);
}
uint32_t tickEnd = HAL_GetTick();
while ((tickEnd - tickstart) < wait)
{
}
}
while debugging the variable tickEnd is not updating as shown below.
As seen above the tickEnd is always set to <optimized out>
. The code is generated using touchGFX and it uses TIM6 for system base clock, initially the application used to run properly, I am not sure about the source of this problem, can someone help me figure it out.