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 ?
解決済! 解決策の投稿を見る。
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
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
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?
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:
Regards,
Lukas