How to configure interrupt priorities when using freertos for s32k142

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to configure interrupt priorities when using freertos for s32k142

Jump to solution
769 Views
elb1
Contributor III

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 ?

0 Kudos
1 Solution
725 Views
elb1
Contributor III

Hello, I have found already an example for freertos for my microcontroller, so no need to answer this.
Thank you.

View solution in original post

0 Kudos
2 Replies
716 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

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

0 Kudos
726 Views
elb1
Contributor III

Hello, I have found already an example for freertos for my microcontroller, so no need to answer this.
Thank you.

0 Kudos