Skip to content

Commit

Permalink
Kconfig: add config for low-priority debug mon isr
Browse files Browse the repository at this point in the history
Debug monitor needs to be configured to a low priority in order to be
useful for debugging (to prioritize other interrupts when waiting on a
breakpoint).
Added a config that configures the interrupt this way.

Signed-off-by: Piotr Jasiński <[email protected]>
  • Loading branch information
pjasinski990 authored and carlescufi committed Dec 28, 2022
1 parent 1fe4b1e commit 7fa0af0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion arch/arm/core/aarch32/cortex_m/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,13 @@ config CORTEX_M_DWT
Enable and use the Data Watchpoint and Trace (DWT) unit for
timing functions.

# Additional stack for tests when building with FPU_SHARING
config CORTEX_M_DEBUG_MONITOR_HOOK
bool "Debug monitor interrupt for debugging"
depends on !ARMV6_M_ARMV8_M_BASELINE
help
Enable this option to configure debug monitor exception to low priority
for debugging purposes.

# enabled, which may increase ESF stacking requirements for
# threads.
config TEST_EXTRA_STACK_SIZE
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/include/aarch32/cortex_m/exc.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,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)
#if defined(CONFIG_CORTEX_M_DEBUG_MONITOR_HOOK)
NVIC_SetPriority(DebugMonitor_IRQn, IRQ_PRIO_LOWEST);
#elif defined(CONFIG_CPU_CORTEX_M_HAS_DWT)
NVIC_SetPriority(DebugMonitor_IRQn, _EXC_FAULT_PRIO);
#endif
#if defined(CONFIG_ARM_SECURE_FIRMWARE)
Expand Down

0 comments on commit 7fa0af0

Please sign in to comment.