<?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: Cortex M4 Fault Handler in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Cortex-M4-Fault-Handler/m-p/566222#M17258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="http://info.atollic.com/crash_analyzis_whitepaper?utm_referrer=http%3A%2F%2Fblog.atollic.com%2Feasily-solve-runtime-errors-using-the-hard-fault-crash-analyzis-capabilities-of-cortex-m" title="http://info.atollic.com/crash_analyzis_whitepaper?utm_referrer=http%3A%2F%2Fblog.atollic.com%2Feasily-solve-runtime-errors-using-the-hard-fault-crash-analyzis-capabilities-of-cortex-m"&gt;Read our free Cortex-M hard fault crash analysis whitepaper!&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Nov 2016 16:43:16 GMT</pubDate>
    <dc:creator>massimomanca</dc:creator>
    <dc:date>2016-11-29T16:43:16Z</dc:date>
    <item>
      <title>Cortex M4 Fault Handler</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Cortex-M4-Fault-Handler/m-p/566220#M17256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a build system that makes use of LPCScrypt on a linux machine.&amp;nbsp; Everything works really well, except that without the ability to set breakpoints (no debugger nor IDE), I'm unable to debug as effectively as I'm used to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cr_startup_lpc43xx.c describes a lot of great fault handlers I can implement, namely, HardFault_Handler.&amp;nbsp; But I don't have a good way to print out the call stack/all the function calls that led me to this terrible, terrible point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a template I can use to paste into one of these fault handlers to be able to printf() some basic state of the world before just dying silently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;//*****************************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// Default exception handlers. Override the ones here by defining your own&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// handler routines in your application code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;//*****************************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;__attribute__ ((section(".after_vectors")))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;void NMI_Handler(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;__attribute__ ((section(".after_vectors")))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;void HardFault_Handler(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;__attribute__ ((section(".after_vectors")))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;void MemManage_Handler(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;__attribute__ ((section(".after_vectors")))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;void BusFault_Handler(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;__attribute__ ((section(".after_vectors")))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;void UsageFault_Handler(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;__attribute__ ((section(".after_vectors")))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;void SVC_Handler(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;__attribute__ ((section(".after_vectors")))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;void DebugMon_Handler(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;__attribute__ ((section(".after_vectors")))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;void PendSV_Handler(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;__attribute__ ((section(".after_vectors")))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;void SysTick_Handler(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 22:57:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Cortex-M4-Fault-Handler/m-p/566220#M17256</guid>
      <dc:creator>mr_s</dc:creator>
      <dc:date>2016-08-03T22:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cortex M4 Fault Handler</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Cortex-M4-Fault-Handler/m-p/566221#M17257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The free version of the LPCXpresso.IDE is available for download here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.nxp.com/products/software-and-tools/software-development-tools/software-tools/lpc-microcontroller-utilities/lpcxpresso-ide-v8.2.0:LPCXPRESSO?fsrch=1&amp;amp;sr=1&amp;amp;pageNum=1" title="http://www.nxp.com/products/software-and-tools/software-development-tools/software-tools/lpc-microcontroller-utilities/lpcxpresso-ide-v8.2.0:LPCXPRESSO?fsrch=1&amp;amp;sr=1&amp;amp;pageNum=1"&gt;LPCXpresso IDE v8.2.0 NXP&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a FAQ for debugging a hard fault:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/389002"&gt;Debugging a Hard Fault&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;LPCXpresso Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 23:11:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Cortex-M4-Fault-Handler/m-p/566221#M17257</guid>
      <dc:creator>lpcxpresso_supp</dc:creator>
      <dc:date>2016-08-03T23:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Cortex M4 Fault Handler</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Cortex-M4-Fault-Handler/m-p/566222#M17258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="http://info.atollic.com/crash_analyzis_whitepaper?utm_referrer=http%3A%2F%2Fblog.atollic.com%2Feasily-solve-runtime-errors-using-the-hard-fault-crash-analyzis-capabilities-of-cortex-m" title="http://info.atollic.com/crash_analyzis_whitepaper?utm_referrer=http%3A%2F%2Fblog.atollic.com%2Feasily-solve-runtime-errors-using-the-hard-fault-crash-analyzis-capabilities-of-cortex-m"&gt;Read our free Cortex-M hard fault crash analysis whitepaper!&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 16:43:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Cortex-M4-Fault-Handler/m-p/566222#M17258</guid>
      <dc:creator>massimomanca</dc:creator>
      <dc:date>2016-11-29T16:43:16Z</dc:date>
    </item>
  </channel>
</rss>

