сильную raw_trap_handler объявила во freeRTOS, чтобы trap перехватывался операционной системой
This commit is contained in:
parent
6f84c00718
commit
f2ab0fc367
@ -112,10 +112,9 @@ SystemInit:
|
|||||||
.section .trap_text, "ax"
|
.section .trap_text, "ax"
|
||||||
// .org should be consistent with
|
// .org should be consistent with
|
||||||
// default mtvec value (set in scr1_arch_description.svh)
|
// default mtvec value (set in scr1_arch_description.svh)
|
||||||
//.org 0xC0
|
//.org 0xC0
|
||||||
trap_entry:
|
trap_entry:
|
||||||
//j raw_trap_handler
|
j raw_trap_handler
|
||||||
j freertos_risc_v_trap_handler
|
|
||||||
|
|
||||||
raw_trap_handler:
|
raw_trap_handler:
|
||||||
// Save registers
|
// Save registers
|
||||||
|
|||||||
@ -81,10 +81,10 @@ definitions. */
|
|||||||
|
|
||||||
.global xPortStartFirstTask
|
.global xPortStartFirstTask
|
||||||
.global pxPortInitialiseStack
|
.global pxPortInitialiseStack
|
||||||
.global freertos_risc_v_trap_handler
|
|
||||||
.global freertos_risc_v_exception_handler
|
.global freertos_risc_v_exception_handler
|
||||||
.global freertos_risc_v_interrupt_handler
|
.global freertos_risc_v_interrupt_handler
|
||||||
.global freertos_risc_v_mtimer_interrupt_handler
|
.global freertos_risc_v_mtimer_interrupt_handler
|
||||||
|
.global raw_trap_handler
|
||||||
|
|
||||||
.extern vTaskSwitchContext
|
.extern vTaskSwitchContext
|
||||||
.extern xTaskIncrementTick
|
.extern xTaskIncrementTick
|
||||||
@ -329,7 +329,7 @@ exit_without_context_switch:
|
|||||||
|
|
||||||
.section .ram_text
|
.section .ram_text
|
||||||
.align 8
|
.align 8
|
||||||
freertos_risc_v_trap_handler:
|
raw_trap_handler: /*Intercept trap from weak function from crt0.s*/
|
||||||
portcontextSAVE_CONTEXT_INTERNAL
|
portcontextSAVE_CONTEXT_INTERNAL
|
||||||
|
|
||||||
csrr a0, mcause
|
csrr a0, mcause
|
||||||
@ -358,7 +358,6 @@ handle_interrupt:
|
|||||||
bne a0, t1, application_interrupt_handler
|
bne a0, t1, application_interrupt_handler
|
||||||
|
|
||||||
portUPDATE_MTIMER_COMPARE_REGISTER
|
portUPDATE_MTIMER_COMPARE_REGISTER
|
||||||
call toggleTestPin
|
|
||||||
call xTaskIncrementTick
|
call xTaskIncrementTick
|
||||||
beqz a0, processed_source /* Don't switch context if incrementing tick didn't unblock a task. */
|
beqz a0, processed_source /* Don't switch context if incrementing tick didn't unblock a task. */
|
||||||
call vTaskSwitchContext
|
call vTaskSwitchContext
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user