Interrupt in FreeRTOS for S32K144

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Interrupt in FreeRTOS for S32K144

ソリューションへジャンプ
2,814件の閲覧回数
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 件の賞賛
返信
1 解決策
2,801件の閲覧回数
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

元の投稿で解決策を見る

3 返答(返信)
2,802件の閲覧回数
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,775件の閲覧回数
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 件の賞賛
返信
2,744件の閲覧回数
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 件の賞賛
返信