arm: ensure SysTick IRQ level is set unconditionally
When the SoC implements SysTick, but the system does not use it as the driver for system timing we still need to set its interrupt level. This is because the SysTick IRQ is always enabled, so we must ensure the interrupt priority is set to a level lower than the kernel interrupts (for the assert mechanism to work properly) in case the SysTick interrupt is accidentaly raised. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
parent
28a59f67b9
commit
6981b84550
1 changed files with 13 additions and 0 deletions
|
@ -145,6 +145,19 @@ static ALWAYS_INLINE void z_arm_exc_setup(void)
|
|||
* SecureHardFault in a PE without the Main Extension.
|
||||
*/
|
||||
#endif /* ARM_SECURE_FIRMWARE && !ARM_SECURE_BUSFAULT_HARDFAULT_NMI */
|
||||
|
||||
#if defined(CONFIG_CPU_CORTEX_M_HAS_SYSTICK) && \
|
||||
!defined(CONFIG_CORTEX_M_SYSTICK)
|
||||
/* SoC implements SysTick, but the system does not use it
|
||||
* as driver for system timing. However, the SysTick IRQ is
|
||||
* always enabled, so we must ensure the interrupt priority
|
||||
* is set to a level lower than the kernel interrupts (for
|
||||
* the assert mechanism to work properly) in case the SysTick
|
||||
* interrupt is accidentally raised.
|
||||
*/
|
||||
NVIC_SetPriority(SysTick_IRQn, _EXC_IRQ_DEFAULT_PRIO);
|
||||
#endif /* CPU_CORTEX_M_HAS_SYSTICK && ! CORTEX_M_SYSTICK */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue