<?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>Buttonless DFU Debugging Problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37507/buttonless-dfu-debugging-problem</link><description>I&amp;#39;m trying to add buttonless DFU to the SDK&amp;#39;s template application. 
 Here is my setup: 
 
 Soft Device 6.1.0 
 Secure Bootloader 
 Modified Template App (Added buttonless DFU) 
 
 I am able to successfully OTA upload my package .zip to the board, but</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Aug 2018 12:02:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37507/buttonless-dfu-debugging-problem" /><item><title>RE: Buttonless DFU Debugging Problem</title><link>https://devzone.nordicsemi.com/thread/144932?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2018 12:02:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edf90391-8376-458b-8a61-7fa1f23d1fda</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Jeff,&lt;/p&gt;
&lt;p&gt;Happy to help:) Yes, you need to enable pull-up on the pin, see BUTTON_PULL define in you BOARD header.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Update: guess I responded too quickly. Based on the schematic, I don&amp;#39;t think it make sense that it works when you hold the button on power-up.&lt;/p&gt;
&lt;p&gt;Here are the lines of code that determines if the bootloader should enter DFU mode (nrf_bootloader.c::dfu_enter_check):&lt;/p&gt;
&lt;p&gt;static bool dfu_enter_check(void)&lt;br /&gt;{&lt;br /&gt; if (!nrf_dfu_app_is_valid(crc_on_valid_app_required()))&lt;br /&gt; {&lt;br /&gt; NRF_LOG_DEBUG(&amp;quot;DFU mode because app is not valid.&amp;quot;);&lt;br /&gt; return true;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;if (NRF_BL_DFU_ENTER_METHOD_BUTTON &amp;amp;&amp;amp;&lt;br /&gt; &lt;strong&gt;(nrf_gpio_pin_read(NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN) == 0)) // Active low&lt;/strong&gt;&lt;br /&gt; {&lt;br /&gt; NRF_LOG_DEBUG(&amp;quot;DFU mode requested via button.&amp;quot;);&lt;br /&gt; return true;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;if (NRF_BL_DFU_ENTER_METHOD_PINRESET &amp;amp;&amp;amp;&lt;br /&gt; (NRF_POWER-&amp;gt;RESETREAS &amp;amp; POWER_RESETREAS_RESETPIN_Msk))&lt;br /&gt; {&lt;br /&gt; NRF_LOG_DEBUG(&amp;quot;DFU mode requested via pin-reset.&amp;quot;);&lt;br /&gt; return true;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;if (NRF_BL_DFU_ENTER_METHOD_GPREGRET &amp;amp;&amp;amp;&lt;br /&gt; (nrf_power_gpregret_get() &amp;amp; BOOTLOADER_DFU_START))&lt;br /&gt; {&lt;br /&gt; NRF_LOG_DEBUG(&amp;quot;DFU mode requested via GPREGRET.&amp;quot;);&lt;br /&gt; return true;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;if (NRF_BL_DFU_ENTER_METHOD_BUTTONLESS &amp;amp;&amp;amp;&lt;br /&gt; (s_dfu_settings.enter_buttonless_dfu == 1))&lt;br /&gt; {&lt;br /&gt; NRF_LOG_DEBUG(&amp;quot;DFU mode requested via bootloader settings.&amp;quot;);&lt;br /&gt; return true;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;return false;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;And&amp;nbsp;the bootloader button&amp;nbsp;initialization (nrf_bootloader.c::dfu_enter_button_init):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg_sense_input(NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN,&lt;br /&gt; BUTTON_PULL,&lt;br /&gt; NRF_GPIO_PIN_SENSE_LOW);&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU Debugging Problem</title><link>https://devzone.nordicsemi.com/thread/144931?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2018 11:59:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48fc41c3-104d-4400-8668-f9ae840aec9d</guid><dc:creator>JeffW</dc:creator><description>&lt;p&gt;Vidar,&lt;/p&gt;
&lt;p&gt;Holding down the button on power-up fixed the issue.&lt;br /&gt;This is strange to me, as the button is pulled low on contact. (See schematic)&lt;br /&gt;Perhaps I need to activate an internal pull-up inside the boot?&lt;br /&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/nrf52840_5F00_button.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your continued support!&lt;br /&gt;Jeff&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU Debugging Problem</title><link>https://devzone.nordicsemi.com/thread/144925?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2018 11:44:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e43bf23-78c3-41b2-ab53-0ba9cb95aae5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Jeff,&lt;/p&gt;
&lt;p&gt;thanks for confirming. Maybe it could be the bootloader button pin then. The bootloader will enter DFU mode if the&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN is pulled low on startup?&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU Debugging Problem</title><link>https://devzone.nordicsemi.com/thread/144921?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2018 11:37:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b6af858-3455-4939-bc83-ea06cc7cec27</guid><dc:creator>JeffW</dc:creator><description>&lt;p&gt;Vidar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This was a good thought, however my custom board has an LF crystal.&lt;br /&gt;I did try to run it using the internal RC as suggested with no favorable results. (Stays in Boot)&lt;br /&gt;&lt;br /&gt;I will be continuing debugging this issue over the next couple of days. If you can think of any other reasons this would happen, please let me know.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Jeff&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU Debugging Problem</title><link>https://devzone.nordicsemi.com/thread/144868?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2018 08:36:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c3a34cb-9f0d-4790-867d-b19a7c717b6b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Does your custom board have an external LF crystal? Reason I ask is that all SDK bluetooth examples are configured to use the optional LF crystal. If not you need to enable the internal RC oscillator in sdk_config.h (both app and bootloader project):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
......

//==========================================================

// &amp;lt;h&amp;gt; Clock - SoftDevice clock configuration

//==========================================================
// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
 
// &amp;lt;0=&amp;gt; NRF_CLOCK_LF_SRC_RC 
// &amp;lt;1=&amp;gt; NRF_CLOCK_LF_SRC_XTAL 
// &amp;lt;2=&amp;gt; NRF_CLOCK_LF_SRC_SYNTH 

#ifndef NRF_SDH_CLOCK_LF_SRC
#define NRF_SDH_CLOCK_LF_SRC 0
#endif

// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
#ifndef NRF_SDH_CLOCK_LF_RC_CTIV
#define NRF_SDH_CLOCK_LF_RC_CTIV 16
#endif

// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
// &amp;lt;i&amp;gt; How often (in number of calibration intervals) the RC oscillator shall be calibrated
// &amp;lt;i&amp;gt;  if the temperature has not changed.

#ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
#endif

// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
 
// &amp;lt;0=&amp;gt; NRF_CLOCK_LF_ACCURACY_250_PPM 
// &amp;lt;1=&amp;gt; NRF_CLOCK_LF_ACCURACY_500_PPM 
// &amp;lt;2=&amp;gt; NRF_CLOCK_LF_ACCURACY_150_PPM 
// &amp;lt;3=&amp;gt; NRF_CLOCK_LF_ACCURACY_100_PPM 
// &amp;lt;4=&amp;gt; NRF_CLOCK_LF_ACCURACY_75_PPM 
// &amp;lt;5=&amp;gt; NRF_CLOCK_LF_ACCURACY_50_PPM 
// &amp;lt;6=&amp;gt; NRF_CLOCK_LF_ACCURACY_30_PPM 
// &amp;lt;7=&amp;gt; NRF_CLOCK_LF_ACCURACY_20_PPM 
// &amp;lt;8=&amp;gt; NRF_CLOCK_LF_ACCURACY_10_PPM 
// &amp;lt;9=&amp;gt; NRF_CLOCK_LF_ACCURACY_5_PPM 
// &amp;lt;10=&amp;gt; NRF_CLOCK_LF_ACCURACY_2_PPM 
// &amp;lt;11=&amp;gt; NRF_CLOCK_LF_ACCURACY_1_PPM 

#ifndef NRF_SDH_CLOCK_LF_ACCURACY
#define NRF_SDH_CLOCK_LF_ACCURACY 1
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU Debugging Problem</title><link>https://devzone.nordicsemi.com/thread/144717?ContentTypeID=1</link><pubDate>Fri, 17 Aug 2018 12:22:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:effbc9bc-e6e4-43c7-8dd9-0decd520c7fd</guid><dc:creator>JeffW</dc:creator><description>&lt;p&gt;I now am able to program + debug the boot for the buttonless dfu, and modified template app on the development kit. However now I am getting the same or similar issue when I flash one of those working examples to my custom board.&lt;/p&gt;
&lt;p&gt;I modified the boot to not turn the DK LED pins and boot button because of my CUSTOM_BOARD macro, but perhaps I am missing another step. The program again loads right into the boot even though the example is working on the DK.&lt;/p&gt;
&lt;p&gt;Any insight would be appreciated.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU Debugging Problem</title><link>https://devzone.nordicsemi.com/thread/144385?ContentTypeID=1</link><pubDate>Wed, 15 Aug 2018 19:32:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4ecef0e-8c20-4b46-a297-0dfc6954a71d</guid><dc:creator>JeffW</dc:creator><description>&lt;p&gt;Thanks Vidar for the prompt response!&lt;br /&gt;I got this working this afternoon after changing to my output macros.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU Debugging Problem</title><link>https://devzone.nordicsemi.com/thread/144353?ContentTypeID=1</link><pubDate>Wed, 15 Aug 2018 14:34:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f7938f1-92f5-4b28-818b-98a41e8c64d6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Jeff,&lt;/p&gt;
&lt;p&gt;I encountered the same problem here.&amp;nbsp;That is, checksum of app image did not match with the one stored in the generated bl settings page and therefore became stuck in DFU mode. Further debugging revealed that the there was a slight difference if I uploaded the .hex file instead of the .elf file in the build directory:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-2cd765861c52457d961d4822460bde05/69B3E9FE.PNG" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Not sure if this is expected behavior or if it is a bug in binutils (tested with SES v.3.50). In any case, I worked around this be changing the debugger settings in SES to upload the .hex file instead. Screenshots of my configuration:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-2cd765861c52457d961d4822460bde05/pastedimage1534343318094v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;(Post build command :&amp;nbsp; nrfutil settings generate --family NRF52840 --application $(OutDir)/$(ProjectName).hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 $(OutDir)/settings.hex)&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-2cd765861c52457d961d4822460bde05/pastedimage1534343380999v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-2cd765861c52457d961d4822460bde05/pastedimage1534343426842v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>