If we have a look at stm32f4xx_hal.c, we see as “Care must be taken if HAL_Delay() is called from a peripheral ISR process, The SysTick interrupt must have higher priority (numerically lower) than the peripheral interrupt”. This information should be taken into consideration while programming.
We might get a problem of the systick interrupt. For example; the systick gives up its own interrupt handling during the EXTI interrupts working. To get rid of this problem;
- set the systick interrupt priority higher than other interrupts in the NVIC settings on the stm32cubemx by setting the preemption values.
- Or use the HAL_InitTick() function to set the tick_priority in your codes.
- If we set the preemption value high, the priority level decreases.