<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hard Fault hang in BLE stack</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37489/hard-fault-hang-in-ble-stack</link><description>I have a nicely working application that occasionally hangs. I have managed to trap a &amp;quot;hard fault&amp;quot; under the debugger (using VS with GCC). I have the system halted with the debugger open, but can&amp;#39;t find a way to trace further to see what precipitated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Aug 2018 15:02:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37489/hard-fault-hang-in-ble-stack" /><item><title>RE: Hard Fault hang in BLE stack</title><link>https://devzone.nordicsemi.com/thread/144362?ContentTypeID=1</link><pubDate>Wed, 15 Aug 2018 15:02:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6bc2a92-0042-4e48-b66d-48bed0e787fa</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think the easiest way to back trace a hard fault is to use the Hardfault library provided in the SDK (&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/lib_hardfault.html?cp=4_0_0_3_20"&gt;link&lt;/a&gt;). Which SDK version are you on?&lt;/p&gt;
&lt;p&gt;That said,&amp;nbsp;this won&amp;#39;t work if the program is stuck in the softdevice&amp;#39;s hardfault handler. Generally it should forward all fault exceptions to the application, but it can fail in some rare cases as mentioned in this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/35293/how-to-use-hardfault-exception-library/136859#136859"&gt;thread&lt;/a&gt;&amp;nbsp;or if you have &amp;quot;vector catch&amp;quot; enabled in GDB (probably vector catch if PC is below address 0x1000).&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hard Fault hang in BLE stack</title><link>https://devzone.nordicsemi.com/thread/144350?ContentTypeID=1</link><pubDate>Wed, 15 Aug 2018 14:24:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57d4d23b-88f1-4069-9146-44537474805b</guid><dc:creator>SteveHx</dc:creator><description>&lt;p&gt;That&amp;#39;s not particularly helpful. I know what hard faults are and their various causes. I have the debugger stopped at a hard fault, but having trouble finding a way to backtrack to the root cause. What in the BLE stack is likely to cause a hard fault, or how can I backtrack to the origin of this one?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hard Fault hang in BLE stack</title><link>https://devzone.nordicsemi.com/thread/144345?ContentTypeID=1</link><pubDate>Wed, 15 Aug 2018 14:15:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c5d5030-44fc-4cb2-9210-837b3ded2e44</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Have you googled general articles on Cortex-M Hard Fault debugging?&lt;br /&gt;&lt;br /&gt;Joseph Yiu&amp;#39;s &amp;quot;Definitive Guide&amp;quot; books have a section on Faults and their handling ...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.elsevier.com/books/the-definitive-guide-to-arm-cortex-m0-and-cortex-m0-processors/yiu/978-0-12-803277-0"&gt;https://www.elsevier.com/books/the-definitive-guide-to-arm-cortex-m0-and-cortex-m0-processors/yiu/978-0-12-803277-0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.elsevier.com/books/the-definitive-guide-to-arm-cortex-m3-and-cortex-m4-processors/yiu/978-0-12-408082-9"&gt;https://www.elsevier.com/books/the-definitive-guide-to-arm-cortex-m3-and-cortex-m4-processors/yiu/978-0-12-408082-9&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>