<?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>How to enter DFU Mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13771/how-to-enter-dfu-mode</link><description>Apart from pressing Button 4 or adding a DFU service to current running application. Is there any way to enter DFU mode from application? 
 Is it possible with nrfutil to move from application to DFU Mode, Update the image.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 May 2016 17:08:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13771/how-to-enter-dfu-mode" /><item><title>RE: How to enter DFU Mode</title><link>https://devzone.nordicsemi.com/thread/52625?ContentTypeID=1</link><pubDate>Wed, 11 May 2016 17:08:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0854cfd-98c0-4bbc-935d-bf285a2021d2</guid><dc:creator>Christopher</dc:creator><description>&lt;p&gt;Both approaches are possible. Depending on the BLE connection parameters, the timeout can be several seconds. I always prefer to correctly close a BLE connection.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter DFU Mode</title><link>https://devzone.nordicsemi.com/thread/52624?ContentTypeID=1</link><pubDate>Wed, 11 May 2016 16:56:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6e8b375-d522-41df-993b-876e4db2fbf8</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Not sure I agree with that. It makes sense if you are doing the &amp;quot;soft reset&amp;quot; where you enter the bootloader by jumping into the bootloaders entry point instead of doing a chip reset. However, if you are doing a chip reset the stack is going to be coming up from scratch and any connection you had will be taken down by a connection supervisor timeout. Just seems like additional complexity if you are doing a chip reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter DFU Mode</title><link>https://devzone.nordicsemi.com/thread/52623?ContentTypeID=1</link><pubDate>Wed, 11 May 2016 16:23:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54654650-3155-4ee2-a018-3fb5b59e2021</guid><dc:creator>Christopher</dc:creator><description>&lt;p&gt;Before resting to the bootloader mode, you should prepare the reset. Calling directly the &lt;code&gt;NVIC_SystemReset();&lt;/code&gt; method is not a good option IMO:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void reset_prepare(void) {
  uint32_t err_code;

  // Change a LED state

  // Disconnect from BLE peer if connected
  // If not connect, stop advertising if enabled

  err_code = ble_conn_params_stop();
  APP_ERROR_CHECK(err_code);
}

// Disable the SoftDevice and restart properly in bootloader mode
void bootloader_start() {
  // A &amp;quot;simple&amp;quot; reset is not enough, the SD and IRQs must be disabled first
  ble_dfu_evt_t evt;
  memset(&amp;amp;evt, 0, sizeof(evt));
  evt.ble_dfu_evt_type = BLE_DFU_START;
  dfu_app_on_dfu_evt(&amp;amp;m_dfus, &amp;amp;evt);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In my case, I generate a &lt;code&gt;ble_dfu_evt_t&lt;/code&gt; event to restart properly in bootloader mode. I also use the &lt;code&gt;reset_prepare&lt;/code&gt; function to close a BLE connection or stop advertising before entering in bootloader mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter DFU Mode</title><link>https://devzone.nordicsemi.com/thread/52628?ContentTypeID=1</link><pubDate>Wed, 11 May 2016 13:07:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bdb2f37-7bc4-4944-b463-82397edebdce</guid><dc:creator>John</dc:creator><description>&lt;p&gt;My post above was discussing changes needed in the device FW. It shouldn&amp;#39;t impact the python script I don&amp;#39;t think.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter DFU Mode</title><link>https://devzone.nordicsemi.com/thread/52630?ContentTypeID=1</link><pubDate>Wed, 11 May 2016 13:07:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c414f50-6834-4fca-8ff7-95a29e082031</guid><dc:creator>John</dc:creator><description>&lt;p&gt;This is pretty close to what I am doing as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter DFU Mode</title><link>https://devzone.nordicsemi.com/thread/52629?ContentTypeID=1</link><pubDate>Wed, 11 May 2016 12:55:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88ea5def-8029-47b4-94f5-cb2ec1b9fc89</guid><dc:creator>Sven</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I am using SDK10 nRF51 and dual boot S310 version of the DFU.&lt;/p&gt;
&lt;p&gt;Also i do not intend to share information and I do not have BLE stack set up in my app (using ANT)&lt;/p&gt;
&lt;p&gt;Two steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In my app call the following:&lt;/p&gt;
&lt;p&gt;NRF_POWER-&amp;gt;GPREGRET = 0xB1;
NVIC_SystemReset();&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(You can disable the option at all or do something else)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;in /examples/dfu/bootloader/main.c&lt;/p&gt;
&lt;p&gt;I simply disabled the check inside &lt;strong&gt;ble_stack_init()&lt;/strong&gt; by removing the &lt;strong&gt;if (init_softdevice)&lt;/strong&gt;. I need to always startup the SD since I do not have it enabled in my app and I am doing complete reset in step 1.&lt;/p&gt;
&lt;p&gt;Also I disabled anything that is connected to GPIO since on my custom board I do not have buttons etc...&lt;/p&gt;
&lt;p&gt;So at the end of the day bootloader(DFU) always starts first, checks the GPREGRET register. If it matches the magic value, voilaa.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter DFU Mode</title><link>https://devzone.nordicsemi.com/thread/52627?ContentTypeID=1</link><pubDate>Wed, 11 May 2016 12:47:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:913b0c00-bb10-4bca-a01c-944146c603af</guid><dc:creator>Siva Subrahmanyam</dc:creator><description>&lt;p&gt;So from nrfutil python script  i should set GPREGRET register. i am using  example/dfu/bootloader souce code on PCA10001 evaluation kit with s120 softdevice. What are the changes needed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter DFU Mode</title><link>https://devzone.nordicsemi.com/thread/52626?ContentTypeID=1</link><pubDate>Wed, 11 May 2016 12:31:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4c1d9bb-c490-4b35-8d98-2bd124df400a</guid><dc:creator>John</dc:creator><description>&lt;p&gt;The short answer is yes. The newer SDKs provide some very nice features for entering the bootloader without a button or even a reset. Which allows sharing of bonding information, or avoiding bonding being an issue for the bootloader. That said, you don&amp;#39;t have to use all of that. In our case we didn&amp;#39;t need the functionality and in fact it was causing some problems due to the fact that there wasn&amp;#39;t a system reset to stop other portions of our system. So, I simplified bootload entry to just setting the GPREGRET register and doing a system reset. It required changes in the bootloader, but you have the source code so you can modify it to your needs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>