Hello all, I am using freertos for s32k142 microcontroller, all the tasks are working fine, and i want now to implement gpio interrupt, but I am really confused on how to configure priorities.
What numbers i can give to these macros (configKERNEL_INTERRUPT_PRIORITY and configMAX_SYSCALL_INTERRUPT_PRIORITY) from freeRtosConfig.h ?
I have read what is in this link "https://forums.freertos.org/t/freertos-interrupt-priorities-vs-mcu-interrupt-priorities/16345" but they say that it is microcontroller specific, can anyone help me where i can find that information for s32k142, or some example ?
已解决! 转到解答。
Hi @elb1
maybe for others:
S32K1 devices have 4 priority bits -> 16 priority levels.
As mentioned in these articles:
https://www.freertos.org/a00110.html#kernel_priority
https://www.freertos.org/RTOS-Cortex-M3-M4.html
... configKERNEL_INTERRUPT_PRIORITY should be set to the lowest interrupt priority, i.e. to 0xF.
About configMAX_SYSCALL_INTERRUPT_PRIORITY:
"The RTOS interrupt nesting scheme splits the available interrupt priorities into two groups - those that will get masked by RTOS critical sections, and those that are never masked by RTOS critical sections and are therefore always enabled. The configMAX_SYSCALL_INTERRUPT_PRIORITY setting in FreeRTOSConfig.h defines the boundary between the two groups. The optimal value for this setting will depend on the number of priority bits implemented in the microcontroller."
configMAX_SYSCALL_INTERRUPT_PRIORITY is set to 1 by default in our sample projects.
Regards,
Lukas