<?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>Bootloader doesn&amp;#39;t load application on power-on</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20698/bootloader-doesn-t-load-application-on-power-on</link><description>I have a small problem with my bootloader + application on NRF52832. I&amp;#39;m using SDK 12.2.0 with S132 v3.0.0. 
 When the device loses power, and power is then re-applied, the bootloader doesn&amp;#39;t start the application. If I however issue a reset through</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 May 2017 13:51:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20698/bootloader-doesn-t-load-application-on-power-on" /><item><title>RE: Bootloader doesn't load application on power-on</title><link>https://devzone.nordicsemi.com/thread/80741?ContentTypeID=1</link><pubDate>Tue, 23 May 2017 13:51:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f6c0a36-912c-47d3-8ca6-544d5bdfadc8</guid><dc:creator>dingari</dc:creator><description>&lt;p&gt;Hi Hung Bui, I finally got around to debugging this. I posted an answer below.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader doesn't load application on power-on</title><link>https://devzone.nordicsemi.com/thread/80742?ContentTypeID=1</link><pubDate>Tue, 23 May 2017 13:50:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66afcc0f-a6a6-4455-bd96-9cff63b478e0</guid><dc:creator>dingari</dc:creator><description>&lt;p&gt;Well, I think I finally found the culprit.&lt;/p&gt;
&lt;p&gt;I use hardware debouncing for the buttons on my board (couple of resistors and a capacitor). During initial power up of the board, the capacitor might not be fully charged by the time &lt;code&gt;nrf_dfu_enter_check&lt;/code&gt; is called, leading the application to read a low level on the bootloader button pin, and thus staying in bootloader mode.&lt;/p&gt;
&lt;p&gt;On my board a 100nF capacitor is initially charged through 200 kOhms, so a 20ms delay (&lt;code&gt;100*10^(-9) * 200*10^3&lt;/code&gt;) at the top of &lt;code&gt;main&lt;/code&gt; in my bootloader code is sufficient to make this problem go away.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Screenshot-from-2017_2D00_05_2D00_23-13_2D00_48_2D00_07.png" alt="Debouncing circuit" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader doesn't load application on power-on</title><link>https://devzone.nordicsemi.com/thread/80740?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2017 11:39:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4107a0d0-4a06-4140-9247-700e3996b7e9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;You can also think of using logging debug, such as printing something out on UART/RTT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader doesn't load application on power-on</title><link>https://devzone.nordicsemi.com/thread/80738?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 18:36:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e4dca6a-ddd5-4466-8d09-9f7259a49889</guid><dc:creator>dingari</dc:creator><description>&lt;p&gt;I understand that it doesn&amp;#39;t think my application is valid. But I&amp;#39;m failing to see why it then suddenly thinks it&amp;#39;s valid after a reset through SWD.&lt;/p&gt;
&lt;p&gt;The DFU procedure works as expected and the application starts normally after that. If I put the device in OFF mode, and wake it up, the bootloader loads the application. The only time where the bootloader doesn&amp;#39;t load the application is if it loses power.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll see if I can re-produce this behaviour in with GDB (I&amp;#39;ll need to catch the first power on).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader doesn't load application on power-on</title><link>https://devzone.nordicsemi.com/thread/80737?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 17:05:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:774a2aec-0ef9-4852-a85d-5e59f60220c4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;If it advertise as DFUTarg and doesn&amp;#39;t enter  your application, meaning it thinks that the application is not valid. This could be due to CRC mismatch.&lt;/p&gt;
&lt;p&gt;Do you do any flash operation in your application ?&lt;/p&gt;
&lt;p&gt;Please step into bootloader code and check the return value of nrf_dfu_app_is_valid() inside nrf_dfu_init().&lt;/p&gt;
&lt;p&gt;Could you test doing DFU with any of our example for example the ble_app_hrs .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader doesn't load application on power-on</title><link>https://devzone.nordicsemi.com/thread/80735?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 14:22:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c43a9d3-058d-4ab8-9ea4-fd385a0447ee</guid><dc:creator>dingari</dc:creator><description>&lt;p&gt;Hi, I said before that the bootloader starts advertising as DFUTARG.&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t had the chance to debug the bootloader yet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader doesn't load application on power-on</title><link>https://devzone.nordicsemi.com/thread/80736?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 14:18:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1968cbb9-cf1f-4a82-8dfd-180424fe489c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please give information on this:&lt;/p&gt;
&lt;p&gt;When the bootloader didn&amp;#39;t start application what did it do ?Would it advertise as DFUTarg ? Or it&amp;#39;s simply bricked ?&lt;/p&gt;
&lt;p&gt;Have you tried to debug the bootloader ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader doesn't load application on power-on</title><link>https://devzone.nordicsemi.com/thread/80734?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 10:22:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c29663c2-5b0c-421b-9e81-7b1d1828c534</guid><dc:creator>dingari</dc:creator><description>&lt;p&gt;Hi, the device starts in the bootloader advertising as DFUTARG. There are two ways I can get it out of bootloader mode: Do a DFU update or issue a reset through SWD.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader doesn't load application on power-on</title><link>https://devzone.nordicsemi.com/thread/80739?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 10:18:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f51e6220-ffbf-4505-8564-fdf987997be0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How does the application start at the first place? I assume it only start on the first run if you do DFU update but not if you do a power rest after that ?&lt;/p&gt;
&lt;p&gt;When the bootloader didn&amp;#39;t start application what did it do ?Would it advertise as DFUTarg ? Or it&amp;#39;s simply bricked ?&lt;/p&gt;
&lt;p&gt;You may want to check what happened inside the bootloader, simply debug it, add a breakpoint in main and step the code (you may need to put optimization level to 0 )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>