перенесла обработчик прерывания от freeRTOS в рамку и сделала переход на него через j в trap_entry, теперь как будто заработало. Блинк работает, но analogRead очень тормозит почему-то

This commit is contained in:
klassents committed 2025-03-25 17:01:14 +07:00
1 parent b28f4ee090
commit 2a32262053
3 files changed
+6 -7

No files matched your search

+2 -4
View File
@@ -112,11 +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 //j raw_trap_handler
trap_entry: trap_entry:
// j raw_trap_handler j freertos_risc_v_trap_handler
la t0, freertos_risc_v_trap_handler
jalr t0
raw_trap_handler: raw_trap_handler:
// Save registers // Save registers
+2 -2
View File
@@ -47,8 +47,8 @@ extern "C" {
/* Set the stack depth type to be uint16_t, otherwise it defaults to StackType_t */ /* Set the stack depth type to be uint16_t, otherwise it defaults to StackType_t */
#define configSTACK_DEPTH_TYPE uint16_t #define configSTACK_DEPTH_TYPE uint16_t
#define configMINIMAL_STACK_SIZE 192 #define configMINIMAL_STACK_SIZE 256
#define configISR_STACK_SIZE_WORDS 128 // todo сколько надо? // #define configISR_STACK_SIZE_WORDS 128 // todo сколько надо?
#define configCHECK_FOR_STACK_OVERFLOW 1 #define configCHECK_FOR_STACK_OVERFLOW 1
#define configUSE_TRACE_FACILITY 0 #define configUSE_TRACE_FACILITY 0
+2 -1
View File
@@ -326,7 +326,7 @@ exit_without_context_switch:
portcontextRESTORE_CONTEXT portcontextRESTORE_CONTEXT
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
.section .text.freertos_risc_v_trap_handler .section .ram_text
.align 8 .align 8
freertos_risc_v_trap_handler: freertos_risc_v_trap_handler:
portcontextSAVE_CONTEXT_INTERNAL portcontextSAVE_CONTEXT_INTERNAL
@@ -357,6 +357,7 @@ 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