<?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>HardFault debug</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50825/hardfault-debug</link><description>During the firmware running, there will be a HardFault_Handler error occasionally. 
 Is there any way to locate the error source? 
 Is there any good way to catch the hardware exception? Thanks!</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Aug 2019 07:04:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50825/hardfault-debug" /><item><title>RE: HardFault debug</title><link>https://devzone.nordicsemi.com/thread/203474?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 07:04:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3abaefcc-aab1-4181-b95b-fffee903d286</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;You are running the APP timer with a higher IRQ priority than the SoftDevice, which is not allowed.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault debug</title><link>https://devzone.nordicsemi.com/thread/203253?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 10:05:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8eb37524-66cd-4c1d-9d94-5a996ef005f2</guid><dc:creator>Hansome</dc:creator><description>&lt;p&gt;&lt;span&gt;APP_TIMER_CONFIG_IRQ_PRIORITY = 6 is normal&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault debug</title><link>https://devzone.nordicsemi.com/thread/203252?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 10:04:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9709da2-7b77-4823-83c6-4ecbba6136d4</guid><dc:creator>Hansome</dc:creator><description>&lt;p&gt;While setting APP_TIMER_CONFIG_IRQ_PRIORITY = 2, execute sd_ble_gap_conn_param_update will cause HardFault.&lt;br /&gt;While setting APP_TIMER_CONFIG_IRQ_PRIORITY = 2, it is normal.&lt;br /&gt;Why?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault debug</title><link>https://devzone.nordicsemi.com/thread/203230?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 08:20:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:954312b5-3a12-45c6-8365-7bbc4beb43a3</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi, to quick summarize:&lt;/p&gt;
&lt;p&gt;You have to find the stack pointer (SP) value at r13, as you can see that that is the location of the stack pointer in Cortex M4:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/755x550/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-0999fdb329e34453bc77027e5d655d31/pastedimage1565338658864v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;You then have to add 0x18 to the stack pointer value, and this will give you the program counter (PC) value that cause the error.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/714x310/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-0999fdb329e34453bc77027e5d655d31/pastedimage1565338741891v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault debug</title><link>https://devzone.nordicsemi.com/thread/203220?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 07:46:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90f3a775-5e63-4eb5-9dce-47e59509db04</guid><dc:creator>Hansome</dc:creator><description>&lt;p&gt;Based on MDK5.25,&amp;nbsp;nRF5_SDK_15.3.0_59ac345, and open DEBUG macro, and -O0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault debug</title><link>https://devzone.nordicsemi.com/thread/203219?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 07:45:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:674b6134-6659-47fe-b9bd-1fd8167e79be</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Can you take a look at&lt;a href="https://stackoverflow.com/questions/53253652/debugging-a-hard-fault-in-arm-cortex-m4"&gt; this page&lt;/a&gt; on StackOverflow?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>