<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>S32KのトピックRe: how to use the printf function in S32DS.3.5 ?</title>
    <link>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1725486#M27200</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you need to implement the _write function which is called by printf at the end for example like this:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;int _write(int file, char *ptr, int len)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int i;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; file = file;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i = 0; i &amp;lt; len; i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_PutByte(*ptr++);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return len;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Instead UART_PutByte you can use something like UART_Send(buffer,len), but the implementation is up to you. You can re-use uart send code from an existing RTD example.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Anyway, the STD C printf&amp;nbsp; is pretty complex and even for "hello word"&amp;nbsp; message it uses a lot of instructions. In my opinion - If you like to send some simple status/log messages it is better implement your own print which directly sends buffer into uart.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Sep 2023 11:19:00 GMT</pubDate>
    <dc:creator>jiri_kral</dc:creator>
    <dc:date>2023-09-19T11:19:00Z</dc:date>
    <item>
      <title>how to use the printf function in S32DS.3.5 ?</title>
      <link>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1721867#M27023</link>
      <description>&lt;P&gt;Hi nxp community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use the printf funcrtion in S32S.3.5 but i con't see results "hello world" at the console or terminal. so far i can not see results whenever i run the code. is there a special configuration required to use this function ? i am using the GBD SEGGER J-Link Debugging line and SWD.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gama_0-1694594498623.png" style="width: 671px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240771iA4495BA17620018F/image-dimensions/671x420?v=v2" width="671" height="420" role="button" title="Gama_0-1694594498623.png" alt="Gama_0-1694594498623.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;#S32DS #printf &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/159987"&gt;@jiri_kral&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 08:45:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1721867#M27023</guid>
      <dc:creator>Gama</dc:creator>
      <dc:date>2023-09-13T08:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to use the printf function in S32DS.3.5 ?</title>
      <link>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1721940#M27031</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;easiest way is enable semihosting console. Anyway, what's your target device and debugger?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jiri_kral_0-1694598302706.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240782i4B8C4F198BCB8E76/image-size/large?v=v2&amp;amp;px=999" role="button" title="jiri_kral_0-1694598302706.png" alt="jiri_kral_0-1694598302706.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jiri_kral_1-1694598603541.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240783i78648E5CB63EA298/image-size/large?v=v2&amp;amp;px=999" role="button" title="jiri_kral_1-1694598603541.png" alt="jiri_kral_1-1694598603541.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jiri_kral_2-1694598849018.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240785i5FB8735D0C28B780/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jiri_kral_2-1694598849018.png" alt="jiri_kral_2-1694598849018.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 09:54:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1721940#M27031</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2023-09-13T09:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to use the printf function in S32DS.3.5 ?</title>
      <link>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1721950#M27032</link>
      <description>&lt;P&gt;My target device is S32K144 and I am using a GBD SEGGER J-Link Debugging line to SWD.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gama_0-1694601281253.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240787iB64BA02D92042C11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gama_0-1694601281253.png" alt="Gama_0-1694601281253.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have enable semihosting as you suggested but no print showing .&lt;/P&gt;&lt;P&gt;here&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gama_2-1694601756886.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240790i5F2F85850C6DE8DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gama_2-1694601756886.png" alt="Gama_2-1694601756886.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;after build and flash no results .&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gama_1-1694601713460.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240789i255C433EE73F8D6F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gama_1-1694601713460.png" alt="Gama_1-1694601713460.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 10:43:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1721950#M27032</guid>
      <dc:creator>Gama</dc:creator>
      <dc:date>2023-09-13T10:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to use the printf function in S32DS.3.5 ?</title>
      <link>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1721971#M27034</link>
      <description>&lt;P&gt;Did you switched to semihosting console? On your screenshot is shown debugger console:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jiri_kral_0-1694602204097.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240794i55A123F8FEBFE00E/image-size/large?v=v2&amp;amp;px=999" role="button" title="jiri_kral_0-1694602204097.png" alt="jiri_kral_0-1694602204097.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 10:50:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1721971#M27034</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2023-09-13T10:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to use the printf function in S32DS.3.5 ?</title>
      <link>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1722681#M27070</link>
      <description>&lt;P&gt;I have switch to the console but no results yet.&amp;nbsp; just to let you know I'm using a JTAG 20pin connection.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gama_0-1694660463186.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240921i6709040CB69B8860/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gama_0-1694660463186.png" alt="Gama_0-1694660463186.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 03:03:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1722681#M27070</guid>
      <dc:creator>Gama</dc:creator>
      <dc:date>2023-09-14T03:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to use the printf function in S32DS.3.5 ?</title>
      <link>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1723001#M27082</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/159987"&gt;@jiri_kral&lt;/a&gt;&amp;nbsp;sorry for so many questions, I'm really new to the S32D IDE.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to try using the UART port instead since for the printf, because I want to send messages over UART for my project. I have a USB serial on my board, I want to try the [S32K1 AUTOSAR 4.4 RTD 1.0.1 D2202 Example Projects] example name is [Uart_Example_S32K144]. But so far I have some issues with the Port_ci_Port_lp_Cfg files. I can't change the PIN based on my board. I want to use Pin PTC6 as RX and Pin PTC7 as Tx. But I'm having problems as shown below..How can I change the pins? or what am I missing?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which of the following headers can I use to configure the Pins&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;/* User includes */&lt;/DIV&gt;&lt;DIV&gt;#include "Mcl.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Mcu.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Uart.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Port.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Platform.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Lpuart_Uart_Ip_Irq.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Flexio_Uart_Ip_Irq.h"&lt;/DIV&gt;&lt;DIV&gt;#include "check_example.h"&lt;/DIV&gt;&lt;DIV&gt;#include &amp;lt;string.h&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Bellow Is my example main.c code.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;"''''''''''''''''''''''''''''''''''''''''''''''&lt;/P&gt;&lt;DIV&gt;/*&lt;/DIV&gt;&lt;DIV&gt;*&amp;nbsp; &amp;nbsp;(c) Copyright 2021 NXP&lt;/DIV&gt;&lt;DIV&gt;*/&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/* User includes */&lt;/DIV&gt;&lt;DIV&gt;#include "Mcl.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Mcu.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Uart.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Port.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Platform.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Lpuart_Uart_Ip_Irq.h"&lt;/DIV&gt;&lt;DIV&gt;#include "Flexio_Uart_Ip_Irq.h"&lt;/DIV&gt;&lt;DIV&gt;#include "check_example.h"&lt;/DIV&gt;&lt;DIV&gt;#include &amp;lt;string.h&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;#include "stdio.h"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;#define UART_LPUART_INTERNAL_CHANNEL&amp;nbsp; 0U&lt;/DIV&gt;&lt;DIV&gt;#define UART_FLEXIO_RX_CHANNEL&amp;nbsp; 1U&lt;/DIV&gt;&lt;DIV&gt;#define UART_FLEXIO_TX_CHANNEL&amp;nbsp; 2U&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/* Welcome messages displayed at the console */&lt;/DIV&gt;&lt;DIV&gt;#define WELCOME_MSG_1 "Hello, This message is sent via Uart!\r\n"&lt;/DIV&gt;&lt;DIV&gt;#define WELCOME_MSG_2 "Have a nice day!\r\n"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/* Error message displayed at the console, in case data is received erroneously */&lt;/DIV&gt;&lt;DIV&gt;#define ERROR_MSG "An error occurred! The application will stop!\r\n"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/* Length of the message to be received from the console */&lt;/DIV&gt;&lt;DIV&gt;#define MSG_LEN&amp;nbsp; 50U&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;boolean User_Str_Cmp(const uint8 * pBuffer1, const uint8 * pBuffer2, const uint32 length)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32 idx = 0;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; for (idx = 0; idx &amp;lt; length; idx++)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(pBuffer1[idx] != pBuffer2[idx])&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return FALSE;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return TRUE;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Std_ReturnType Send_Data(uint8 transChannel, uint8 recvChannel, const uint8* pBuffer, uint32 length)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; volatile Std_ReturnType T_Uart_Status;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; volatile Uart_StatusType Uart_ReceiveStatus = UART_STATUS_TIMEOUT;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; volatile Uart_StatusType Uart_TransmitStatus = UART_STATUS_TIMEOUT;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32 T_bytesRemaining;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32 T_timeout = 0xFFFFFF;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint8 Rx_Buffer[MSG_LEN];&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; /* Uart_AsyncReceive transmit data */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; T_Uart_Status = Uart_AsyncReceive(recvChannel, Rx_Buffer, length);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if (E_OK != T_Uart_Status)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return E_NOT_OK;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; /* Uart_AsyncSend transmit data */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; T_Uart_Status = Uart_AsyncSend(transChannel, pBuffer, length);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if (E_OK != T_Uart_Status)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return E_NOT_OK;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; /* Check for no on-going transmission */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; do&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Uart_TransmitStatus = Uart_GetStatus(transChannel, &amp;amp;T_bytesRemaining, UART_SEND);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; } while (UART_STATUS_NO_ERROR != Uart_TransmitStatus &amp;amp;&amp;amp; 0 &amp;lt; T_timeout--);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; T_timeout = 0xFFFFFF;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; do&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Uart_ReceiveStatus = Uart_GetStatus(recvChannel, &amp;amp;T_bytesRemaining, UART_RECEIVE);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; } while (UART_STATUS_NO_ERROR != Uart_ReceiveStatus &amp;amp;&amp;amp; 0 &amp;lt; T_timeout--);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if ((UART_STATUS_NO_ERROR != Uart_TransmitStatus) || (UART_STATUS_NO_ERROR != Uart_ReceiveStatus))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return E_NOT_OK;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if(User_Str_Cmp(pBuffer, (const uint8 *)Rx_Buffer, length) == FALSE)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return E_NOT_OK;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return E_OK;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/*!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; \brief The main function for the project.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; \details The startup initialization sequence is the following:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;* - startup asm routine&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;* - main()&lt;/DIV&gt;&lt;DIV&gt;*/&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;int main(void)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;printf("hello world! \n ");&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; volatile Std_ReturnType T_Uart_Status1;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; volatile Std_ReturnType T_Uart_Status2;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; /* Initialize the Mcu driver */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Mcu_Init(NULL_PTR);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Mcu_InitClock(McuClockSettingConfig_0);&lt;/DIV&gt;&lt;DIV&gt;#if (MCU_NO_PLL == STD_OFF)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; while ( MCU_PLL_LOCKED != Mcu_GetPllStatus() )&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Busy wait until the System PLL is locked */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Mcu_DistributePllClock();&lt;/DIV&gt;&lt;DIV&gt;#endif&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Mcu_SetMode(McuModeSettingConf_0);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; /* Initialize Mcl module */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Mcl_Init(NULL_PTR);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; /* Initialize all pins using the Port driver */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Port_Init(NULL_PTR);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; /* Initialize IRQs */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Platform_Init(NULL_PTR);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Platform_InstallIrqHandler(LPUART0_RxTx_IRQn, LPUART_UART_IP_0_IRQHandler, NULL_PTR);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Platform_InstallIrqHandler(FLEXIO_IRQn, MCL_FLEXIO_ISR, NULL_PTR);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; /* Initializes an UART driver*/&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Uart_Init(NULL_PTR);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; /* Send greeting string 1 from Flexio_0_Tx to Lpuart_0 */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; T_Uart_Status1 = Send_Data(UART_FLEXIO_TX_CHANNEL, UART_LPUART_INTERNAL_CHANNEL, (const uint8 *)WELCOME_MSG_1, strlen(WELCOME_MSG_1));&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; /* Send greeting string 2 from Lpuart_0 to Flexio_1_Rx */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; T_Uart_Status2 = Send_Data(UART_LPUART_INTERNAL_CHANNEL, UART_FLEXIO_RX_CHANNEL, (const uint8 *)WELCOME_MSG_2, strlen(WELCOME_MSG_2));&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Uart_Deinit();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Mcl_DeInit();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Exit_Example((T_Uart_Status1 == E_OK) &amp;amp;&amp;amp; (T_Uart_Status2 == E_OK));&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return (0U);&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/** @} */&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;''''''''''''''''''''''''''''''''''''''''''''&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 10:16:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1723001#M27082</guid>
      <dc:creator>Gama</dc:creator>
      <dc:date>2023-09-14T10:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to use the printf function in S32DS.3.5 ?</title>
      <link>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1725486#M27200</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you need to implement the _write function which is called by printf at the end for example like this:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;int _write(int file, char *ptr, int len)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int i;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; file = file;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i = 0; i &amp;lt; len; i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_PutByte(*ptr++);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return len;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Instead UART_PutByte you can use something like UART_Send(buffer,len), but the implementation is up to you. You can re-use uart send code from an existing RTD example.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Anyway, the STD C printf&amp;nbsp; is pretty complex and even for "hello word"&amp;nbsp; message it uses a lot of instructions. In my opinion - If you like to send some simple status/log messages it is better implement your own print which directly sends buffer into uart.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 11:19:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/how-to-use-the-printf-function-in-S32DS-3-5/m-p/1725486#M27200</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2023-09-19T11:19:00Z</dc:date>
    </item>
  </channel>
</rss>

