From f2ab0fc367bc106aa982815feb8eacb6d85d5247 Mon Sep 17 00:00:00 2001 From: KLASSENTS Date: Thu, 27 Mar 2025 10:32:10 +0700 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B8=D0=BB=D1=8C=D0=BD=D1=83=D1=8E=20ra?= =?UTF-8?q?w=5Ftrap=5Fhandler=20=D0=BE=D0=B1=D1=8A=D1=8F=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=B2=D0=BE=20freeRTOS,=20=D1=87=D1=82=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=20trap=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=B2=D0=B0?= =?UTF-8?q?=D1=82=D1=8B=D0=B2=D0=B0=D0=BB=D1=81=D1=8F=20=D0=BE=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B0=D1=86=D0=B8=D0=BE=D0=BD=D0=BD=D0=BE=D0=B9=20=D1=81?= =?UTF-8?q?=D0=B8=D1=81=D1=82=D0=B5=D0=BC=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cores/arduino/mik32/shared/runtime/crt0.S | 5 ++--- libraries/FreeRTOS/src/portASM.S | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cores/arduino/mik32/shared/runtime/crt0.S b/cores/arduino/mik32/shared/runtime/crt0.S index de2ec06..e4185cd 100644 --- a/cores/arduino/mik32/shared/runtime/crt0.S +++ b/cores/arduino/mik32/shared/runtime/crt0.S @@ -112,10 +112,9 @@ SystemInit: .section .trap_text, "ax" // .org should be consistent with // default mtvec value (set in scr1_arch_description.svh) -//.org 0xC0 +//.org 0xC0 trap_entry: - //j raw_trap_handler - j freertos_risc_v_trap_handler + j raw_trap_handler raw_trap_handler: // Save registers diff --git a/libraries/FreeRTOS/src/portASM.S b/libraries/FreeRTOS/src/portASM.S index bd10105..c9a06f1 100644 --- a/libraries/FreeRTOS/src/portASM.S +++ b/libraries/FreeRTOS/src/portASM.S @@ -81,10 +81,10 @@ definitions. */ .global xPortStartFirstTask .global pxPortInitialiseStack -.global freertos_risc_v_trap_handler .global freertos_risc_v_exception_handler .global freertos_risc_v_interrupt_handler .global freertos_risc_v_mtimer_interrupt_handler +.global raw_trap_handler .extern vTaskSwitchContext .extern xTaskIncrementTick @@ -329,7 +329,7 @@ exit_without_context_switch: .section .ram_text .align 8 -freertos_risc_v_trap_handler: +raw_trap_handler: /*Intercept trap from weak function from crt0.s*/ portcontextSAVE_CONTEXT_INTERNAL csrr a0, mcause @@ -358,7 +358,6 @@ handle_interrupt: bne a0, t1, application_interrupt_handler portUPDATE_MTIMER_COMPARE_REGISTER - call toggleTestPin call xTaskIncrementTick beqz a0, processed_source /* Don't switch context if incrementing tick didn't unblock a task. */ call vTaskSwitchContext