<?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 Handler implementation library - not getting NRF_LOG_ERROR info</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41046/hardfault-handler-implementation-library---not-getting-nrf_log_error-info</link><description>Good morning everyone, 
 
 I am implementing a custom radio protocol on NRF52 without using the SoftDevice at the moment. For some reason, I get a HardFault which I am trying to understand. 
 I am working on an NRF52832 dev board with the JLink attached</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 Dec 2018 15:27:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41046/hardfault-handler-implementation-library---not-getting-nrf_log_error-info" /><item><title>RE: Hardfault Handler implementation library - not getting NRF_LOG_ERROR info</title><link>https://devzone.nordicsemi.com/thread/160624?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 15:27:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e9b1659-e82a-4032-869a-b4107c895f9b</guid><dc:creator>lbe</dc:creator><description>&lt;p&gt;Just to close the bug report....I was able to finally fix the problem. The hardfault was an unauthorized memory access due to the fact that I put a wrong valueas&amp;nbsp;PACKET_PAYLOAD_MAXSIZE on the radio configuration. This was causing problems to the DMA and was messing things up.&lt;/p&gt;
&lt;p&gt;Now that I put the correct value the hardfault is not happening again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault Handler implementation library - not getting NRF_LOG_ERROR info</title><link>https://devzone.nordicsemi.com/thread/160133?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2018 08:19:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecb08676-f316-435d-b13a-c572daa83207</guid><dc:creator>lbe</dc:creator><description>&lt;p&gt;Well, this is getting weirder and weirder....I&amp;#39;ll describe you what happens. So, I enabled the log module (I am using RTT, with a dev board connected to the computer and the SES in debug mode) and I changed the compiler optimization level. Here I obtain the first weird behavior: if the optimization level in SES is set to &amp;quot;Debug&amp;quot; (I don&amp;#39;t see the &amp;quot;level 0&amp;quot; among the options) I don&amp;#39;t have an Hardfault. I tried restarting several times and I never end in the hardfault routine. If I change the optimization level to &amp;quot;None&amp;quot;,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;sometimes I fall in the hardfault routine, BUT&lt;/p&gt;
&lt;p&gt;- when the code stops at the beginning of the assembler code (in hardfault_handler_gcc.c), if I press the &amp;quot;continue&amp;quot; button of the debugger (green arrow), then my code resumes execution: I never get to the breakpoint I set in the hardfault_implementation.gcc file&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;- If I go step by step by pressing F10, sometimes I get to the hardfault_implementaion breakpoint, where the p-&amp;gt;stack is 0 and apparently the cfsr_msg is number [18] = &amp;quot;The processor has attempted an illegal load of EXC_RETURN to the PC, as a result of an invalid context, or an invalid EXC_RETURN value&amp;quot;&lt;/p&gt;
&lt;p&gt;Sometimes, though, even if I go step by step, I end in&amp;nbsp;nrf_log_backend_panic_set (in nrf_log_backend_interface), which seems to be related to a problem with the logger module?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am completely lost,so I wait for clues on how to proceed. Thanks a lot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault Handler implementation library - not getting NRF_LOG_ERROR info</title><link>https://devzone.nordicsemi.com/thread/160046?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 15:48:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17efa9bc-437b-4ee3-8068-9c38f75a0b1c</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Aah. That whole section will get optimized out by the compiler. You need to enable the log module and set the compiler optimization level to 0. Are you using RTT or UART as the backend for the log module?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault Handler implementation library - not getting NRF_LOG_ERROR info</title><link>https://devzone.nordicsemi.com/thread/160041?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 15:36:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fe75189-ce9d-4134-842a-06b2d7c35de6</guid><dc:creator>lbe</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks for your reply. Actually, I already tried what you suggested, but line 109 is not accepted as a valid breakpoint (the question mark you see on the left side of the code in Segger Embedded Studio). So, I put a breakpoint on a couple of line before [&amp;nbsp;uint32_t cfsr = SCB-&amp;gt;CFSR;].&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The problem is that the debugger correctly halts there, but then if I go through step by step, the debugger goes directly to line 148 [NRF_BREAKPOINT_COND;].&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And if I try to read the p_stack information, it is always empty (0x000000).&lt;/p&gt;
&lt;p&gt;I figured a way to&amp;nbsp;temporarily avoid the Hardfault by changing a parameter in my protocol, but it is not a final solution, so I definitely need to understand what kind of hardfault I am getting so that I can find a solution.&lt;/p&gt;
&lt;p&gt;Any other clue on how to obtain this information?&lt;/p&gt;
&lt;p&gt;Thank you&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault Handler implementation library - not getting NRF_LOG_ERROR info</title><link>https://devzone.nordicsemi.com/thread/160031?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 15:17:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb9603e9-c0a4-4cc4-813d-f2d5b3d41a55</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Put a breakpoint on line 109 of hardfault_implementation.c (SDK15.2) and step through the code to find the hardfault cause. You might want to disable the log module if you get stuck because of Its problems, they might be another symptom of your issue or a completely separate issue that we can handle after we&amp;#39;ve solved the hardfault issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>