<?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>Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1237/why-does-a-do-nothing-main-c-hardfault-when-run-with-a-softdevice</link><description>If you have the most trivial main.c possible, with a main() which does nothing at all, compile, link and load it at 0x00000000, it runs fine and does nothing .. that&amp;#39;s basically the main.c from the template example. 
 If you build the same exact code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Jul 2015 23:30:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1237/why-does-a-do-nothing-main-c-hardfault-when-run-with-a-softdevice" /><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5714?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2015 23:30:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:578cde80-c3b5-4fda-bb78-6d8bae09744e</guid><dc:creator>asifhn</dc:creator><description>&lt;p&gt;Gdb &amp;quot;load&amp;quot; seems to mess up my nordic. Please see &lt;a href="https://devzone.nordicsemi.com/question/6296/command-line-gdb-debugging-symbolsstack-trace/?comment=43993#comment-43993"&gt;link&lt;/a&gt; on my findings.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5713?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2014 21:18:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7df30b6e-09b0-4f4f-9da7-b3c64734f640</guid><dc:creator>Maurits van der Hoorn</dc:creator><description>&lt;p&gt;The SIGTRAP with traceback 0xfffffffe when calling into the softdevice is exactly the issue I was having, albeit on Linux, not windows. I would suggest dropping to command line and with your arm-none-eabi-gdb do the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
