<?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: S32K116 Hardfault reset</title>
    <link>https://community.nxp.com/t5/S32K/S32K116-Hardfault-reset/m-p/1071099#M7372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/nxf46116"&gt;nxf46116&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the bug in my code which was causing the issue, but I left the question open since I thought I would be useful to know if there was a way to track which memory address was overflowing and causing a hardfault reset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I believe there is not a way to directly know that information, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Jose.&lt;/P&gt;&lt;DIV style="position: absolute; left: 81px; top: 6px;"&gt;&lt;DIV class="gtx-trans-icon"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jun 2020 01:12:52 GMT</pubDate>
    <dc:creator>joseponc</dc:creator>
    <dc:date>2020-06-05T01:12:52Z</dc:date>
    <item>
      <title>S32K116 Hardfault reset</title>
      <link>https://community.nxp.com/t5/S32K/S32K116-Hardfault-reset/m-p/1071097#M7370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm woking on a project in which I use UART to communicate with an LMM on the S32K116. I have an interface which translates a defined structure (that contains LMM-specific commands) to an array which is sent to the Uart_Send function from the S32DS driver examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While debugging, it seems like the software, when it receives the structure with the data, performs the memcpy function, I don't know why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At some point, after we succesfully send a couple of messages correctly, the microcontroller resets. I tried to debug what reset was triggered, and found out it was a &lt;STRONG&gt;hardfault reset&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the &lt;STRONG&gt;EmbSys Registers&lt;/STRONG&gt;, I could confirm in the &lt;STRONG&gt;Reset Control Module&lt;/STRONG&gt; that this reset was software-caused.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying to debug further, I got the following message after calling my function which parses the structure into the array that is sent by the Uart_Send function. Keep in mind that, by this point, the software has successfully sent ~100 messages without any issues:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Uart_Issue_NXP.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/107650i0CCE55EE16754E5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Uart_Issue_NXP.PNG" alt="Uart_Issue_NXP.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It was thanks to this message that I could see how memcpy was somehow called everytime I called my structure parser function, and it becomes harder to understand how come this error didn't show up when sending the previous ~100 messages but this specific one triggers the error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep in mind that every message is the same. I don't even use different variables. The only thing that distinguishes one message from another is the data field. They have the same message length and same LMM-specific fields. (total message length is 21 bytes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I know/debug the root cause of a hardfault error that ends up resetting my microcontroller?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is memcpy being called by no apparent reason (since it's not called anywhere in the code) and, even stranger, why is it "not being found" after ~100 messages have been succesfully sent?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="position: absolute; left: 178px; top: 807.267px;"&gt;&lt;DIV class="gtx-trans-icon"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2020 00:30:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K116-Hardfault-reset/m-p/1071097#M7370</guid>
      <dc:creator>joseponc</dc:creator>
      <dc:date>2020-05-26T00:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: S32K116 Hardfault reset</title>
      <link>https://community.nxp.com/t5/S32K/S32K116-Hardfault-reset/m-p/1071098#M7371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/joseponc@gmail.com"&gt;joseponc@gmail.com&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would it be possible to share a code where I could reproduce this issue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2020 15:17:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K116-Hardfault-reset/m-p/1071098#M7371</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-06-04T15:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: S32K116 Hardfault reset</title>
      <link>https://community.nxp.com/t5/S32K/S32K116-Hardfault-reset/m-p/1071099#M7372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/nxf46116"&gt;nxf46116&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the bug in my code which was causing the issue, but I left the question open since I thought I would be useful to know if there was a way to track which memory address was overflowing and causing a hardfault reset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I believe there is not a way to directly know that information, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Jose.&lt;/P&gt;&lt;DIV style="position: absolute; left: 81px; top: 6px;"&gt;&lt;DIV class="gtx-trans-icon"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2020 01:12:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K116-Hardfault-reset/m-p/1071099#M7372</guid>
      <dc:creator>joseponc</dc:creator>
      <dc:date>2020-06-05T01:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: S32K116 Hardfault reset</title>
      <link>https://community.nxp.com/t5/S32K/S32K116-Hardfault-reset/m-p/1071100#M7373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/joseponc@gmail.com"&gt;joseponc@gmail.com&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to track where the code got stuck is to check the debug tab and see where the hard fault was triggered following the execution in the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112229i2E718DC697089059/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 16:46:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K116-Hardfault-reset/m-p/1071100#M7373</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-06-08T16:46:22Z</dc:date>
    </item>
  </channel>
</rss>

