<?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 programming</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44279/dfu-programming</link><description>Hi everybody, 
 I am trying to program a custom board via DFU without success. I can build bootloader and zip file. I can even program the file by nRFToolbox on device but it does not work after programming. 
 Now my questions are: 
 1- Should I build</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Mar 2019 21:22:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44279/dfu-programming" /><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/175144?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2019 21:22:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29478740-4466-4c90-8f91-f1a874e8788e</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;Thanks. It is working perfectly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/175060?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2019 14:34:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c89bc517-031b-4c87-b39b-71c1b090bd1d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;DFU is not activated by reset itself, but the bootloader runs after every reset and checks if any of the mechanism uses to signal DFU is enabled. According to your log, the GPIO pin configured to signal that you want to enter DFU mode is asserted. The bootloader will check the GPIO pin defined by NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN in the bootloader projects sdk_config.h if&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON is set to 1.&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t want to use a GPIO pin to signal DFU mode, set&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON to 0. If you just want to use a different pin, set&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN accordingly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/175015?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2019 13:11:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13caf8fa-e948-4223-b9b0-11bb0012fefa</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Where can I assign DFU&amp;nbsp; mode button?&lt;/p&gt;
&lt;p&gt;Is DFU mode activated by reset?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/174950?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2019 08:03:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8bfab8f-c05a-4a5a-9b2e-75e2daed705a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can see from the log that the GPIO pin used to enter DFU mode is asserted:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: DFU mode requested via button.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you do not use the same button for wakeup as to signal enter DFU mode, then this indicate that you have an issue with your bootloader configuration or perhaps a HW issue with the DFU enter pin (floating?).&lt;/p&gt;
&lt;p&gt;If you are pushing the same button as you use to enter DFU mode to wake up the device, then this is expected behavior. You either need to use a different button to force DFU mode (if you have more), use buttonless DFU, or expand the DFU button enter check to for instance require the button to be pushed for a certain duration of time for it to enter the DFU mode (or other alternatives).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/174908?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 22:33:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d122ea78-0e3f-4cda-ad11-d4e86d282bf9</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0537.log.txt"&gt;devzone.nordicsemi.com/.../0537.log.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is the log file:&lt;/p&gt;
&lt;p&gt;1- firmware uploaded&lt;/p&gt;
&lt;p&gt;2- turn off-on the board to run the application&lt;/p&gt;
&lt;p&gt;3- waiting for sleep mode of application:&lt;/p&gt;
&lt;p&gt;static void sleep_mode_enter(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;/p&gt;
&lt;p&gt;err_code = bsp_indication_set(BSP_INDICATE_IDLE);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;// Prepare wakeup buttons.&lt;br /&gt; err_code = bsp_btn_ble_sleep_mode_prepare();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;// Go to system-off mode (this function will not return; wakeup will cause a reset).&lt;br /&gt; err_code = sd_power_system_off();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;4- push the button to wake the application up&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/174736?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 08:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0bf870b-0e35-452a-8f11-fc9366f399c5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can check the bootloader logs? The reason for entering DFU bootloader is logged in dfu_enter_check() in nrf_bootloader.c (assuming SDK 15).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/174692?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 03:12:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84fc2c55-be19-4898-9d9d-7fd0b24ae0d3</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;Hi Elinar,&lt;/p&gt;
&lt;p&gt;Thanks agian for your reply.&lt;/p&gt;
&lt;p&gt;Now everything is ok.&amp;nbsp;I am using reset and NFC pins as GPIO.&lt;/p&gt;
&lt;p&gt;However, I still have an issue. When the program enter&amp;nbsp;to sleep mode, the board backs to DFU mode after waking up. Is there anything I forgot to avoid DFU mode?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/174570?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 13:24:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2643b992-982a-4df3-adfc-7dfea47fb363</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uicr.html?cp=2_1_0_13_0_59#register.PSELRESET-0"&gt;UICR PSELRESET registers&lt;/a&gt; will be configured to set GPIO as pin reset when&amp;nbsp;CONFIG_GPIO_AS_PINRESET has been used to build part of your firmware (being bootloader or application). So you must make sure that it is no longer used in either of them. Then you need to erase the UICR to reset it back to the default state, which you do by a full chip erase (most easily by calling &amp;quot;nrfjprog -e&amp;quot;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/174563?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 13:13:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73b7646d-fc8b-4b60-aa4e-4d5d067b5b2b</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;Hi Elinar,&lt;/p&gt;
&lt;p&gt;It is working now :) I had a problem with reset. When I reset the board, the board goes back to DFU mode. I remove&amp;nbsp;CONFIG_GPIO_AS_PINRESET&amp;nbsp; from bootloader but the reset pin is still reset.&lt;/p&gt;
&lt;p&gt;My question is, when&amp;nbsp;UICR register is set? During programming bootloader, softdevice or application? How can I make reset as a GPIO pin?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/174478?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 09:41:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:185d4a2b-8cad-49ac-8723-cf8e7f105d6f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="tai2020"]- How can I generate log file? I have already compiled&amp;nbsp;pca10040_ble_debug project. How can I generate log file?[/quote]
&lt;p&gt;The _debug bootloader projects use RTT logging, so you can obtain the log by connecting a Segger debugger and using &lt;a href="https://www.segger.com/products/debug-probes/j-link/tools/rtt-viewer/"&gt;RTT Viewer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The log should tell us what is happening in the bootloader. Generally, the bootloader will check if it should enter DFU mode, for instance if the GPIO pin used to signal DFU mode is asserted or if the retention register indicates that it should enter DFU mode. If not, it will check if the application is present and valid. If it is, it i will start it. If not, it will enter DFU mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/174399?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 00:07:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9b29368-38e6-4a83-abd7-863ff3ce25b4</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;Thanks for reply. Here-below the my answers:&lt;/p&gt;
&lt;p&gt;- Yes. I receive the massage : DFU Upload compelete.&lt;/p&gt;
&lt;p&gt;- It is still staying in DFU mode. I can repeat Firmware Update via nRF toolbox.&lt;/p&gt;
&lt;p&gt;- How can I generate log file? I have already compiled&amp;nbsp;pca10040_ble_debug project. How can I generate log file?&lt;/p&gt;
&lt;p&gt;I used my own cus_board.c and cus_board.h based on defult board.c and board.h. I modified LED and buttom numbers and pins. The custom boards has only 1 buttom connected&amp;nbsp;to reset pin. I could not have used reset pin as GPIO yet.&lt;/p&gt;
&lt;p&gt;I am using nRFgo Studio to program softdevice and keil to develop and program the application. Everything is working without DFU.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU programming</title><link>https://devzone.nordicsemi.com/thread/173714?ContentTypeID=1</link><pubDate>Fri, 01 Mar 2019 13:28:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb25d38b-e867-4ff3-bcfb-2aa6f8ca5493</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have a few questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Does the DFU operation complete successfully when you do it from&amp;nbsp;nRFToolbox?&lt;/li&gt;
&lt;li&gt;In what was do you see that it does not work after programming? Does the device stay in DFU mode, or in some other state?&lt;/li&gt;
&lt;li&gt;Can you try the debug bootloader with RTT logging, and upload the logs here? That should give a good indication about what is happening.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Regarding your specific questions:&lt;/p&gt;
&lt;p&gt;1. If the board file reflects the parts your HW that is used by the bootloader correctly (LEDs and buttons), then there is no need to change. If not, then you should use a custom board file (or adapt the board file you are using, though it is somewhat dirty).&lt;/p&gt;
&lt;p&gt;2. Having&amp;nbsp;&lt;span&gt;CONFIG_NFCT_PINS_AS_GPIOS&amp;nbsp;&lt;/span&gt;set causes the firmware to set the correct UICR register to indicate that the NFC pins should act as&amp;nbsp;normal GPIOs. That only has to happen once (it is essentially a write to flash, you can see the implementation in system_nrf52.c). Therefor it does not matter unless you use one of the NFC pins for something in the bootloader (which runs first).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>