<?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 Re: S32k uart RX interrupt problem in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-problem/m-p/2144940#M13667</link>
    <description>&lt;P&gt;i only need rx as interrupt and tx use as printf no need interrupt&lt;/P&gt;</description>
    <pubDate>Fri, 01 Aug 2025 06:52:56 GMT</pubDate>
    <dc:creator>alice_th</dc:creator>
    <dc:date>2025-08-01T06:52:56Z</dc:date>
    <item>
      <title>S32k uart RX interrupt problem</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-problem/m-p/2144936#M13666</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;i see there is&amp;nbsp;lpuart_echo_s32k144 demo, the rx using&amp;nbsp;LPUART_DRV_InstallRxCallback(INST_LPUART_LPUART_1, rxCallback, NULL);&lt;/P&gt;&lt;P&gt;&amp;nbsp;why still in polling mode the receive the data in main loop?&lt;/P&gt;&lt;P&gt;how to modify it with rx only interrupt mode ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;if remove below code&lt;/P&gt;&lt;P&gt;/* Receive and store data byte by byte until new line character is received,&lt;BR /&gt;* or the buffer becomes full (256 characters received)&lt;BR /&gt;*/&lt;BR /&gt;LPUART_DRV_ReceiveData(INST_LPUART_LPUART_1, buffer, 1U);&lt;BR /&gt;/* Wait for transfer to be completed */&lt;BR /&gt;while(LPUART_DRV_GetReceiveStatus(INST_LPUART_LPUART_1, &amp;amp;bytesRemaining) == STATUS_BUSY);&lt;/P&gt;&lt;P&gt;/* Check the status */&lt;BR /&gt;status = LPUART_DRV_GetReceiveStatus(INST_LPUART_LPUART_1, &amp;amp;bytesRemaining);&lt;/P&gt;&lt;P&gt;it doesn't work.&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;/* Write your local variable definition here */&lt;BR /&gt;status_t status;&lt;BR /&gt;/* Declare a buffer used to store the received data */&lt;BR /&gt;uint32_t bytesRemaining;&lt;/P&gt;&lt;P&gt;/* Write your code here */&lt;BR /&gt;/* For example: for(;;) { } */&lt;/P&gt;&lt;P&gt;/* Initialize and configure clocks&lt;BR /&gt;* - see clock manager component for details&lt;BR /&gt;*/&lt;BR /&gt;CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,&lt;BR /&gt;g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);&lt;BR /&gt;CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);&lt;/P&gt;&lt;P&gt;/* Initialize pins&lt;BR /&gt;* - See PinSettings component for more info&lt;BR /&gt;*/&lt;BR /&gt;PINS_DRV_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);&lt;/P&gt;&lt;P&gt;/* Initialize LPUART instance */&lt;BR /&gt;LPUART_DRV_Init(INST_LPUART_LPUART_1, &amp;amp;lpUartState1, &amp;amp;lpUartInitConfig1);&lt;BR /&gt;/* Install the callback for rx events */&lt;BR /&gt;LPUART_DRV_InstallRxCallback(INST_LPUART_LPUART_1, rxCallback, NULL);&lt;BR /&gt;/* Send a welcome message */&lt;BR /&gt;LPUART_DRV_SendDataBlocking(INST_LPUART_LPUART_1, (uint8_t *)welcomeMsg, strlen(welcomeMsg), TIMEOUT);&lt;/P&gt;&lt;P&gt;/* Infinite loop:&lt;BR /&gt;* - Receive data from user&lt;BR /&gt;* - Echo the received data back&lt;BR /&gt;*/&lt;BR /&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;/* Receive and store data byte by byte until new line character is received,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;* or the buffer becomes full (256 characters received)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;*/&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LPUART_DRV_ReceiveData(INST_LPUART_LPUART_1, buffer, 1U);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;/* Wait for transfer to be completed */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;while(LPUART_DRV_GetReceiveStatus(INST_LPUART_LPUART_1, &amp;amp;bytesRemaining) == STATUS_BUSY);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* Check the status */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;status = LPUART_DRV_GetReceiveStatus(INST_LPUART_LPUART_1, &amp;amp;bytesRemaining);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if (status != STATUS_SUCCESS)&lt;BR /&gt;{&lt;BR /&gt;/* If an error occurred, send the error message and exit the loop */&lt;BR /&gt;LPUART_DRV_SendDataBlocking(INST_LPUART_LPUART_1, (uint8_t *)errorMsg, strlen(errorMsg), TIMEOUT);&lt;BR /&gt;break;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Append string terminator to the received data */&lt;BR /&gt;bufferIdx++;&lt;BR /&gt;buffer[bufferIdx] = 0U;&lt;/P&gt;&lt;P&gt;/* If the received string is "Hello Board", send back "Hello World" */&lt;BR /&gt;if(strcmp((char *)buffer, "Hello Board\n") == 0)&lt;BR /&gt;{&lt;BR /&gt;strcpy((char *)buffer, "Hello World\n");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Send the received data back */&lt;BR /&gt;LPUART_DRV_SendDataBlocking(INST_LPUART_LPUART_1, buffer, bufferIdx, TIMEOUT);&lt;BR /&gt;/* Reset the buffer index to start a new reception */&lt;BR /&gt;bufferIdx = 0U;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;for(;;) {&lt;BR /&gt;if(exit_code != 0) {&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;return exit_code;&lt;BR /&gt;} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 06:43:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-problem/m-p/2144936#M13666</guid>
      <dc:creator>alice_th</dc:creator>
      <dc:date>2025-08-01T06:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: S32k uart RX interrupt problem</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-problem/m-p/2144940#M13667</link>
      <description>&lt;P&gt;i only need rx as interrupt and tx use as printf no need interrupt&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 06:52:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-problem/m-p/2144940#M13667</guid>
      <dc:creator>alice_th</dc:creator>
      <dc:date>2025-08-01T06:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: S32k uart RX interrupt problem</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-problem/m-p/2145411#M13668</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/218113"&gt;@alice_th&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Even if you configure interrupts for the UART module, you still need to signal that a reception is going to happen.&lt;/P&gt;
&lt;P&gt;You must call&amp;nbsp;&lt;STRONG&gt;LPUART_DRV_ReceiveData&lt;/STRONG&gt;(). And upon reception, either use&amp;nbsp;&lt;STRONG&gt;LPUART_DRV_SetRxBuffer&lt;/STRONG&gt;() to update the buffer and have a continuous reception or end the reception and call&amp;nbsp;&lt;STRONG&gt;LPUART_DRV_ReceiveData&lt;/STRONG&gt;() again to enable the Rx interrupt, all inside the UART callback function.&lt;/P&gt;
&lt;P&gt;I've attached a modified main for the lpuart_echo example where the polling section in main is removed, and the callback handling I mentioned is implemented. The echo is only performed if&amp;nbsp;&lt;STRONG&gt;bRxFlag&lt;/STRONG&gt; is set, which happens in the&amp;nbsp;&lt;STRONG&gt;UART_EVENT_RX_FULL&lt;/STRONG&gt; event.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 18:14:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-problem/m-p/2145411#M13668</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2025-08-01T18:14:24Z</dc:date>
    </item>
  </channel>
</rss>

