MCAL printf() statements

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

MCAL printf() statements

Jump to solution
993 Views
talha_uyar
Contributor III

Is there a possible way to utilize the printf() functionality with MCAL, say for the Sample Application. One solution would be to set up a UART and communicate through PuTTY, for instance. Is there an easier more straight-forward way?

Thanks for the answers,

Talha Uyar

Edit: Also, is there a UART driver for the MCAL. If there is how can I set it up?

Edit 2: I set up the LPUART0 for OpenSDA virtual terminal and it is working. However, I don't think writing directly to LPUART0->BAUD and LPUART0->CTRL is good practice for Autosar applications. However, as far as I can see, there is no configuration available through Tresos. Will there be a UART module in MCAL in the future?

Tags (2)
0 Kudos
1 Solution
895 Views
namnguyenviet
NXP Employee
NXP Employee

Hi talha.uyar@karel.com.tr

Is there a possible way to utilize the printf() functionality with MCAL, say for the Sample Application. One solution would be to set up a UART and communicate through PuTTY, for instance. Is there an easier more straight-forward way?

In the sample application, there are functions for initialize and setup the uart communication. By default, these functions are enabled, so basically you can use the marco CONSOLE_LOG to send the uart message.

Edit: Also, is there a UART driver for the MCAL. If there is how can I set it up?

Unfortunately, UART driver is not available for the MCAL and AUTOSAR itself.

Edit 2: I set up the LPUART0 for OpenSDA virtual terminal and it is working. However, I don't think writing directly to LPUART0->BAUD and LPUART0->CTRL is good practice for Autosar applications. However, as far as I can see, there is no configuration available through Tresos. Will there be a UART module in MCAL in the future?

In S32K1 platform, there is AUTOSAR LIN driver which use LPUART as the hardware peripheral. So you might need to make sure that the hardware peripheral is not conflict, i.e., in case of you use both LIN driver and LPUART as uart communication. Otherwise, you can freely writing directly to the registers in your ASR application. 

I have no idea if UART module will be available in MCAL in the future. 

Best Regards,

Nam

View solution in original post

0 Kudos
1 Reply
896 Views
namnguyenviet
NXP Employee
NXP Employee

Hi talha.uyar@karel.com.tr

Is there a possible way to utilize the printf() functionality with MCAL, say for the Sample Application. One solution would be to set up a UART and communicate through PuTTY, for instance. Is there an easier more straight-forward way?

In the sample application, there are functions for initialize and setup the uart communication. By default, these functions are enabled, so basically you can use the marco CONSOLE_LOG to send the uart message.

Edit: Also, is there a UART driver for the MCAL. If there is how can I set it up?

Unfortunately, UART driver is not available for the MCAL and AUTOSAR itself.

Edit 2: I set up the LPUART0 for OpenSDA virtual terminal and it is working. However, I don't think writing directly to LPUART0->BAUD and LPUART0->CTRL is good practice for Autosar applications. However, as far as I can see, there is no configuration available through Tresos. Will there be a UART module in MCAL in the future?

In S32K1 platform, there is AUTOSAR LIN driver which use LPUART as the hardware peripheral. So you might need to make sure that the hardware peripheral is not conflict, i.e., in case of you use both LIN driver and LPUART as uart communication. Otherwise, you can freely writing directly to the registers in your ASR application. 

I have no idea if UART module will be available in MCAL in the future. 

Best Regards,

Nam

0 Kudos