<?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>GPIO checking in start-up code, before booting S110 soft device?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8270/gpio-checking-in-start-up-code-before-booting-s110-soft-device</link><description>Hey guys, 
 I’m working on an nRF51822 design where I’d like to check the value of a GPIO at Power-ON, then either shutdown, OR start the BLE stack and do BLE stuff. I really don’t want to have to do a full boot-up, initialization and loading of the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Jul 2015 01:36:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8270/gpio-checking-in-start-up-code-before-booting-s110-soft-device" /><item><title>RE: GPIO checking in start-up code, before booting S110 soft device?</title><link>https://devzone.nordicsemi.com/thread/29790?ContentTypeID=1</link><pubDate>Mon, 20 Jul 2015 01:36:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74825055-0b46-4b04-8d37-8355f3a19aa7</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;No it can&amp;#39;t be done in startup code before the softdevice. All that code, gcc_startup_nrf51.s, main, start .. all is executed after the softdevice startup code runs. The sequence is actually, bootloader, softdevice then you.&lt;/p&gt;
&lt;p&gt;However the bootloader startup (if there isn&amp;#39;t a bootloader) and the softdevice startup don&amp;#39;t really do very much at all, softdevice writes a couple of bytes of memory and then bounces to your startup code, it&amp;#39;s not until you actually call the softdevice init function in your code that it really does any work, so you&amp;#39;re not really saving much anyway.&lt;/p&gt;
&lt;p&gt;if you want the earliest possible hook then a bootloader would be the first code which gets called, write a custom one of those which checks your GPIO and shuts down, or has the usual exit to run through the softdevice init code and then on to your app. Or don&amp;#39;t worry about it, it&amp;#39;s of the order of a few hundred instructions before you get to your code in the normal case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>