<?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>topic S32K1xx LPUART IntCtrl_IP callback function Implement in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2039874#M45693</link>
    <description>&lt;P&gt;Hello NXP Team,&lt;/P&gt;&lt;P&gt;I'm modifying the UART example from S32K1 AUTOSAR R21-11 RTD 2.0.0 P04 D2404 Example Project and want to add a UART RX interrupt callback function.&lt;/P&gt;&lt;P&gt;Currently, I'm using IntCtrl_IP to add the callback function, but it's not working.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UART_IntCTRL_IP.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/322880i83F3531A5DD34EAE/image-size/large?v=v2&amp;amp;px=999" role="button" title="UART_IntCTRL_IP.png" alt="UART_IntCTRL_IP.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is my LPUART0_ISR function&lt;/P&gt;&lt;DIV&gt;void LPUART0_ISR()&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; const char* pBuffer = "LPUART0_ISR\r\n";&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; volatile Lpuart_Uart_Ip_StatusType lpuartStatus = LPUART_UART_IP_STATUS_ERROR;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32 T_timeout = 0xFFFFFF;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32 remainingBytes;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; Lpuart_Uart_Ip_AsyncSend(UART_LPUART_INTERNAL_CHANNEL, pBuffer, strlen(pBuffer));&lt;/SPAN&gt;&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; lpuartStatus = Lpuart_Uart_Ip_GetTransmitStatus(UART_LPUART_INTERNAL_CHANNEL, &amp;amp;remainingBytes);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; } while (LPUART_UART_IP_STATUS_BUSY == lpuartStatus &amp;amp;&amp;amp; 0 &amp;lt; T_timeout--);&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or is there any sample code I can refer to?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2025 09:51:50 GMT</pubDate>
    <dc:creator>Pohsuan</dc:creator>
    <dc:date>2025-02-07T09:51:50Z</dc:date>
    <item>
      <title>S32K1xx LPUART IntCtrl_IP callback function Implement</title>
      <link>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2039874#M45693</link>
      <description>&lt;P&gt;Hello NXP Team,&lt;/P&gt;&lt;P&gt;I'm modifying the UART example from S32K1 AUTOSAR R21-11 RTD 2.0.0 P04 D2404 Example Project and want to add a UART RX interrupt callback function.&lt;/P&gt;&lt;P&gt;Currently, I'm using IntCtrl_IP to add the callback function, but it's not working.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UART_IntCTRL_IP.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/322880i83F3531A5DD34EAE/image-size/large?v=v2&amp;amp;px=999" role="button" title="UART_IntCTRL_IP.png" alt="UART_IntCTRL_IP.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is my LPUART0_ISR function&lt;/P&gt;&lt;DIV&gt;void LPUART0_ISR()&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; const char* pBuffer = "LPUART0_ISR\r\n";&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; volatile Lpuart_Uart_Ip_StatusType lpuartStatus = LPUART_UART_IP_STATUS_ERROR;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32 T_timeout = 0xFFFFFF;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32 remainingBytes;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; Lpuart_Uart_Ip_AsyncSend(UART_LPUART_INTERNAL_CHANNEL, pBuffer, strlen(pBuffer));&lt;/SPAN&gt;&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; lpuartStatus = Lpuart_Uart_Ip_GetTransmitStatus(UART_LPUART_INTERNAL_CHANNEL, &amp;amp;remainingBytes);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; } while (LPUART_UART_IP_STATUS_BUSY == lpuartStatus &amp;amp;&amp;amp; 0 &amp;lt; T_timeout--);&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or is there any sample code I can refer to?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 09:51:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2039874#M45693</guid>
      <dc:creator>Pohsuan</dc:creator>
      <dc:date>2025-02-07T09:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: S32K1xx LPUART IntCtrl_IP callback function Implement</title>
      <link>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2039922#M45696</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;if you want to use driver's interrupt routine and call own callback from it then just configure respective handler in IntCtrl component (here lpuart 6 is shown, use your instance) and add your callback function in Lpuart component&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-02-07_11-43-35.png" style="width: 857px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/322890i7EF5967A5631E409/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025-02-07_11-43-35.png" alt="2025-02-07_11-43-35.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-02-07_11-43-57.png" style="width: 531px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/322891i816981F0DC6C6126/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025-02-07_11-43-57.png" alt="2025-02-07_11-43-57.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then in your code you add callback and do your need according available events&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;void Uart_Callback(const uint8 HwInstance, const Lpuart_Uart_Ip_EventType Event, void *UserData)
{
    if(HwInstance == UART_INSTANCE)
    {
    	switch(Event){
    	case LPUART_UART_IP_EVENT_RX_FULL:

    		break;
    	case LPUART_UART_IP_EVENT_TX_EMPTY:

    		break;
    	case LPUART_UART_IP_EVENT_END_TRANSFER:

    		break;
    	case LPUART_UART_IP_EVENT_ERROR:

    		break;
    	case LPUART_UART_IP_EVENT_IDLE_STATE:

    		break;
    	default:
    		break;
    	}
    }



}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 10:58:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2039922#M45696</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2025-02-07T10:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: S32K1xx LPUART IntCtrl_IP callback function Implement</title>
      <link>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2041585#M45785</link>
      <description>&lt;P&gt;Hi PetrS&lt;/P&gt;&lt;P&gt;Thanks for your reply&lt;/P&gt;&lt;P&gt;I'm testing the UART callback function by enabling UART loopback mode.&lt;/P&gt;&lt;P&gt;I can receive the UART_Callback event, but the LPUART_UART_IP0_IRQHandler function is not being executed.&lt;/P&gt;&lt;P&gt;I have some questions regarding this setup:&lt;/P&gt;&lt;P&gt;1. Where can I set the LPUART_UART_IP_EVENT_RX_FULL value?&lt;/P&gt;&lt;P&gt;2. If the UART event is triggered, what is the purpose of the LPUART_UART_IP0_IRQHandler function?&lt;/P&gt;&lt;P&gt;3.If UART loopback mode is not enabled and I use another UART TX to send data to the S32K118 RX,&lt;/P&gt;&lt;P&gt;I am unable to receive the LPUART_UART_IP_EVENT_RX_FULL event.&lt;/P&gt;&lt;P&gt;here is my testing function&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;void sendstring(char* string)
{
    Lpuart_Uart_Ip_AsyncSend(UART_LPUART_INTERNAL_CHANNEL, string, strlen(string));
}

void UART_Callback(const uint8 HwInstance, const Lpuart_Uart_Ip_EventType Event, void *UserData)
{
    if(HwInstance == UART_LPUART_INTERNAL_CHANNEL)
    {
    	switch(Event){
    	case LPUART_UART_IP_EVENT_RX_FULL:

    		sendstring("LPUART_UART_IP_EVENT_RX_FULL\r\n");
    	    ISR_UART = 1;

    		break;
    	case LPUART_UART_IP_EVENT_TX_EMPTY:
    		sendstring("LPUART_UART_IP_EVENT_TX_EMPTY\r\n");

    		break;
    	case LPUART_UART_IP_EVENT_END_TRANSFER:
    		//sendstring("LPUART_UART_IP_EVENT_END_TRANSFER\r\n");

    		break;
    	case LPUART_UART_IP_EVENT_ERROR:
    		sendstring("LPUART_UART_IP_EVENT_ERROR\r\n");

    		break;
    	//case LPUART_UART_IP_EVENT_IDLE_STATE:

    		//break;
    	default:
    		break;
    	}
    }
}
void LPUART_UART_IP0_IRQHandler()
{
	sendstring("LPUART_UART_IP0_IRQHandler\r\n");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would greatly appreciate any advice you can provide. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 08:44:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2041585#M45785</guid>
      <dc:creator>Pohsuan</dc:creator>
      <dc:date>2025-02-11T08:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: S32K1xx LPUART IntCtrl_IP callback function Implement</title>
      <link>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2041800#M45794</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;the&amp;nbsp;&lt;SPAN&gt;LPUART_UART_IP0_IRQHandler is assigned nowhere so there is no reason to be called.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1) the Lpuart_Uart_Ip_EventType enum of the Events which can trigger UART callback is defined in&amp;nbsp;lpuart_uart_ip_types.h.&amp;nbsp;&lt;BR /&gt;Teh callback with&amp;nbsp;LPUART_UART_IP_EVENT_RX_FULL&amp;nbsp;event is called when defined number of bytes (specified in AsyncReceive function) was received.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2) the&amp;nbsp;LPUART_UART_IP_0_IRQHandler is driver ISR routine assigned for module interrupt. When byte is received/send this handler is called, byte serviced and user callback is called from there if defined event is achieved.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3) you can check in debugger if driver interrupt is get, means&amp;nbsp;LPUART_UART_IP_0_IRQHandler called. if yes then&amp;nbsp;LPUART_UART_IP_EVENT_RX_FULL would be called as well after&amp;nbsp;defined number of bytes is received.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR, Petr&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 13:02:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2041800#M45794</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2025-02-11T13:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: S32K1xx LPUART IntCtrl_IP callback function Implement</title>
      <link>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2042312#M45820</link>
      <description>&lt;P&gt;I tried implementing the RX interrupt on both UART0 and UART1,&lt;/P&gt;&lt;P&gt;but I couldn't receive the RX_FULL event for either of them.&lt;/P&gt;&lt;P&gt;Additionally, I encountered a LPUART_UART_IP_EVENT_ERROR on UART1.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pohsuan_0-1739343799211.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/323559iDC9B825A1B000200/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Pohsuan_0-1739343799211.png" alt="Pohsuan_0-1739343799211.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Could you please help me review my code to check if there's anything incorrectly configured?&lt;/P&gt;&lt;P&gt;I would really appreciate your assistance.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 07:04:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2042312#M45820</guid>
      <dc:creator>Pohsuan</dc:creator>
      <dc:date>2025-02-12T07:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: S32K1xx LPUART IntCtrl_IP callback function Implement</title>
      <link>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2042593#M45838</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;do you use own board or EVB? On S32K118EVB you should use different pins then the one selected.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 11:59:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K1xx-LPUART-IntCtrl-IP-callback-function-Implement/m-p/2042593#M45838</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2025-02-12T11:59:47Z</dc:date>
    </item>
  </channel>
</rss>

