<?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>Switch to BLE DFU mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53673/switch-to-ble-dfu-mode</link><description>Hello ! 
 I have two devices with the same firmware, to switch in DFU mode I call this function : 
 
 
 On the first device, I reset in BLE DFU mode. 
 On the others devices I reset in normal mode ... But I can read 0xB1 in NRF_POWER-&amp;gt;GPREGRET register</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Oct 2019 06:53:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53673/switch-to-ble-dfu-mode" /><item><title>RE: Switch to BLE DFU mode</title><link>https://devzone.nordicsemi.com/thread/217233?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 06:53:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0d0186f-fab1-46be-aa84-309cf7917798</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Great that you figurued it out :-)&lt;/p&gt;
&lt;p&gt;Good luck with the further development!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switch to BLE DFU mode</title><link>https://devzone.nordicsemi.com/thread/217103?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 13:51:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:609a9295-6ede-418b-a1ff-998187b37e0c</guid><dc:creator>Automne</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;The DFU secure_bootloader was flash only on my olds devices but not on the new one. That&amp;#39;s why I could not start in DFU mode. &lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry for bother you for that kind of problems, thanks for your patience.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Automn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switch to BLE DFU mode</title><link>https://devzone.nordicsemi.com/thread/217093?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 13:24:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24a1f0ee-e980-43d3-87da-fe2b4146d5a5</guid><dc:creator>Automne</dc:creator><description>&lt;p&gt;Hi again Andreas, &lt;/p&gt;
&lt;p&gt;I added NRF_TIMER0-&amp;gt;EVENTS_COMPARE[0]; before system_reset(), but it does not change anything.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Automn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switch to BLE DFU mode</title><link>https://devzone.nordicsemi.com/thread/217048?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 11:50:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef8e5250-73bd-4c22-a02a-8e8cfc097869</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi again Automn.&lt;/p&gt;
&lt;p&gt;Could you try to add a read event before system_reset(); ?&lt;/p&gt;
&lt;p&gt;For example something like&lt;/p&gt;
&lt;p&gt;(void)NRF_TIMER0-&amp;gt;EVENTS_COMPARE[0];&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switch to BLE DFU mode</title><link>https://devzone.nordicsemi.com/thread/216854?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 12:55:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07e9dfa8-645b-462d-b08a-193dc7078b17</guid><dc:creator>Automne</dc:creator><description>&lt;p&gt;Thanks for the quick answer,&lt;/p&gt;
&lt;p&gt;I try with your code, I get set same result.&lt;/p&gt;
&lt;p&gt;I also replace the code with nrf_function :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void system_reset_to_dfu(void)
{
    nrf_power_gpregret_set(0xB1);
    __DSB();
    system_reset();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s the same, DFU work on my old device, but not on the new one.&lt;/p&gt;
&lt;p&gt;At the restart I can read 0xB1 in the register :&lt;pre class="ui-code" data-mode="text"&gt;log_info(&amp;quot;NRF_POWER-&amp;gt;GPREGRET = 0x%x&amp;quot;, nrf_power_gpregret_get());

INFO - NONE - 0 - NRF_POWER-&amp;gt;GPREGRET = 0xb1␊&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do I need to defined something in sdk_config.h ?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Automn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switch to BLE DFU mode</title><link>https://devzone.nordicsemi.com/thread/216816?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 11:49:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:106ace64-d6d7-4acd-aa85-351bf1e173d4</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I think the issue is that you&amp;#39;re not forcing memory write before you write to the same register twice.&lt;/p&gt;
&lt;p&gt;Try this instead:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void system_reset_to_dfu(void)
{
    NRF_POWER-&amp;gt;GPREGRET = 0;
    __DSB();
    NRF_POWER-&amp;gt;GPREGRET = 0xB1;
    system_reset();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But why would you set it to 0 in the first place?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>