Hi,
I’m working with a RiscV CPU with FreeRTOS (esp32c3). I’m trying to understand what is happening in context switching.
Code: esp idf code on github
components/freertos/FreeRTOS-Kernel/portable/riscv/port.c
I found the followings
Call hierarchy for ‘create the task’
xTaskCreatePinnedToCore
prvInitialiseNewTask
pxPortInitialiseStack
uxInitialiseStackFrame (vPortTaskWrapper): this is the main_task. Im trying to
figure out how the main_task code will be called
Call hierarchy for ‘scheduler call’
vTaskStartScheduler
xPortStartScheduler
vPortYield
esp_crosscore_int_send_yield: this will send the crosscore IT
ISR will be : crosscore IT
uxInitialiseStackFrame adds a new stack frame to the stack top
But who will POP and how will the code executed? ISR has own handling routine.