2020-01-27 03:30 AM
Hi all,
I am working with the Nucleo-F446ZE board.
I generated a project with CubeMx .
At this point the project is running fine with UART interrupts and data.
I debug the project and all is working.
I need to use a delay function in my project. SO I have used HAL_Delay(20); for example.
But it never exits from that function. Debugging at it came to know it stuck in below while loop.
while((HAL_GetTick() - tickstart) < wait)
{
}
Any help?I am using the Delay function inside UART ISR. Please help.
2020-01-27 01:21 PM
Using HAL_Delay in an ISR is rarely a good idea. Are you sure that the USART ISR prio is lower than SysTick?
2020-01-27 07:46 PM
Possibilities:
1) SysTick interrupt isnt set up or enabled
2) interrupts are disabled
3) priority of systick is less or equal to that of the uart. Note that priority of 0 is highest priority.
4) interrupts cannot preempt each other. Check priority grouping setting.
2020-01-27 09:08 PM
check your interrupt settings
2020-01-27 10:20 PM
Looks like both interrupts priority was same.
This was causing the issue. Thanks for the reply. Now it's working.
2020-01-27 10:21 PM
Looks like both interrupts priority was same as 0.
This was causing the issue. Thanks for the reply. Now it's working.