arm: set DebugMonitor IRQ unconditionally during initialization
If the DebugMonitor extension is implemented by the core, the interrupt may be pended and become active, even if it is not enabled. Set the priority level of DebugMonitor upon system initialization to the intended value unconditionally so we do not end up in undefined behavior, if the exception is accidentally pended. Since the priority level is set at init, we can remove resetting the priority in DWT driver initialization. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
parent
6981b84550
commit
70984a1587
2 changed files with 7 additions and 2 deletions
|
@ -163,8 +163,10 @@ static inline void z_arm_dwt_enable_debug_monitor(void)
|
|||
"DebugMonitor targets Non-Secure\n");
|
||||
#endif
|
||||
|
||||
/* Set the DebugMonitor handler priority to the higyhest value. */
|
||||
NVIC_SetPriority(DebugMonitor_IRQn, _EXC_FAULT_PRIO);
|
||||
/* The DebugMonitor handler priority is set already
|
||||
* to the highest value (_EXC_FAULT_PRIO) during
|
||||
* system initialization.
|
||||
*/
|
||||
|
||||
/* Enable debug monitor exception triggered on debug events */
|
||||
CoreDebug->DEMCR |= CoreDebug_DEMCR_MON_EN_Msk;
|
||||
|
|
|
@ -114,6 +114,9 @@ static ALWAYS_INLINE void z_arm_exc_setup(void)
|
|||
NVIC_SetPriority(MemoryManagement_IRQn, _EXC_FAULT_PRIO);
|
||||
NVIC_SetPriority(BusFault_IRQn, _EXC_FAULT_PRIO);
|
||||
NVIC_SetPriority(UsageFault_IRQn, _EXC_FAULT_PRIO);
|
||||
#if defined(CONFIG_CPU_CORTEX_M_HAS_DWT)
|
||||
NVIC_SetPriority(DebugMonitor_IRQn, _EXC_FAULT_PRIO);
|
||||
#endif
|
||||
#if defined(CONFIG_ARM_SECURE_FIRMWARE)
|
||||
NVIC_SetPriority(SecureFault_IRQn, _EXC_FAULT_PRIO);
|
||||
#endif /* CONFIG_ARM_SECURE_FIRMWARE */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue