<?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のトピックS32K344 - LPUART Tx Send Hard Fault</title>
    <link>https://community.nxp.com/t5/S32K/S32K344-LPUART-Tx-Send-Hard-Fault/m-p/2131479#M50766</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm working on an S32K platform using FreeRTOS. I have two tasks (UartTask1 and UartTask2) that frequently call debug_log() to send messages over UART.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Logging structure:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;debug_log() formats the message and enqueues it into a FreeRTOS queue.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;A dedicated uart_log_task() dequeues and sends each message using Lpuart_Uart_Ip_AsyncSend().&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;UART TX completion is confirmed using a callback that sets a uart_tx_done flag.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;A small vTaskDelay() is added after UART transmission in the log task — no queue overflow is observed.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt;&lt;BR /&gt;Every time UART starts sending, only a few characters are printed or sometimes garbage, and then the system hits a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;hard fault&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;This happens consistently&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;during&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;UART transmission, not before.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Key finding:&lt;/STRONG&gt;&lt;BR /&gt;When I isolate UART and test it&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;outside of the logging system&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(no queue, no multiple tasks), it works&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;fine&lt;/STRONG&gt;. So the UART driver itself seems okay.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;What could be causing this crash in the multitask logging setup?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Is it possible that a shared/static buffer (like tx_data) is getting overwritten or accessed before TX completes?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Are there specific precautions for using Lpuart_Uart_Ip_AsyncSend() with FreeRTOS and multiple tasks?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any help or suggestions would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have attached snippet code and lpuart config.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jul 2025 07:07:09 GMT</pubDate>
    <dc:creator>DiaDev</dc:creator>
    <dc:date>2025-07-10T07:07:09Z</dc:date>
    <item>
      <title>S32K344 - LPUART Tx Send Hard Fault</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-LPUART-Tx-Send-Hard-Fault/m-p/2131479#M50766</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm working on an S32K platform using FreeRTOS. I have two tasks (UartTask1 and UartTask2) that frequently call debug_log() to send messages over UART.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Logging structure:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;debug_log() formats the message and enqueues it into a FreeRTOS queue.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;A dedicated uart_log_task() dequeues and sends each message using Lpuart_Uart_Ip_AsyncSend().&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;UART TX completion is confirmed using a callback that sets a uart_tx_done flag.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;A small vTaskDelay() is added after UART transmission in the log task — no queue overflow is observed.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt;&lt;BR /&gt;Every time UART starts sending, only a few characters are printed or sometimes garbage, and then the system hits a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;hard fault&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;This happens consistently&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;during&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;UART transmission, not before.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Key finding:&lt;/STRONG&gt;&lt;BR /&gt;When I isolate UART and test it&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;outside of the logging system&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(no queue, no multiple tasks), it works&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;fine&lt;/STRONG&gt;. So the UART driver itself seems okay.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;What could be causing this crash in the multitask logging setup?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Is it possible that a shared/static buffer (like tx_data) is getting overwritten or accessed before TX completes?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Are there specific precautions for using Lpuart_Uart_Ip_AsyncSend() with FreeRTOS and multiple tasks?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any help or suggestions would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have attached snippet code and lpuart config.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 07:07:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-LPUART-Tx-Send-Hard-Fault/m-p/2131479#M50766</guid>
      <dc:creator>DiaDev</dc:creator>
      <dc:date>2025-07-10T07:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 - LPUART Tx Send Hard Fault</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-LPUART-Tx-Send-Hard-Fault/m-p/2134852#M50971</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;try to identify a cause of hard fault. You can&amp;nbsp;&lt;SPAN&gt;refer to:&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.nxp.com/t5/S32K-Knowledge-Base/How-To-Debug-A-Fault-Exception-On-ARM-Cortex-M-V7M-MCU-S32K3XX/ta-p/1595570" target="_self"&gt;How To Debug A Fault Exception On ARM Cortex-M(V7M) MCU(S32K3XX)&lt;/A&gt;&lt;BR /&gt;Maybe just increasing stack, heap size can help.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 09:09:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-LPUART-Tx-Send-Hard-Fault/m-p/2134852#M50971</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2025-07-16T09:09:41Z</dc:date>
    </item>
  </channel>
</rss>

