Добавлена поддержка FreeRTOS #16

Merged
klassents merged 23 commits from v0.5.0_FreeRTOS into v0.5.0 2025-03-28 06:37:51 +03:00
5 changed files with 9 additions and 8 deletions
Showing only changes of commit 42e9becdb9 - Show all commits

View File

@ -123,6 +123,7 @@ SECTIONS {
PROVIDE(__STACK_START__ = .);
. += STACK_SIZE;
PROVIDE(__C_STACK_TOP__ = .);
PROVIDE(__freertos_irq_stack_top = .);
PROVIDE(__STACK_END__ = .);
} >ram

View File

@ -112,8 +112,9 @@ SystemInit:
.section .trap_text, "ax"
// .org should be consistent with
// default mtvec value (set in scr1_arch_description.svh)
//.org 0xC0 //j raw_trap_handler
//.org 0xC0
trap_entry:
//j raw_trap_handler
j freertos_risc_v_trap_handler
raw_trap_handler:

View File

@ -42,12 +42,12 @@ extern "C" {
#define configMAX_PRIORITIES 4
#define configMAX_TASK_NAME_LEN 16
#define configTOTAL_HEAP_SIZE ( ( size_t ) 3*1024 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 5*1024 )
/* 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 256
#define configMINIMAL_STACK_SIZE 192
// #define configISR_STACK_SIZE_WORDS 128 // todo сколько надо?
#define configCHECK_FOR_STACK_OVERFLOW 1
#define configUSE_TRACE_FACILITY 0
@ -122,5 +122,4 @@ to exclude the API function. */
#endif
#endif
#endif /* FREERTOS_CONFIG_H */

View File

@ -92,6 +92,7 @@ definitions. */
.extern pullNextTime
.extern uxTimerIncrementsForOneTick /* size_t type so 32-bit on 32-bit core and 64-bits on 64-bit core. */
.extern xTaskReturnAddress
.extern trap_handler
.weak freertos_risc_v_application_exception_handler
.weak freertos_risc_v_application_interrupt_handler
@ -366,7 +367,7 @@ handle_interrupt:
#endif /* portasmHAS_MTIME */
application_interrupt_handler:
call freertos_risc_v_application_interrupt_handler
call trap_handler
j processed_source
handle_exception:

View File

@ -38,10 +38,9 @@ extern void loop(void);
/*-----------------------------------------------------------*/
void initVariant(void) __attribute__((used, retain)); // todo удалить лишний атрибут?
void initVariant(void)
void initVariant(void) // todo удалить
{
initTestPin();
setup(); // the normal Arduino setup() function is run here.
post_init();
vTaskStartScheduler(); // initialise and run the freeRTOS scheduler. Execution should never return here.