<?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: S32K148: Frequent UART_FRAMING_ERROR in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K148-Frequent-UART-FRAMING-ERROR/m-p/1237319#M10014</link>
    <description>&lt;P&gt;Hello Zitong,&lt;/P&gt;
&lt;P&gt;Since the Framing Error is reported when the received char has 0 where a stop bit should be,&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_0-1614349309278.png" style="width: 735px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/138237i3A88E68402D0E5BC/image-dimensions/735x100?v=v2" width="735" height="100" role="button" title="danielmartynek_0-1614349309278.png" alt="danielmartynek_0-1614349309278.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would double check the baudrate.&lt;/P&gt;
&lt;P&gt;Can you please scope the signal both from the S32K148 and the iMX6?&lt;/P&gt;
&lt;P&gt;Please have a look at Section 53.4.2 Baud rate generation in the RM, rev12.1&lt;/P&gt;
&lt;P&gt;Depending on the over sampling ratio, the receiver has an acquisition rate of 4 to 32 samples per bit time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 14:27:20 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2021-02-26T14:27:20Z</dc:date>
    <item>
      <title>S32K148: Frequent UART_FRAMING_ERROR</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-Frequent-UART-FRAMING-ERROR/m-p/1237159#M10010</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I am having some trouble with the UART module where UART_FRAMING_ERROR occurs very frequently that only 20% of the payload is received successfully.&lt;/P&gt;&lt;P&gt;The project uses freeRTOS and the S32 SDK. A task receives UART packets from another chip (iMX6). The UART packet starts with 0xAE and has a fixed length of 88 bytes (RX_BUFF_LEN). It is sent to S32K148 at 100Hz with a baud rate of 460800.&lt;/P&gt;&lt;P&gt;I have used similar tasks to receive data from other devices before, which worked fine. The code also works when I send data from a Raspberry Pi to an S32K148_EVB (same data format as memtioned above). But when switching to the actual project,&amp;nbsp;LPUART_DRV_GetReceiveStatus frequently returns UART_FRAMING_ERROR (as sample from FreeMaster). As a result, only 20% of the payload is received: a counter increases upon successful reception, and FreeMaster shows this counter only increases by 20 each second, instead of the expected 100Hz.&lt;/P&gt;&lt;P&gt;To add a few points:&lt;/P&gt;&lt;P&gt;1. The S32K148 uses CLK_SRC_SPLL_DIV2 as the clock source, process expert shows an actual baudrate of&amp;nbsp;465116, which doesn't look ridiculous;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;I have also tried reducing the baudrate to 115200 with no success;&lt;/P&gt;&lt;P&gt;3. The iMX6 chip seems to receive data from S32K148 OK, at least much more smoothly;&lt;/P&gt;&lt;P&gt;I have inserted part of the code below. I wonder if you could share your thoughts on this issue.&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;Zitong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;LPUART_DRV_ReceiveData(INST_LPUART1, &amp;amp;u8RxBuffer[0], RX_BUFF_LEN);
for (;;) {
    /* poll rx status */
    eRxStat = LPUART_DRV_GetReceiveStatus(INST_LPUART1, &amp;amp;u32BytesLeft);
    if ( eRxStat == STATUS_BUSY ) { /* if rx in progress */
        u16BytesReceived = RX_BUFF_LEN - (uint16_t)u32BytesLeft;
        if ( u16BytesReceived &amp;gt; 0 ) { /* if at least one byte received */
            if (0xAE != u8RxBuffer[0]) { /* if packet header missed */
                /* abort current receive since the packet is incomplete */
                LPUART_DRV_AbortReceivingData(INST_LPUART1);
                /* restart receive after 2ms so that the current packet is flushed */
                vTaskDelay(2);
                LPUART_DRV_ReceiveData(INST_LPUART1, u8RxBuffer, RX_BUFF_LEN);
            }
        }
    } else if ( eRxStat == STATUS_SUCCESS ) { /* if transfer successful */
        /* handle received data */
        /* restart receive */
        LPUART_DRV_ReceiveData(INST_LPUART1, u8RxBuffer, RX_BUFF_LEN);
        vTaskDelay(1);
    } else { /* if error occurs */
        /* restarts receive */
        LPUART_DRV_ReceiveData(INST_LPUART1, u8RxBuffer, RX_BUFF_LEN);
    }
    vTaskDelay(1);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 08:54:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-Frequent-UART-FRAMING-ERROR/m-p/1237159#M10010</guid>
      <dc:creator>zitong_zhang</dc:creator>
      <dc:date>2021-02-26T08:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: S32K148: Frequent UART_FRAMING_ERROR</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-Frequent-UART-FRAMING-ERROR/m-p/1237319#M10014</link>
      <description>&lt;P&gt;Hello Zitong,&lt;/P&gt;
&lt;P&gt;Since the Framing Error is reported when the received char has 0 where a stop bit should be,&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_0-1614349309278.png" style="width: 735px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/138237i3A88E68402D0E5BC/image-dimensions/735x100?v=v2" width="735" height="100" role="button" title="danielmartynek_0-1614349309278.png" alt="danielmartynek_0-1614349309278.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would double check the baudrate.&lt;/P&gt;
&lt;P&gt;Can you please scope the signal both from the S32K148 and the iMX6?&lt;/P&gt;
&lt;P&gt;Please have a look at Section 53.4.2 Baud rate generation in the RM, rev12.1&lt;/P&gt;
&lt;P&gt;Depending on the over sampling ratio, the receiver has an acquisition rate of 4 to 32 samples per bit time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 14:27:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-Frequent-UART-FRAMING-ERROR/m-p/1237319#M10014</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2021-02-26T14:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: S32K148: Frequent UART_FRAMING_ERROR</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-Frequent-UART-FRAMING-ERROR/m-p/1892428#M36831</link>
      <description>&lt;P&gt;I meet similar problem like you, and I fixed this by set rx pin pull up enable.Maybe you can try this too.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2024 09:23:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-Frequent-UART-FRAMING-ERROR/m-p/1892428#M36831</guid>
      <dc:creator>iysheng</dc:creator>
      <dc:date>2024-06-23T09:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: S32K148: Frequent UART_FRAMING_ERROR</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-Frequent-UART-FRAMING-ERROR/m-p/2042915#M45853</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;SPAN&gt;1. The S32K148 uses CLK_SRC_SPLL_DIV2 as the clock source, process expert shows an actual baudrate of&amp;nbsp;465116, which doesn't look ridiculous;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;--&amp;gt; the actual baudrate for 460800 in S32K148 can be updated to 460905 by using SPLLDIV2 Clock 112MHz for LPUART clock.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For this, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;1) SPL_VCO set [ / 1 * 28 ] and output 224 MHz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;2) SPL CLOCK set [ / 2 ] and output 112 MHz&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Feb 2025 23:45:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-Frequent-UART-FRAMING-ERROR/m-p/2042915#M45853</guid>
      <dc:creator>toipaz</dc:creator>
      <dc:date>2025-02-12T23:45:26Z</dc:date>
    </item>
  </channel>
</rss>

