From 68cd1b7f9e1e86cc2d32310c2e4eaec6e3fc580a Mon Sep 17 00:00:00 2001 From: Bobby Noelte Date: Tue, 14 Apr 2020 18:12:22 +0200 Subject: [PATCH] arch: arm: aarch32: fix system clock driver selection for cortex m The selection of the Cortex M systick driver to be used as a system clock driver is controlled by CONFIG_CORTEX_M_SYSTICK. To replace it by another driver CONFIG_CORTEX_M_SYSTICK must be set to 'n'. Unfortunately this also controls the interrupt vector for the systick interrupt. It is now routed to z_arm_exc_spurious. Remove the dependecy on CONFIG_CORTEX_M_SYSTICK and route to z_clock_isr as it was before #24012. Fixes #24347 Signed-off-by: Bobby Noelte --- arch/arm/core/aarch32/cortex_m/vector_table.S | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/core/aarch32/cortex_m/vector_table.S b/arch/arm/core/aarch32/cortex_m/vector_table.S index 212fa4e8115..7f9106484a0 100644 --- a/arch/arm/core/aarch32/cortex_m/vector_table.S +++ b/arch/arm/core/aarch32/cortex_m/vector_table.S @@ -72,11 +72,14 @@ SECTION_SUBSEC_FUNC(exc_vector_table,_vector_table_section,_vector_table) .word 0 .word z_arm_pendsv #if defined(CONFIG_CPU_CORTEX_M_HAS_SYSTICK) -#if defined(CONFIG_SYS_CLOCK_EXISTS) && defined(CONFIG_CORTEX_M_SYSTICK) +#if defined(CONFIG_SYS_CLOCK_EXISTS) + /* Install z_clock_isr even if CORTEX_M_SYSTICK is not set + * (e.g. to support out-of-tree SysTick-based timer drivers). + */ .word z_clock_isr #else .word z_arm_exc_spurious -#endif /* CONFIG_SYS_CLOCK_EXISTS && CONFIG_CORTEX_M_SYSTICK */ +#endif /* CONFIG_SYS_CLOCK_EXISTS */ #else .word 0 #endif /* CONFIG_CPU_CORTEX_M_HAS_SYSTICK */