2021-07-19 11:30 PM
I am new to stm32, I have a stm32F407VG discovery board. I tried to implement an interrupt using the user button and added HAL_Delay() inside the interrupt function. After I press the Button the Interrupt execute but it got stuck there, it is not coming back to main(). What should I do to handle this ?
Solved! Go to Solution.
2021-07-20 06:07 AM
Problematic in ISR and call-backs that HAL makes from same interrupt context.
Figure out a better way of coming back later to follow up.
Or change the SysTick to have the highest priority, at its own preemption level, keeping it very short.
2021-07-20 06:02 AM
Yes, but it's not best practice.
You need to ensure the SysTick interrupt still fires, so SysTick must be at a higher preemption priority (numerically lower) than the interrupt you're currently in.
2021-07-20 06:07 AM
Problematic in ISR and call-backs that HAL makes from same interrupt context.
Figure out a better way of coming back later to follow up.
Or change the SysTick to have the highest priority, at its own preemption level, keeping it very short.
2021-07-20 10:02 PM
Problem solved by reducing the interrupt priority.