$ arm-none-eabi-gdb program.elf
(gdb) target remote :2331
(gdb) load
(gdb) mon reset
(gdb) continue

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This should load the code locally, connect to the JLink device on TCP port 2331, flash the code, reset the device, and run.&lt;/p&gt;
&lt;p&gt;If this works, but eclipse still doesn&amp;#39;t, then the issue is with the debug configuration eclipse is using. For me adding &amp;quot;mon reset&amp;quot; to the &amp;quot;Run Commands&amp;quot; at the very bottom of the &amp;quot;Startup&amp;quot; tab fixed it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5712?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2014 21:05:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f70980d7-8790-48fa-a463-8e05e02a7dfb</guid><dc:creator>Ken A. Rederg&amp;#229;rd</dc:creator><description>&lt;p&gt;The gcc toolchain is not to blame here, ARM has people contributing to the toolchain. The gcc toolchain is a very good toolchain with a proven track record for Intel, AVR, etc.&lt;/p&gt;
&lt;p&gt;The issue is that Nordic has not done any QA at all for the gcc POSIX part of the SDK. This proves it; from nrf51822/Source/templates/gcc/Makefile.common:&lt;/p&gt;
&lt;p&gt;#ifeq ($(OS),Windows_NT)
include $(TEMPLATE_PATH)Makefile.windows
#else
#include $(TEMPLATE_PATH)Makefile.posix
#endif&lt;/p&gt;
&lt;p&gt;This will never work, it works for Windows by luck, the lines starting with # are comments. Seems someone has misunderstood the syntax for makefiles.&lt;/p&gt;
&lt;p&gt;And, the Makefile.posix file does not exist.&lt;/p&gt;
&lt;p&gt;I hope Nordic finds resources to streamline the gcc POSIX part of their SDK; they are almost there, and a engineer at Nordic is trying to get a toolchain working on his spare time: &lt;a href="https://github.com/hlnd/nrf51-pure-gcc-setup"&gt;github.com/.../nrf51-pure-gcc-setup&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;BR,
-Ken.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5711?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2014 20:43:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50d05b48-6c37-48a1-b2c9-aa8f4b7f3b28</guid><dc:creator>Daniel Gochnauer</dc:creator><description>&lt;p&gt;Exactly.  I finally got GDB running, no thanks to the Nordic GCC environment document.  The Nordic app note tells you how to get GDB working, but the app note says to put mon speed 10000 when it should actually be mon speed 1000, only a slight order of magnitude different (in the wrong direction).  Once I got that changed, I was able to get GSB to actually get to &amp;quot;main&amp;quot;, but then the first routine enables the uart interrupt (I think going through softdevice using :
NVIC_ClearPendingIRQ( UART0_IRQn );
NVIC_SetPriority( UART0_IRQn, APP_IRQ_PRIORITY_LOW );
NVIC_EnableIRQ( UART0_IRQn );&lt;/p&gt;
&lt;p&gt;Once I do that, the very next thing is to put a character into the NRF_UART-&amp;gt;TXD and that&amp;#39;s all she wrote.  The next thing is &amp;quot;0xFFFFFFFE&amp;quot; world.  I can&amp;#39;t live with this.  If I can&amp;#39;t debug with reasonable tools, I&amp;#39;m back to the stone ages again.  I&amp;#39;m sure Keil wouldn&amp;#39;t have this problem, but my boss isn&amp;#39;t happy about the price.  We&amp;#39;ve used Keil for test programs and that is fine, it works with softdevice, but my app is much more than the 32k limit.  My code is more like 232k (maybe more) so it&amp;#39;s big bucks for Keil or no bucks for GCC.  But if the tools work (or don&amp;#39;t work), the big bucks wins and I consider that sad.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5710?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2014 20:32:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e673571c-8ef0-4654-9734-af406c04eca9</guid><dc:creator>Ken A. Rederg&amp;#229;rd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m experiencing the same with nrf51_sdk_v5_2_0_39364 and s110_nrf51822_6.0.0 with the same addresses.&lt;/p&gt;
&lt;p&gt;Running gdb the program received SIGTRAP:&lt;/p&gt;
&lt;p&gt;Program received signal SIGTRAP, Trace/breakpoint trap.
0xfffffffe in ?? ()&lt;/p&gt;
&lt;p&gt;Has anyone been able to run the s110 + App with the gcc toolchain ?&lt;/p&gt;
&lt;p&gt;BR,
-Ken.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5709?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2014 18:55:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ccd7e61-dc8e-44b9-961a-8f854460ed57</guid><dc:creator>Daniel Gochnauer</dc:creator><description>&lt;p&gt;I&amp;#39;m having very similar problems.  The code I have actually get to main, where I have a breakpoint set.  I then proceed to single step.  The first routine enables the uart and uart interrupts.  Everything goes well until I put a byte into the uart out register.  This apparently causes an interrupt and GDB jumps to 0xffffffffe (mostly &amp;quot;f&amp;quot;s followed by 1 &amp;quot;e&amp;quot;).  The code runs fine without the debugger.  The code I need to debug is the main application that is not working, but I can&amp;#39;t get past the uart interrupt not being handled properly.  I was thinking that maybe there is a separate thread that could handle the uart interrupt without telling me (GDB non-stop mode?) but Jlink gdbserver says not supported.  There has to be a way to properly hand;le interrupts without getting sigint?  I&amp;#39;m running on windows with GCC, jlink, all latest revisions of software.  I&amp;#39;m not getting anywhere.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5708?ContentTypeID=1</link><pubDate>Tue, 01 Apr 2014 01:20:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa87b8e2-2252-4eec-a74a-984d68ad1b1b</guid><dc:creator>Maurits van der Hoorn</dc:creator><description>&lt;p&gt;I was having the same debugger problems (ooooold Eclipse on Ubuntu 12.04), so I tried using the raw gdb and no issues. I compared what JLinkGDB was logging for both sessions and the main difference was that eclipse wasn&amp;#39;t resetting the device in the same way / time. I added &amp;quot;mon reset&amp;quot; to my debug configuration under &amp;quot;Run Commands&amp;quot; (very bottom of Startup tab) and everything fixed. It even fixed this weird issue I was having with ANT channels not resetting inbetween debug sessions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5702?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2014 00:33:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4aa4ab18-74a4-4137-9500-7c769a499e85</guid><dc:creator>Richard von Lehe</dc:creator><description>&lt;p&gt;I am an idiot, I had one Eclipse workspace that didn&amp;#39;t have the last line of initialization from AN-29 (mon reset 0).  That step is listed in the pdf text, but is obscured in the picture of the eclipse window in that document.  Anyway, adding that line to that Eclipse workspace really does improve things.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5701?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2014 23:16:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99ee26f5-f9bd-4c6c-90ef-32345fa95f17</guid><dc:creator>Richard von Lehe</dc:creator><description>&lt;p&gt;The upper 8kB of RAM being off by default should be taken care of by using the SDK-provided gcc_startup_nrf51.s, correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5706?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2014 23:18:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c4757b8-bdeb-4e18-a0cb-00f0e8165848</guid><dc:creator>Richard von Lehe</dc:creator><description>&lt;p&gt;Is there another thread that deals with the seeming randomness described by the original poster when debugging?  Very often I still see instead of hitting the default breakpoint at main, that the pc ends up at 0xfffffffe.  If I manually step through the startup code where it copies the initialized data to RAM, it almost always works.  It seems like some type of race condition, but I can&amp;#39;t really explain why it&amp;#39;s happening.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5707?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2014 15:51:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7506a156-fce4-4895-bb1f-2d26402c6ff2</guid><dc:creator>Richard von Lehe</dc:creator><description>&lt;p&gt;Yes, I should have mentioned that the project does work.  I might have been confused about the original poster&amp;#39;s main problem.  I thought the original poster was having problems using the debugger to simply hit a breakpoint and that&amp;#39;s the problem I&amp;#39;m having as well.  The behavior when run in the debugger mimics the original question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5705?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2014 15:44:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8867ae3a-f555-4831-b3a2-640472a6993c</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;What exactly is the problem you&amp;#39;re seeing with this? When just compiling it and flashing from the command line, everything seems to be working as expected, and I can&amp;#39;t see any HardFaults.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5704?ContentTypeID=1</link><pubDate>Thu, 23 Jan 2014 23:17:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2b8369d-357b-4152-bbcd-d02ff6f42bd5</guid><dc:creator>Richard von Lehe</dc:creator><description>&lt;p&gt;Here&amp;#39;s the ble_app_lbs project that I modified all zipped up.  It should include the eclipse project, the makefile it&amp;#39;s built with, and all source except a few SDK includes.  I&amp;#39;m using SDK 4.4 and BLE stack v5 for this one.&lt;/p&gt;
&lt;p&gt;Let me know if there&amp;#39;s anything else I can provide.  This one has me a bit stumped right now.&lt;/p&gt;
&lt;p&gt;The Makefile is hacked from another project and something is messed up with dependencies such that a clean is necessary.  The following sequence works for me:&lt;/p&gt;
&lt;p&gt;make clean
make debug (or make release)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_lbs.zip"&gt;ble_app_lbs.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5703?ContentTypeID=1</link><pubDate>Thu, 23 Jan 2014 23:10:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57bf8394-50c5-41da-af22-806151f13bed</guid><dc:creator>Richard von Lehe</dc:creator><description>&lt;p&gt;I cam back to try command-line GDB connecting to the J-link GDB server today.  I am able to connect, but I get similar problems:&lt;/p&gt;
&lt;p&gt;(gdb) break main
Breakpoint 1 at 0x14774: file barebones.c, line 265.
(gdb) target remote localhost:2331
Remote debugging using localhost:2331
Error in re-setting breakpoint 1: Cannot access memory at address 0x14774
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x00000000 in ?? ()
(gdb)&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll take you up on the offer to look at my project.  What&amp;#39;s the best way to share a project?  Zip it up and attach it to one of these posts?  I&amp;#39;ll do that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5700?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2014 17:52:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1af90ec8-389b-4cdf-8930-5dc4d32dbba5</guid><dc:creator>Richard von Lehe</dc:creator><description>&lt;p&gt;I saw Jim&amp;#39;s suggestion that worked for him, switching from the DSF to the Standard GDB launcher. I tried that and it reported &amp;quot;Error creating session&amp;quot;. I was worth a try, I agree. I&amp;#39;ll give the command-line gdb a try. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5699?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2014 16:50:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95c32616-9519-4004-b1f0-b8d0b9db9b3a</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Running gdb on the command line is easy, and shouldn&amp;#39;t take you more than 3 minutes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start the GDB server, make sure to select the correct device, interface and interface frequency (nRF51822, SWD, 1000 kHz).&lt;/li&gt;
&lt;li&gt;Open a shell of some kind.&lt;/li&gt;
&lt;li&gt;Navigate to your project folder (i.e. where you have your .out/.elf file).&lt;/li&gt;
&lt;li&gt;Start GDB, passing the file as an argument (arm-none-eabi-gdb _build/ble_app_hrs_s110.out or similar).&lt;/li&gt;
&lt;li&gt;Once GDB has started, connect to the GDB server by writing &amp;quot;target remote localhost:2331&amp;quot; and pressing enter.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Also, did you try out the Eclipse trick I linked to above? Should be worth a try at least. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5698?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2014 16:42:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:167224fa-e7cc-4b4b-aa28-8de2cde1f5dc</guid><dc:creator>Richard von Lehe</dc:creator><description>&lt;p&gt;I must admit that I&amp;#39;ve never used gdb on the command line - at least not in Windows.  I&amp;#39;m going to come back to this a bit later after I make sure I understand the ble_app_lbs app a bit better and do some debugging via a scope.  I hate to give up on using gdb for long, but the boss doesn&amp;#39;t want to let me spend the time to get it working properly at this point.  &lt;em&gt;sigh&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5697?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2014 10:21:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc639b93-c39e-41e3-863a-f6780b8c4b0b</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Have you tried running gdb from the command line? I often find this a usable first step, since Eclipse often seems to complicate things. Also, you can try taking a look on this:
&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/eclipse" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/eclipse&lt;/a&gt;,-gdb,-macos-so-close&lt;/p&gt;
&lt;p&gt;If you have further problems, can you please share the complete project you&amp;#39;re working with, so I can test it here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5696?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2014 23:21:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46b5c39a-b43c-4e6d-a728-4771a8cf96d7</guid><dc:creator>Richard von Lehe</dc:creator><description>&lt;p&gt;I&amp;#39;m interested in this thread as I see the same thing (or something very similar) myself.  When I let things run with no breakpoints, I see the debugger stop with a signal SIGTRAP 0xfffffffe in ?? ()&lt;/p&gt;
&lt;p&gt;The call stack shows Reset_Handler().  The line that somehow changes the program counter to 0xfffffffe is the BLX R0, where the previous line is LDR R0, =SystemInit&lt;/p&gt;
&lt;p&gt;It seems straightforward so I&amp;#39;m puzzled as to what&amp;#39;s happening.  The softdevice is loaded and the application is correctly linked such that it resides at 0x14000 and doesn&amp;#39;t use RAM below 0x20002000.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5695?ContentTypeID=1</link><pubDate>Fri, 03 Jan 2014 10:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e8087cf-dbf8-4135-9de9-122706c259fa</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Could you please update your question and share the project and files that you&amp;#39;re working with? I can&amp;#39;t say I&amp;#39;ve seen this when I&amp;#39;ve worked with GCC myself, so I&amp;#39;m having some trouble understanding what might be the cause of it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5694?ContentTypeID=1</link><pubDate>Thu, 02 Jan 2014 14:51:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0023651-2f76-4b15-9602-d89bfca8c1eb</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Let me try to ask the question differently.&lt;/p&gt;
&lt;p&gt;I have the template example from the gcc folder. The ordinary one, not the ble template which is really quite full featured, just the one with main.c, system_nrf51.c and gcc_startup_nrf51.s. Those three, from the SDK, nothing else.&lt;/p&gt;
&lt;p&gt;If I compile that, link it and load it on a blank chip at 0x00000000, it runs, you can debug into main().&lt;/p&gt;
&lt;p&gt;if I compile that same thing, link it up at 0x14000 (using one of the other templates in the SDK with the correct Flash and RAM settings), load on a soft device (110) and then load that code at 0x14000, it HardFaults.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand why. I have debugged into the Reset_Handler, it&amp;#39;s running, it powers up the RAM, it starts copying, it&amp;#39;s just running the Reset_Handler code in gcc_startup_nrf51.s as normal. If you single step it all the way (a 20 minute job) to main(), it gets to main(), normally. If you let it run, it doesn&amp;#39;t ever get there, it ends up in the HardFault handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does a do-nothing main.c HardFault when run with a softdevice?</title><link>https://devzone.nordicsemi.com/thread/5693?ContentTypeID=1</link><pubDate>Thu, 02 Jan 2014 14:36:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28601ae4-9b88-44a3-be9c-6c30b279039c</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;You should make sure that you use the correct system files, for example from the official SDK. The upper 8 kB of RAM is off by default on the nRF51, so if you try to use it without first having enabled it, you&amp;#39;ll see a HardFault.&lt;/p&gt;
&lt;p&gt;Also beware that we have &lt;a href="https://www.nordicsemi.com/eng/content/download/16271/261587/file/nAN-29%20%20nRF51%20Development%20with%20GCC%20and%20Eclipse%20Application%20Note%20v1.1.pdf"&gt;an application note showing how to work with Eclipse&lt;/a&gt;, and you may also have use in taking a look at &lt;a href="https://github.com/hlnd/nrf51-pure-gcc-setup"&gt;this GitHub repository&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>