<?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 hard fault when running sd_softdevice_enable</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8125/nrf52-hard-fault-when-running-sd_softdevice_enable</link><description>Received my nRF52 preview board yesterday and have been battling to get my S130 based nRF51 code running on it with the S132 soft device (the code is here: github.com/.../HomeKit including the current state of the NRF52 build under gcc/eclipse). 
 The</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Jul 2015 11:30:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8125/nrf52-hard-fault-when-running-sd_softdevice_enable" /><item><title>RE: nRF52 hard fault when running sd_softdevice_enable</title><link>https://devzone.nordicsemi.com/thread/29165?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 11:30:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88f57b19-5f6f-47e1-9b75-a0f39476b532</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I asked a separate question about this here &lt;a href="https://devzone.nordicsemi.com/question/44476/nrf52-softdevice-s132-use-of-fpu/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The use of the FPU in the SD 132 is unintentional and the requirement should eventually disappear, which is good news.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 hard fault when running sd_softdevice_enable</title><link>https://devzone.nordicsemi.com/thread/29168?ContentTypeID=1</link><pubDate>Sat, 11 Jul 2015 05:59:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22d15a93-db27-4143-b6ad-f17138c6d56c</guid><dc:creator>TimW</dc:creator><description>&lt;p&gt;After more experimenting I found this combination to compile, enable the FPU and not crash in the startup code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;-mfloat-abi=softfp -mfpu=fpv4-sp-d16
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I have some assembly code which, though it doesn&amp;#39;t use floating point, didn&amp;#39;t like the hard float option.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 hard fault when running sd_softdevice_enable</title><link>https://devzone.nordicsemi.com/thread/29167?ContentTypeID=1</link><pubDate>Sat, 11 Jul 2015 05:34:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6107cb5e-a8bd-4853-9c98-b1505acf7cfe</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Hmm - something a bit smelly here - I agree the softdevice shouldn&amp;#39;t need FP support .. unless it&amp;#39;s using some of the vector functions - an answer from Nordic here would help.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;-mfloat-abi=soft 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;can&amp;#39;t be right, I think you need&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;-mfloat-abi=hard -mfpu=fpv4-sp-d16
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;both of those. My guess would be your crash in _start was the compiler compiling some something for the wrong fp unit. Those flags should hopefully trigger the _start code to turn the FPU unit on too.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 hard fault when running sd_softdevice_enable</title><link>https://devzone.nordicsemi.com/thread/29166?ContentTypeID=1</link><pubDate>Sat, 11 Jul 2015 05:23:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb7e85de-cd94-49a8-b6ea-9e2cefaf494a</guid><dc:creator>TimW</dc:creator><description>&lt;p&gt;You&amp;#39;re correct; the FPU does need to be enabled. I hadn&amp;#39;t bothered because I couldn&amp;#39;t imagine the softdevice would be using it and my code doesn&amp;#39;t either. I didn&amp;#39;t realize it was disabled by default to save power. I had to force-enable it however. I tried using the -mfloat-abi=softfp option which appears to enable the system_nrf52.c code, but then my code crashed somewhere in _start. Just forcing the FPU on by hand worked though (not a great long term solution).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 hard fault when running sd_softdevice_enable</title><link>https://devzone.nordicsemi.com/thread/29164?ContentTypeID=1</link><pubDate>Sat, 11 Jul 2015 01:14:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01d67d91-f0d4-4ac1-ad04-95c752ce6b0f</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Is the FPU enabled? It&amp;#39;s a while since I read the FPU unit documentation but I remember most instructions cause a fault if the FPU isn&amp;#39;t. There&amp;#39;s code to enable it in system_nrf52.c&lt;/p&gt;
&lt;p&gt;I am however a little surprised the FPU is used in the softdevice since it&amp;#39;s not required to be enabled and, apart from just generically setting things up to a known state, I can&amp;#39;t see why the softdevice would use it.&lt;/p&gt;
&lt;p&gt;Do you have an address of that instruction, any other addresses in the stack would be handy too, I was going to take a look at the assembler see what&amp;#39;s going on.&lt;/p&gt;
&lt;p&gt;I wish I had more time to play with my 52 devkit .. sigh.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>