Interrupt in FreeRTOS for S32K144

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

Interrupt in FreeRTOS for S32K144

Jump to solution
3,031 Views
AnhNguyenDuc
NXP Employee
NXP Employee

I have a project using UART interrupt like this(pseudo code):

main(){

setPriority(UART, 7);

wait_tx();

func1();

};

Run this project, I can reach func1(). Then I import FreeRTOS into my project (with default configuration), then I stuck at wait_tx(). Then I try to change configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY from (0x01) (default) to (0x09) (bigger than Uart's priority) then I can reach func1(). I see that: configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY use to configure to call FreeRTOS API from ISR. But in my UART interrupt function I dont use any FreeRTOS API. What is my problem ?

 

0 Kudos
Reply
1 Solution
3,018 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

as mentioned in this article:

https://www.freertos.org/RTOS-Cortex-M3-M4.html

"...any interrupt service routine that uses an RTOS API function must have its priority manually set to a value that is numerically equal to or greater than the configMAX_SYSCALL_INTERRUPT_PRIORITY setting."

LPUART driver uses OSIF. If there's no freertos in your project, baremetal version of OSIF is used. Once you add freertos, freertos version of OSIF is used. So, the condition above should be met.

I guess that this could be the reason.

Regards,

Lukas

View solution in original post

3 Replies
3,019 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

as mentioned in this article:

https://www.freertos.org/RTOS-Cortex-M3-M4.html

"...any interrupt service routine that uses an RTOS API function must have its priority manually set to a value that is numerically equal to or greater than the configMAX_SYSCALL_INTERRUPT_PRIORITY setting."

LPUART driver uses OSIF. If there's no freertos in your project, baremetal version of OSIF is used. Once you add freertos, freertos version of OSIF is used. So, the condition above should be met.

I guess that this could be the reason.

Regards,

Lukas

2,992 Views
AnhNguyenDuc
NXP Employee
NXP Employee

Thank you. So, When I create a project on SDK and use LPUART, will LPUART use OSIF by default?. Can you explain more about this point or share a document about it?

0 Kudos
Reply
2,961 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Some details about the OSIF can be found in the user manual:

c:\NXP\S32DS.3.4\S32DS\software\S32SDK_S32K1XX_RTM_4.0.2\doc\S32SDK_S32K144_UserManual.pdf

Or take a look at the source code of LPUART driver to see how it is implemented. It's used for timeouts, for example:

lukaszadrapa_0-1641798136264.png

Regards,

Lukas

0 Kudos
Reply