<?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: problem about HardFault_Handler in S32K</title>
    <link>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683871#M1007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I add these code into&amp;nbsp;HardFault_Handler,but the translater report follow error：&lt;/P&gt;&lt;P&gt;Multiple markers at this line&lt;BR /&gt; - Symbol 'r0' could not be resolved&lt;BR /&gt; - 'r0' undeclared (first use in this function)&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/19889iAC144FFAEB45255A/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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Jun 2017 01:07:00 GMT</pubDate>
    <dc:creator>_simple_</dc:creator>
    <dc:date>2017-06-13T01:07:00Z</dc:date>
    <item>
      <title>problem about HardFault_Handler</title>
      <link>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683869#M1005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use CAN0 recive data, but sometime it will run&amp;nbsp;HardFault_Handler,why?&lt;/P&gt;&lt;P&gt;THANKS!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2017 09:09:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683869#M1005</guid>
      <dc:creator>_simple_</dc:creator>
      <dc:date>2017-06-12T09:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: problem about HardFault_Handler</title>
      <link>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683870#M1006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can check S32_SCB-&amp;gt;CFSR register to see what type of exception it is.&lt;/P&gt;&lt;P&gt;Detailed description of this register can be found in &lt;A href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0553a/DUI0553A_cortex_m4_dgug.pdf" rel="nofollow noopener noreferrer" target="_blank"&gt;Cortex-M4 Devices Generic User Guide&lt;/A&gt; (chapter 4.3.10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, you can extend the HardFault_Handler function to get stack frame.&lt;/P&gt;&lt;P&gt;Program counter (pc) holds address of the instruction that has caused the exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;HardFault_Handler&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// LR provides information of the return stack PSP/MSP&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MOVS R0, #4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MOV R1, LR"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"TST R0, R1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"BEQ _MSP"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MRS R0, PSP"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"B getStackFrame"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_MSP:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MRS R0, MSP"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"B getStackFrame"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 
&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;getStackFrame&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;uint32_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;stackFrame&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
r0&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stackFrame&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
r1&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stackFrame&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
r2&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stackFrame&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
r3&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stackFrame&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
r12 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stackFrame&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
lr&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stackFrame&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
pc&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stackFrame&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp; 
psr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stackFrame&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"BKPT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2017 12:07:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683870#M1006</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2017-06-12T12:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: problem about HardFault_Handler</title>
      <link>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683871#M1007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I add these code into&amp;nbsp;HardFault_Handler,but the translater report follow error：&lt;/P&gt;&lt;P&gt;Multiple markers at this line&lt;BR /&gt; - Symbol 'r0' could not be resolved&lt;BR /&gt; - 'r0' undeclared (first use in this function)&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/19889iAC144FFAEB45255A/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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2017 01:07:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683871#M1007</guid>
      <dc:creator>_simple_</dc:creator>
      <dc:date>2017-06-13T01:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: problem about HardFault_Handler</title>
      <link>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683872#M1008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Symbols r0, r1 ... are variables and must be declared: uint32_t r0;&lt;/P&gt;&lt;P&gt;Also, the function getStackFrame should have a prototype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2017 07:17:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683872#M1008</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2017-06-13T07:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: problem about HardFault_Handler</title>
      <link>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683873#M1009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might be helpful:&amp;nbsp;&amp;nbsp; &lt;A class="link-titled" href="http://www.keil.com/appnotes/files/apnt209.pdf" title="http://www.keil.com/appnotes/files/apnt209.pdf"&gt;http://www.keil.com/appnotes/files/apnt209.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2017 15:45:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683873#M1009</guid>
      <dc:creator>robertboys</dc:creator>
      <dc:date>2017-06-13T15:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem about HardFault_Handler</title>
      <link>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683874#M1010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you！&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2017 05:35:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683874#M1010</guid>
      <dc:creator>_simple_</dc:creator>
      <dc:date>2017-06-15T05:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: problem about HardFault_Handler</title>
      <link>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683875#M1011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you！&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2017 05:36:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/problem-about-HardFault-Handler/m-p/683875#M1011</guid>
      <dc:creator>_simple_</dc:creator>
      <dc:date>2017-06-15T05:36:40Z</dc:date>
    </item>
  </channel>
</rss>

