сильную raw_trap_handler объявила во freeRTOS, чтобы trap перехватывался операционной системой

This commit is contained in:
KLASSENTS 2025-03-27 10:32:10 +07:00
parent 6f84c00718
commit f2ab0fc367
2 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -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