<?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>DFU on one button device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47672/dfu-on-one-button-device</link><description>Hi there, 
 I&amp;#39;m trying to get a one button nrf52832 device to behave like the following: 
 1. Button press short: RESET or WAKE (depending on POWER state) 
 2. Button press long: POWEROFF 
 3. Button pressed while being connected to power source: DFU</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 May 2019 09:22:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47672/dfu-on-one-button-device" /><item><title>RE: DFU on one button device</title><link>https://devzone.nordicsemi.com/thread/190219?ContentTypeID=1</link><pubDate>Fri, 31 May 2019 09:22:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dceffd7-6a45-4b2d-afe5-dedd567252c1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I see, thanks. I suggest that you step through the&amp;nbsp;dfu_enter_check() function to see where &amp;#39;true&amp;#39; is being returned if you want to debug this further. Maybe the gpregret&amp;nbsp;flag wasn&amp;#39;t cleared?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU on one button device</title><link>https://devzone.nordicsemi.com/thread/189853?ContentTypeID=1</link><pubDate>Wed, 29 May 2019 11:30:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0508cb76-382c-4a73-a769-429aaad531aa</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;Well, I use the same button for entering the DFU and for waking up the device. The device should only go into DFU mode if the restart was caused by a power cycle. In order to distinguish the restart after deep sleep from a power cycle I check RESETREAS in the bootloader.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU on one button device</title><link>https://devzone.nordicsemi.com/thread/189266?ContentTypeID=1</link><pubDate>Mon, 27 May 2019 10:13:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f8d0dd7-0d76-42ce-805b-534458239441</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Not sure I understand why it helps to check the RESTETREAS register helps. Do you have PINRESET enabled on this pin?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU on one button device</title><link>https://devzone.nordicsemi.com/thread/189082?ContentTypeID=1</link><pubDate>Fri, 24 May 2019 14:11:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8bf82c7-9b63-4281-8b86-87afbbe8f868</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;No. I power down from the app. I managed to get something working by reading RESETREAS like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t reset_reason;
reset_reason = NRF_POWER-&amp;gt;RESETREAS;
NRF_POWER-&amp;gt;RESETREAS = 0x00000000;

// if not power cycle
if (reset_reason &amp;gt; 0) {
    nrf_bootloader_app_start();
} else {
    err_code = nrf_bootloader_init(dfu_observer);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU on one button device</title><link>https://devzone.nordicsemi.com/thread/189047?ContentTypeID=1</link><pubDate>Fri, 24 May 2019 12:24:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30f31ba4-d537-4e46-8a71-81dd9e703d40</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]This post (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33507/bootloader-deep-sleep/128954#128954"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/33507/bootloader-deep-sleep/128954#128954&lt;/a&gt;) talks very briefly about &amp;quot;disabling the BOOTLOADER_BUTTON&amp;quot;, but it&amp;#39;s unclear to me how to do that, and still retain the wake functionality.&amp;nbsp;[/quote]
&lt;p&gt;Do you enter system OFF from the bootloader code? The BOOTLOADER_BUTTON is not directly tied to the wake-up functionality, but it will initialize the pin to input with sense enabled, see nrf_bootloader::dfu_enter_button_init().&lt;/p&gt;
&lt;p&gt;sdk_config.h settings if you use SDK 15.3.0:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;/h&amp;gt; 
//==========================================================

// &amp;lt;h&amp;gt; DFU mode enter method 

//==========================================================
// &amp;lt;e&amp;gt; NRF_BL_DFU_ENTER_METHOD_BUTTON - Enter DFU mode on button press.
//==========================================================
#ifndef NRF_BL_DFU_ENTER_METHOD_BUTTON
#define NRF_BL_DFU_ENTER_METHOD_BUTTON 1
#endif
// &amp;lt;o&amp;gt; NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN  - Button for entering DFU mode.
 
// &amp;lt;0=&amp;gt; 0 (P0.0) 
// &amp;lt;1=&amp;gt; 1 (P0.1) 
// &amp;lt;2=&amp;gt; 2 (P0.2) 
// &amp;lt;3=&amp;gt; 3 (P0.3) 
// &amp;lt;4=&amp;gt; 4 (P0.4) 
// &amp;lt;5=&amp;gt; 5 (P0.5) 
// &amp;lt;6=&amp;gt; 6 (P0.6) 
// &amp;lt;7=&amp;gt; 7 (P0.7) 
// &amp;lt;8=&amp;gt; 8 (P0.8) 
// &amp;lt;9=&amp;gt; 9 (P0.9) 
// &amp;lt;10=&amp;gt; 10 (P0.10) 
// &amp;lt;11=&amp;gt; 11 (P0.11) 
// &amp;lt;12=&amp;gt; 12 (P0.12) 
// &amp;lt;13=&amp;gt; 13 (P0.13) 
// &amp;lt;14=&amp;gt; 14 (P0.14) 
// &amp;lt;15=&amp;gt; 15 (P0.15) 
// &amp;lt;16=&amp;gt; 16 (P0.16) 
// &amp;lt;17=&amp;gt; 17 (P0.17) 
// &amp;lt;18=&amp;gt; 18 (P0.18) 
// &amp;lt;19=&amp;gt; 19 (P0.19) 
// &amp;lt;20=&amp;gt; 20 (P0.20) 
// &amp;lt;21=&amp;gt; 21 (P0.21) 
// &amp;lt;22=&amp;gt; 22 (P0.22) 
// &amp;lt;23=&amp;gt; 23 (P0.23) 
// &amp;lt;24=&amp;gt; 24 (P0.24) 
// &amp;lt;25=&amp;gt; 25 (P0.25) 
// &amp;lt;26=&amp;gt; 26 (P0.26) 
// &amp;lt;27=&amp;gt; 27 (P0.27) 
// &amp;lt;28=&amp;gt; 28 (P0.28) 
// &amp;lt;29=&amp;gt; 29 (P0.29) 
// &amp;lt;30=&amp;gt; 30 (P0.30) 
// &amp;lt;31=&amp;gt; 31 (P0.31) 

#ifndef NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN
#define NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN 16
#endif

// &amp;lt;/e&amp;gt;

// &amp;lt;q&amp;gt; NRF_BL_DFU_ENTER_METHOD_PINRESET  - Enter DFU mode on pin reset.
 

#ifndef NRF_BL_DFU_ENTER_METHOD_PINRESET
#define NRF_BL_DFU_ENTER_METHOD_PINRESET 0
#endif

// &amp;lt;q&amp;gt; NRF_BL_DFU_ENTER_METHOD_GPREGRET  - Enter DFU mode when bit 1 (0-indexed) is set in the NRF_POWER_GPREGRET register.
 

#ifndef NRF_BL_DFU_ENTER_METHOD_GPREGRET
#define NRF_BL_DFU_ENTER_METHOD_GPREGRET 1
#endif

// &amp;lt;q&amp;gt; NRF_BL_DFU_ENTER_METHOD_BUTTONLESS  - Enter DFU mode when the Boolean enter_buttonless_dfu in DFU settings is true.
 

#ifndef NRF_BL_DFU_ENTER_METHOD_BUTTONLESS
#define NRF_BL_DFU_ENTER_METHOD_BUTTONLESS 0
#endif
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>