<?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>sd_softdevice_enable HardFault</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45838/sd_softdevice_enable-hardfault</link><description>The Problem: HardFault within sd_softdevice_enable. With HardFault breakpoint enabled, the debugger halts at address 0x8C8. With this breakpoint disabled, breakpoints after sd_softdevice_enable are not reached. 
 Hardware: PCA10040 eval board (nRF52832</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Apr 2019 18:25:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45838/sd_softdevice_enable-hardfault" /><item><title>RE: sd_softdevice_enable HardFault</title><link>https://devzone.nordicsemi.com/thread/180856?ContentTypeID=1</link><pubDate>Mon, 08 Apr 2019 18:25:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35a390c6-f586-43d9-bdf4-05af231ea08d</guid><dc:creator>Chris Ergo</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;It works now. Thank you for the useful information. Comparing the .map files, I determined that the following need to be added to the list of c_preprocessor_definitions for the project:&lt;/p&gt;
&lt;p&gt;NRF_SD_BLE_API_VERSION=6;S132;SOFTDEVICE_PRESENT;&lt;br /&gt;&lt;br /&gt;Chris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_softdevice_enable HardFault</title><link>https://devzone.nordicsemi.com/thread/180723?ContentTypeID=1</link><pubDate>Mon, 08 Apr 2019 11:31:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95e20ab2-74a1-4b6c-800d-9b51aab1aa0d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;0x8C8 is the address of the Hard fault handler inside the MBR. This handler&amp;nbsp;is responsible for forwarding the IRQ to the Softdevice&amp;nbsp;which will then forward it to the app, as long as the hard fault&amp;nbsp;breakpoint is disabled in SES.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]The instruction before the one where it halted (0x8C6) is &amp;quot;bx lr&amp;quot;, and lr has an invalid address in it (0xfffffff9).[/quote]
&lt;p&gt;This is actually&amp;nbsp;a legal&amp;nbsp;LR value. Please refer to this link for more details (table 2.17):&amp;nbsp;&lt;a href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0552a/Babefdjc.html#BABDBEII"&gt;http://infocenter.arm.com/help/topic/com.arm.doc.dui0552a/Babefdjc.html#BABDBEII&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Single-stepping through the SVC call (in my project or ble_app_blinky) doesn&amp;#39;t seem to work right. Is that a limitation of the SVC instruction, or are breakpoints always disabled in supervisor mode?[/quote]
&lt;p&gt;The Softdevice will raise an assert if you start single stepping through the code after enabling the Softdevice. The reason for this is that timers used for time-keeping internally are not halted when you hit a breakpoint, only&amp;nbsp;the CPU is. So the protocol&amp;nbsp;stack will detect that it&amp;#39;s not meeting its real-time&amp;nbsp;requirements and trigger an assert (error info will be forwarded to the app through the app error handler).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I suspect this has to do with your linker configurations. I would suggest that you compare the *.map&amp;nbsp;file from your build against the one from ble_app_blinky and&amp;nbsp;check if you use the same RAM start address (&lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_Spec/s132/latest/SDS/s1xx/mem_usage/mem_resource_map_usage"&gt;memory layout with softdevice&lt;/a&gt;).&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>