Initially my code stuck at that point configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );?

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

Initially my code stuck at that point configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );?

Jump to solution
6,040 Views
shivamshankarg
Contributor III

I was just using an ISR for a FreeRTOS task, initially it was not working fine because I have not set the priority for the ISR, it was my be in default priority, so while debugging what i found it is always stuck at this line
configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );

so I just saw in my RTOS, my MaxSysCallPriority is already set to 1, which can be (1 to 15).

so I manually set the ISR priority to 3

 INT_SYS_SetPriority(BTN_PORT_IRQn, 3); 


then it was working fine but I am very confused about this as S32 Design studio It shows MaxSysCallPriority is a maximum priority which can provide to our ISR. 

QUES1. so why we need to put grater than MaxSysCallPriority to work it perfectly.
QUES2. And what is the by default priority of an ISR lets say I am using S32K144 EVB and taking interrupt from button which is connected in port c.

1 Solution
5,946 Views
ErichStyger
Senior Contributor V

I recommend you have a read at the following article series which

ARM Cortex-M, Interrupts and FreeRTOS: Part 1 | MCU on Eclipse 

ARM Cortex-M, Interrupts and FreeRTOS: Part 2 | MCU on Eclipse 

ARM Cortex-M Interrupts and FreeRTOS: Part 3 | MCU on Eclipse 

Especially Part 3 explains how the RTOS creates critcal sections and the separation of interrupts and RTOS API calls:

https://mcuoneclipse.files.wordpress.com/2016/08/freertos-and-interrupts.png?w=584&h=312 

I hope this helps,

Erich

View solution in original post

1 Reply
5,947 Views
ErichStyger
Senior Contributor V

I recommend you have a read at the following article series which

ARM Cortex-M, Interrupts and FreeRTOS: Part 1 | MCU on Eclipse 

ARM Cortex-M, Interrupts and FreeRTOS: Part 2 | MCU on Eclipse 

ARM Cortex-M Interrupts and FreeRTOS: Part 3 | MCU on Eclipse 

Especially Part 3 explains how the RTOS creates critcal sections and the separation of interrupts and RTOS API calls:

https://mcuoneclipse.files.wordpress.com/2016/08/freertos-and-interrupts.png?w=584&h=312 

I hope this helps,

Erich