<?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>nRF52 Hardfault implementation doubts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62567/nrf52-hardfault-implementation-doubts</link><description>Hello, 
 I&amp;#39;m working with nRF5 SDK v16.0.0. 
 The documentation on Hardfault handler implementation clearly suggests to define DEBUG_NRF in order to get an automatic breakpoint on HF, before the call to HardFault_process 
 What I see in the code it is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Jun 2020 10:52:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62567/nrf52-hardfault-implementation-doubts" /><item><title>RE: nRF52 Hardfault implementation doubts</title><link>https://devzone.nordicsemi.com/thread/256391?ContentTypeID=1</link><pubDate>Tue, 23 Jun 2020 10:52:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c90c48fc-eb46-4d9d-ad6e-ab0843b9264a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Dave,&lt;/p&gt;
&lt;p&gt;[quote user="davege"][/quote]&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;is there any good summary of what and how those switches enable when they are defined? I think it would be very useful to engineers during development.&lt;/li&gt;
&lt;li&gt;I&amp;#39;d like to understand in the code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Unfortunately, there are no document to describe them.&amp;nbsp;&lt;br /&gt;DEBUG_NRF is only valid for the macro ASSERT(x). If DEBUG_NRF is defined to 1, then all calls to ASSERT(x)&amp;nbsp;would assert in&amp;nbsp;app_error_fault_handler. This&amp;nbsp; is somewhat same to APP_ERROR_CHECK (but the latter is not depending on DEBUG_NRF). There are lots of examples where WEAK implementation of&amp;nbsp;app_error_fault_handler has been overridden in the main.c to let the application handle errors as they suit them.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="davege"]I&amp;#39;d like to understand in the code where p_stack is set to NULL in the code...? Is it in the assembly function implementing the low level &lt;em&gt;HardFault_Handler&lt;/em&gt;?[/quote]
&lt;p&gt;Yes, you are right, there is a low-level implementation of the HardFault exception.&amp;nbsp; Please take a look in SDK_17.0.0_9d13099\components\libraries\hardfault\nrf52\handler\hardfault_handler_gcc.c to understand how p_stack value is pushed as argument. If you are using different compiler, then please look into the relevant implementation in the given path.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Hardfault implementation doubts</title><link>https://devzone.nordicsemi.com/thread/256058?ContentTypeID=1</link><pubDate>Sun, 21 Jun 2020 15:26:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d289bc8-2015-4934-87d0-da8946f3c9ba</guid><dc:creator>davege</dc:creator><description>&lt;p&gt;Hi Susheel.&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;So coming back to my first request:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;is there any good summary of what and how those switches enable when they are defined? I think it would be very useful to engineers during development.&lt;/li&gt;
&lt;li&gt;I&amp;#39;d like to understand in the code where p_stack is set to NULL in the code...? Is it in the assembly function implementing the low level &lt;em&gt;HardFault_Handler&lt;/em&gt;?&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Hardfault implementation doubts</title><link>https://devzone.nordicsemi.com/thread/255769?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 12:41:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c366cfb-878c-404e-bf55-041d20eb909c</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user=""]What&amp;#39;s the difference between DEBUG and DEBUG_NRF[/quote]
&lt;p&gt;&amp;nbsp;You seems to be right, the initial idea was to keep DEBUG_NRF for NRF&amp;nbsp; libraries and drivers related debug capabilities, like asserts etc. And DEBUG was supposed to be for common assert handling. But unfortunately, it looks&amp;nbsp; like this two are merging in logical use.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>