diff --git a/cpu/cortexm_common/include/vectors_cortexm.h b/cpu/cortexm_common/include/vectors_cortexm.h index 30d899a6992a..f47957ccb99b 100644 --- a/cpu/cortexm_common/include/vectors_cortexm.h +++ b/cpu/cortexm_common/include/vectors_cortexm.h @@ -62,7 +62,7 @@ void nmi_default(void); * causes of hard faults are access to un-aligned pointers on Cortex-M0 CPUs * and calls of function pointers that are set to NULL. */ -void hard_fault_default(void) __attribute__((naked)); +void hard_fault_default(void); /* The following four exceptions are only present for Cortex-M3 and -M4 CPUs */ #if defined(CPU_ARCH_CORTEX_M3) || defined(CPU_ARCH_CORTEX_M4) || \ diff --git a/cpu/cortexm_common/vectors_cortexm.c b/cpu/cortexm_common/vectors_cortexm.c index 9c1c15d1d5d3..12f8293a36aa 100644 --- a/cpu/cortexm_common/vectors_cortexm.c +++ b/cpu/cortexm_common/vectors_cortexm.c @@ -134,7 +134,7 @@ static inline int _stack_size_left(uint32_t required) } /* Trampoline function to save stack pointer before calling hard fault handler */ -void hard_fault_default(void) +__attribute__((naked)) void hard_fault_default(void) { /* Get stack pointer where exception stack frame lies */ __ASM volatile