Bladeren bron

Bugfix/fix weak handle trap in riscv common crash rv64 trap handling (#9189)

* [bsp][hpmicro] add weak handle_trap implementation

- added weak handle_trap implementation

Signed-off-by: Fan YANG <fan.yang@hpmicro.com>

* [libcpu][risc-v][common] remove weak handle_trap function

- removed weak handle_trap function from trap_common.c

Signed-off-by: Fan YANG <fan.yang@hpmicro.com>

---------

Signed-off-by: Fan YANG <fan.yang@hpmicro.com>
Fan Yang 9 maanden geleden
bovenliggende
commit
96ba787e25

+ 7 - 0
bsp/hpmicro/hpm5300evk/startup/HPM5361/trap.c

@@ -302,3 +302,10 @@ void trap_entry(void)
     write_fcsr(fcsr);
 #endif
 }
+
+/**
+ * Trap Handler
+ */
+rt_weak void handle_trap(rt_uint32_t mcause, rt_uint32_t mepc, rt_uint32_t sp)
+{
+}

+ 7 - 0
bsp/hpmicro/hpm5301evklite/startup/HPM5301/trap.c

@@ -302,3 +302,10 @@ void trap_entry(void)
     write_fcsr(fcsr);
 #endif
 }
+
+/**
+ * Trap Handler
+ */
+rt_weak void handle_trap(rt_uint32_t mcause, rt_uint32_t mepc, rt_uint32_t sp)
+{
+}

+ 7 - 0
bsp/hpmicro/hpm6200evk/startup/HPM6280/trap.c

@@ -302,3 +302,10 @@ void trap_entry(void)
     write_fcsr(fcsr);
 #endif
 }
+
+/**
+ * Trap Handler
+ */
+rt_weak void handle_trap(rt_uint32_t mcause, rt_uint32_t mepc, rt_uint32_t sp)
+{
+}

+ 7 - 0
bsp/hpmicro/hpm6300evk/startup/HPM6360/trap.c

@@ -302,3 +302,10 @@ void trap_entry(void)
     write_fcsr(fcsr);
 #endif
 }
+
+/**
+ * Trap Handler
+ */
+rt_weak void handle_trap(rt_uint32_t mcause, rt_uint32_t mepc, rt_uint32_t sp)
+{
+}

+ 7 - 0
bsp/hpmicro/hpm6750evk/startup/HPM6750/trap.c

@@ -302,3 +302,10 @@ void trap_entry(void)
     write_fcsr(fcsr);
 #endif
 }
+
+/**
+ * Trap Handler
+ */
+rt_weak void handle_trap(rt_uint32_t mcause, rt_uint32_t mepc, rt_uint32_t sp)
+{
+}

+ 7 - 0
bsp/hpmicro/hpm6750evk2/startup/HPM6750/trap.c

@@ -302,3 +302,10 @@ void trap_entry(void)
     write_fcsr(fcsr);
 #endif
 }
+
+/**
+ * Trap Handler
+ */
+rt_weak void handle_trap(rt_uint32_t mcause, rt_uint32_t mepc, rt_uint32_t sp)
+{
+}

+ 7 - 0
bsp/hpmicro/hpm6750evkmini/startup/HPM6750/trap.c

@@ -302,3 +302,10 @@ void trap_entry(void)
     write_fcsr(fcsr);
 #endif
 }
+
+/**
+ * Trap Handler
+ */
+rt_weak void handle_trap(rt_uint32_t mcause, rt_uint32_t mepc, rt_uint32_t sp)
+{
+}

+ 7 - 0
bsp/hpmicro/hpm6800evk/startup/HPM6880/trap.c

@@ -302,3 +302,10 @@ void trap_entry(void)
     write_fcsr(fcsr);
 #endif
 }
+
+/**
+ * Trap Handler
+ */
+rt_weak void handle_trap(rt_uint32_t mcause, rt_uint32_t mepc, rt_uint32_t sp)
+{
+}

+ 0 - 7
libcpu/risc-v/common/trap_common.c

@@ -109,10 +109,3 @@ rt_weak void rt_show_stack_frame(void)
     rt_kprintf("t6      : 0x%08x\r\n", s_stack_frame->t6);
 #endif
 }
-
-/**
- * Trap Handler
- */
-rt_weak void handle_trap(rt_uint32_t mcause, rt_uint32_t mepc, rt_uint32_t sp)
-{
-}