From a6fb72230094251479e83eaa3c6b7d73b9627131 Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Thu, 26 Sep 2024 11:35:25 +0800 Subject: [PATCH] SoC/evalsoc: Fix undeclared exc_entry when CFG_HAS_TRAP_CSR macro defined Error like this error: 'exc_entry' undeclared (first use in this function) Signed-off-by: Huaqi Fang <578567190@qq.com> --- SoC/evalsoc/Common/Include/cpufeature.h | 4 ++++ SoC/evalsoc/Common/Source/system_evalsoc.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/SoC/evalsoc/Common/Include/cpufeature.h b/SoC/evalsoc/Common/Include/cpufeature.h index 771f82c6..2ef99109 100644 --- a/SoC/evalsoc/Common/Include/cpufeature.h +++ b/SoC/evalsoc/Common/Include/cpufeature.h @@ -26,6 +26,10 @@ extern "C" { // EXCP is the exception module, if not defined, it means not present // If not present, you need to remove .exception section in linker script #define CFG_HAS_EXCP + +// Define it when you have TRAP related CSR such as MTVT and MTVEC +//#define CFG_HAS_TRAP_CSR + // PMONITOR is the mcycle and minsret counter, if not defined, it means not present #define CFG_HAS_PMONITOR diff --git a/SoC/evalsoc/Common/Source/system_evalsoc.c b/SoC/evalsoc/Common/Source/system_evalsoc.c index 8c5eb820..a4ab1b81 100644 --- a/SoC/evalsoc/Common/Source/system_evalsoc.c +++ b/SoC/evalsoc/Common/Source/system_evalsoc.c @@ -36,6 +36,10 @@ #define SYSTEM_CLOCK (16000000UL) #endif +#ifdef CFG_HAS_EXCP +extern void exc_entry(void); +#endif + /** * \defgroup NMSIS_Core_SystemConfig System Device Configuration * \brief Functions for system and clock setup available in system_.c.