Search code examples
timerfreertosinterrupt-handlingrtos

FreeRTOS Systick Handler


I'm studying the FreeRTOS scheduler (port.c) and have a question about Systick handler. I understand xPortSysTickHandler() is supposed to be called at RTOS ticks, but I don't see where it gets specified by saying xPortSysTickHandler() is the Systick timer interrupt callback function.

Especially, I didn't see that in vPortSetupTimerInterrupt(), which seems a bit strange to me since this function does configure, such as load register value, of the timer.

Does it gets specified as the callback somewhere else? Or is there something I'm missing?

Thanks!


Solution

  • It is installed directly into the interrupt vector table. If the vector table uses CMSIS names for the handlers then you can map the CMSIS name to the name of the FreeRTOS systick handler in FreeRTOSConfig.h, as per the FAQ - see the red "special note to ARM Cortex-M users" here: https://www.freertos.org/FAQHelp.html