<?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>S120  Hard Fault in softdevice_handler_init  - IAR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2488/s120-hard-fault-in-softdevice_handler_init---iar</link><description>I&amp;#39;m trying to bring up a basic S120 application on PCA10001 based on the multilink central example, using the IAR toolchain. 
 I&amp;#39;ve programmed the S120 device using 1.0.0_3 using the batch file.
I&amp;#39;ve used a custom linker file for embedded workbench</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 May 2014 11:14:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2488/s120-hard-fault-in-softdevice_handler_init---iar" /><item><title>RE: S120  Hard Fault in softdevice_handler_init  - IAR</title><link>https://devzone.nordicsemi.com/thread/10006?ContentTypeID=1</link><pubDate>Fri, 09 May 2014 11:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45e891c5-9d36-4d99-91bd-8a1090d033c2</guid><dc:creator>Phil Beeson</dc:creator><description>&lt;p&gt;OK - so replying to my own question, in the hope that this is useful to someone else....&lt;/p&gt;
&lt;p&gt;The problem does seem to be related to the CSpy debugger.  Having turned on jlink debugging, I can see that the IDE resets the processor, halts it, then amongst other things it reads the initial stack pointer address and reset vector and sets these manually in the appropriate registers.  Because it only knows about the modified application vector table, it just sets up the application start address and thus completely skips the soft device startup code.&lt;/p&gt;
&lt;p&gt;This also explains why I saw failures the first time I ran my peripheral application using the SD110, though that worked after a reset.&lt;/p&gt;
&lt;p&gt;I guess I need to get my head around CSPY macros now to fix this.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;T55B0 000:695 JLINK_Reset() -- CPU_ReadMem(4 bytes @ 0x200005BC) -- CPU_WriteMem(4 bytes @ 0x200005BC) -- CPU_WriteMem(4 bytes @ 0xE000EDF0) -- CPU_WriteMem(4 bytes @ 0xE000EDFC) &amp;gt;0x35 TIF&amp;gt; -- CPU_WriteMem(4 bytes @ 0xE000ED0C) -- CPU_ReadMem(4 bytes @ 0xE000EDF0) -- CPU_ReadMem(4 bytes @ 0xE000EDF0) -- CPU_WriteMem(4 bytes @ 0xE000EDF0) -- CPU_WriteMem(4 bytes @ 0xE000EDFC) -- CPU is running -- CPU_ReadMem(4 bytes @ 0xE000EDF0) -- CPU_WriteMem(4 bytes @ 0xE0002000) (0020ms, 0448ms total)
T55B0 000:715 JLINK_IsHalted()  returns TRUE (0000ms, 0448ms total)
T55B0 000:715 JLINK_ReadMemU32(0x00018000, 0x0001 Items, ...) -- Read from flash cache (4 bytes @ 0x00018000) -- Data:  F0 38 00 20  returns 0x01 (0000ms, 0448ms total)
T55B0 000:715 JLINK_ReadMemU32(0x00018004, 0x0001 Items, ...) -- Read from flash cache (4 bytes @ 0x00018004) -- Data:  85 AD 01 00  returns 0x01 (0000ms, 0448ms total)
T55B0 000:715 JLINK_ReadRegs(NumRegs = 1, Indexes: 15) -- R15 (PC)=0x630  returns 0x00 (0000ms, 0448ms total)
T55B0 000:715 JLINK_WriteReg(R15 (PC), 0x0001AD84)  returns 0x00 (0000ms, 0448ms total)
T55B0 000:715 JLINK_ReadRegs(NumRegs = 1, Indexes: 17) -- MSP=0x708  returns 0x00 (0000ms, 0448ms total)
T55B0 000:715 JLINK_ReadRegs(NumRegs = 1, Indexes: 18) -- PSP=0xFFFFFFFC  returns 0x00 (0000ms, 0448ms total)
T55B0 000:715 JLINK_ReadRegs(NumRegs = 1, Indexes: 20) -- CFBP=0x00  returns 0x00 (0000ms, 0448ms total)
T55B0 000:715 JLINK_WriteReg(MSP, 0x200038F0)  returns 0x00 (0000ms, 0448ms total)
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>