diff --git a/cores/arduino/mik32/shared/runtime/crt0.S b/cores/arduino/mik32/shared/runtime/crt0.S index 3730d85..ee9d26f 100644 --- a/cores/arduino/mik32/shared/runtime/crt0.S +++ b/cores/arduino/mik32/shared/runtime/crt0.S @@ -112,11 +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 //j raw_trap_handler trap_entry: - // j raw_trap_handler - la t0, freertos_risc_v_trap_handler - jalr t0 + j freertos_risc_v_trap_handler raw_trap_handler: // Save registers diff --git a/libraries/FreeRTOS/src/FreeRTOSConfig.h b/libraries/FreeRTOS/src/FreeRTOSConfig.h index 980fb77..e3ba88a 100644 --- a/libraries/FreeRTOS/src/FreeRTOSConfig.h +++ b/libraries/FreeRTOS/src/FreeRTOSConfig.h @@ -47,8 +47,8 @@ extern "C" { /* Set the stack depth type to be uint16_t, otherwise it defaults to StackType_t */ #define configSTACK_DEPTH_TYPE uint16_t -#define configMINIMAL_STACK_SIZE 192 -#define configISR_STACK_SIZE_WORDS 128 // todo сколько надо? +#define configMINIMAL_STACK_SIZE 256 +// #define configISR_STACK_SIZE_WORDS 128 // todo сколько надо? #define configCHECK_FOR_STACK_OVERFLOW 1 #define configUSE_TRACE_FACILITY 0 diff --git a/libraries/FreeRTOS/src/portASM.S b/libraries/FreeRTOS/src/portASM.S index 1b785dc..8298232 100644 --- a/libraries/FreeRTOS/src/portASM.S +++ b/libraries/FreeRTOS/src/portASM.S @@ -116,7 +116,7 @@ definitions. */ add t2, a3, t1 /* Add overflow to high word of ullNextTime. */ sw a4, 0(a1) /* Store new low word of ullNextTime. */ sw t2, 4(a1) /* Store new high word of ullNextTime. */ - + #endif /* __riscv_xlen == 32 */ #if( __riscv_xlen == 64 ) @@ -326,7 +326,7 @@ exit_without_context_switch: portcontextRESTORE_CONTEXT /*-----------------------------------------------------------*/ -.section .text.freertos_risc_v_trap_handler +.section .ram_text .align 8 freertos_risc_v_trap_handler: portcontextSAVE_CONTEXT_INTERNAL @@ -357,6 +357,7 @@ 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