Browse Source

SoC/evalsoc: Fix MAX_SYSTEM_EXCEPTION_NUM from 19 to 26

Then it will fix demo_stack_check case not running as expected

Signed-off-by: Huaqi Fang <578567190@qq.com>
Huaqi Fang 7 months ago
parent
commit
34b83b7a5c
2 changed files with 5 additions and 3 deletions
  1. 3 3
      SoC/evalsoc/Common/Source/system_evalsoc.c
  2. 2 0
      doc/source/changelog.rst

+ 3 - 3
SoC/evalsoc/Common/Source/system_evalsoc.c

@@ -240,13 +240,13 @@ typedef void (*EXC_HANDLER)(unsigned long cause, unsigned long sp);
 typedef void (*INT_HANDLER)(unsigned long cause, unsigned long sp);
 
 /** \brief Max exception handler number, don't include the NMI(0xFFF) one */
-#define MAX_SYSTEM_EXCEPTION_NUM        20
+#define MAX_SYSTEM_EXCEPTION_NUM        26
 /**
  * \brief      Store the exception handlers for each exception ID
  * \note
  * - This SystemExceptionHandlers are used to store all the handlers for all
  * the exception codes Nuclei N/NX core provided.
- * - Exception code 0 - 19, totally 20 exceptions are mapped to SystemExceptionHandlers[0:19]
+ * - Exception code 0 - MAX_SYSTEM_EXCEPTION_NUM, totally MAX_SYSTEM_EXCEPTION_NUM + 1 exceptions are mapped to SystemExceptionHandlers[0:MAX_SYSTEM_EXCEPTION_NUM]
  * - Exception for NMI is also re-routed to exception handling(exception code 0xFFF) in startup code configuration, the handler itself is mapped to SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM]
  */
 static unsigned long SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM + 1];
@@ -269,7 +269,7 @@ static INT_HANDLER system_core_interrupt_handler = NULL;
  * \note
  * - This SystemExceptionHandlers_S are used to store all the handlers for all
  * the exception codes Nuclei N/NX core provided.
- * - Exception code 0 - 19, totally 20 exceptions are mapped to SystemExceptionHandlers_S[0:19]
+ * - Exception code 0 - MAX_SYSTEM_EXCEPTION_NUM, totally MAX_SYSTEM_EXCEPTION_NUM + 1 exceptions are mapped to SystemExceptionHandlers_S[0:MAX_SYSTEM_EXCEPTION_NUM]
  */
 #if (defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1))
 static unsigned long SystemExceptionHandlers_S[MAX_SYSTEM_EXCEPTION_NUM];

+ 2 - 0
doc/source/changelog.rst

@@ -12,6 +12,7 @@ This is release version of ``0.8.1`` of Nuclei SDK.
 
   - Remove ``-ffast-math`` for clang based toolchain since it is deprecated
   - Update ``demo_cache`` optimization level to ``-O2`` and update its doc
+  - Fix ``demo_stack_check`` via modify evalsoc correct max exception number ``MAX_SYSTEM_EXCEPTION_NUM``
 
 * NMSIS
 
@@ -25,6 +26,7 @@ This is release version of ``0.8.1`` of Nuclei SDK.
   - Fix evalsoc stubs.c compile fail in RT-Thread
   - Fix evalsoc linker options in RT-Thread SConscript to fix link issue
   - Fix instruction fetch not updated via fence.i after text section copied to cached area when program run in flash download mode
+  - Fix ``MAX_SYSTEM_EXCEPTION_NUM`` for evalsoc, it should be 26 not 19, which will fix ``demo_stack_check`` case
 
 * OS