<?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>Problem entering custom hardfault handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36188/problem-entering-custom-hardfault-handler</link><description>I am using SDK 14.2 in eclipse/GCC. 
 I have enabled HARDFAULT_HANDLER_ENABLED in sdk_config.h, hardfault_handler_gcc.c is in the project, and I also have hardfault_implementaion.c included. I have also added the DEBUG symbol to my project. 
 The project</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Jul 2018 16:44:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36188/problem-entering-custom-hardfault-handler" /><item><title>RE: Problem entering custom hardfault handler</title><link>https://devzone.nordicsemi.com/thread/141405?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 16:44:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54b75b71-61a8-4f3e-87f6-587c08f94e95</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;So it seems like you have stumbled upon the bug that my colleague Vidar is talking about in the other case. As he says, there is no bug fix yet, but&amp;nbsp;&amp;quot;&lt;em&gt;this problem only seems to occur when some specific condition(s) are met, I haven&amp;#39;t experienced it before I tried&amp;nbsp;hardfault_genhf_invalid_fp() that branches to address 0. So&amp;nbsp;the fault exception should be forwarded to the application in most cases.&lt;/em&gt;&amp;quot; I.e. it sounds like this is mostly a problem when using&amp;nbsp;hardfault_genhf_invalid_fp().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem entering custom hardfault handler</title><link>https://devzone.nordicsemi.com/thread/141210?ContentTypeID=1</link><pubDate>Tue, 24 Jul 2018 21:16:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cea2da1f-41d5-4c0a-83cb-8ca7719f43b1</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/CPU-register-values-after-calling-hardfault_5F00_genhf_5F00_invalid_5F00_fp.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem entering custom hardfault handler</title><link>https://devzone.nordicsemi.com/thread/141109?ContentTypeID=1</link><pubDate>Tue, 24 Jul 2018 08:58:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad5ab1a7-dab7-4aec-adf0-fd2f37db243a</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could it be related to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/35293/how-to-use-hardfault-exception-library/136830#136830"&gt;this&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Can you post a picture showing your CPU register values after calling hardfault_genhf_invalid_fp()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem entering custom hardfault handler</title><link>https://devzone.nordicsemi.com/thread/140853?ContentTypeID=1</link><pubDate>Fri, 20 Jul 2018 14:01:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0089dc90-d2b7-449c-93b1-b71a208d1a4d</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;I removed the accesses to soft device functions from the hardfault handler, so that is no longer an issues.&lt;/p&gt;
&lt;p&gt;However,&amp;nbsp;&lt;span&gt;&amp;quot;hardfault_genhf_invalid_fp();&amp;quot; still doesn&amp;#39;t enter my custom hardfault handler. I&amp;nbsp;have implemented a divide by zero, and that&amp;nbsp;successfully enters my non-default hardfault handler.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you have any idea why&amp;nbsp;&amp;quot;hardfault_genhf_invalid_fp();&amp;quot; doesn&amp;#39;t enter my custom hardfault handler?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you get &amp;quot;hardfault_genhf_invalid_fp();&amp;quot; to enter a&amp;nbsp;custom hardfault handler?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem entering custom hardfault handler</title><link>https://devzone.nordicsemi.com/thread/139843?ContentTypeID=1</link><pubDate>Thu, 12 Jul 2018 09:12:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:793b4ae3-80e7-4028-962d-0ac744842f16</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;As you can see in &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/processor_avail_interrupt_latency/exception_mgmt_sd.html?cp=2_3_1_0_15_1"&gt;this figure&lt;/a&gt;&amp;nbsp;the hard fault handler has higher priority than the Softdevice.&amp;nbsp;So yes, if you stumble upon a hard fault then your Softdevice will be stopped. Unfortunately, that is simply how the hardware works and there is no way to keep the Softdevice alive while dealing with the hard fault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem entering custom hardfault handler</title><link>https://devzone.nordicsemi.com/thread/139748?ContentTypeID=1</link><pubDate>Wed, 11 Jul 2018 14:34:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ee1089e-5e64-4fde-8eae-53fe050b3cb8</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;The files and functions appear to be compiled and included in the application. I can&amp;#39;t currently set breakpoints since we are using Atollic, we started using it before their purchase by ST, and we have issues with setting breakpoints since we are using a bootloader and soft device. I finally got my code to work, I was getting a fault inside &amp;quot;HardFault_c_handler&amp;quot; when I tried to stop the soft device, but the attached code should have worked as well since I wasn&amp;#39;t trying to stop the soft device in it.&lt;/p&gt;
&lt;p&gt;Does the soft device need to be stopped in the hard fault handler, or is it automatically stopped when the hard fault handler is entered?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem entering custom hardfault handler</title><link>https://devzone.nordicsemi.com/thread/139616?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 15:24:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57e7c0d0-f012-4410-8bf4-2eaed04d3ba6</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Are you able to figure out whether the files and functions are actually being compiled and included in your application? I.e. that it is not just all compiled away due to some missing define symbol like DEBUG? Do you see relevant file and function names in the .map file? Or can you set a breakpoint inside your own&amp;nbsp;HardFault_process() function?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem entering custom hardfault handler</title><link>https://devzone.nordicsemi.com/thread/139442?ContentTypeID=1</link><pubDate>Mon, 09 Jul 2018 14:56:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ab179e3-141e-4f9f-8e95-e6004d519c99</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;Following are the changed files. I didn&amp;#39;t upload all the common nRF5_SDK files to save space.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hardfault_5F00_test.zip"&gt;devzone.nordicsemi.com/.../hardfault_5F00_test.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem entering custom hardfault handler</title><link>https://devzone.nordicsemi.com/thread/139426?ContentTypeID=1</link><pubDate>Mon, 09 Jul 2018 13:09:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bd6f6ae-1219-490d-a9ec-3f46eb414cb1</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That is odd. Can you upload your project files?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>