<?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>nRF51822: secure DFU over BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87038/nrf51822-secure-dfu-over-ble</link><description>Hello there! 
 We are using nRF51822_xxac SoC with nRF5 SDK v12.3.0 and S130 Softdevice. We are kind of obliged to stick with nRF51822 because nRF52840 SoCs were out of stock at the moment we wanted to place the order. 
 We are currently finalizing the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Apr 2022 13:09:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87038/nrf51822-secure-dfu-over-ble" /><item><title>RE: nRF51822: secure DFU over BLE</title><link>https://devzone.nordicsemi.com/thread/363951?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 13:09:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0594e6d0-b073-419a-8471-813b031f7406</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Bojan,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried to test without the programmer/debugger connected ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After the DFU process is finished the bootloader will reset the chip in this function:&amp;nbsp;on_dfu_complete()&lt;/p&gt;
&lt;p&gt;The function is called in the flash call back after the bootloader setting write is finished. See this call&lt;br /&gt; &lt;em&gt;// Store the settings to flash and reset after that&lt;/em&gt;&lt;br /&gt;&lt;em&gt; if( nrf_dfu_settings_write(on_dfu_complete) != NRF_SUCCESS)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In dfu_reg_handling.c file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please try to test using some logging to see why it hang and couldn&amp;#39;t reset.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822: secure DFU over BLE</title><link>https://devzone.nordicsemi.com/thread/363918?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 12:25:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63cf61db-0d93-499a-8214-9c937f5e2903</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/hungbui"&gt;Hung Bui&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We disabled checking the state of P0.20 pin in &lt;span style="background-color:#ccffcc;"&gt;&lt;em&gt;&lt;strong&gt;nrf_dfu_enter_check()&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; function. It seems that this had a positive impact and we were able to go one step further.&lt;/p&gt;
&lt;p&gt;What is happening now is that our custom board does not start with the new application code until we press the Reset button on &lt;strong&gt;&lt;span style="background-color:rgba(255, 204, 153, 1);"&gt;&lt;em&gt;Programmer&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt; window.&lt;/p&gt;
&lt;p&gt;On the other hand, when we use the &lt;a href="https://www.nordicsemi.com/Products/Development-hardware/nrf51-dk" rel="noopener noreferrer" target="_blank"&gt;nRF51DK&lt;/a&gt; instead of our custom board and apply the very same set of steps, the new application starts running properly after we transfer the DFU package over BLE.&lt;/p&gt;
&lt;p&gt;Do you have any idea about what might be the issue?&lt;/p&gt;
&lt;p&gt;Here is the part of our custom board schematic that contains nRF51 and program/debug interface:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1650457547285v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822: secure DFU over BLE</title><link>https://devzone.nordicsemi.com/thread/363623?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2022 13:35:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f7d27c6-2d9d-4161-bb4c-c72dbc29c27f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Bojan,&amp;nbsp;&lt;br /&gt;In that case you can just remove the check:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; if (nrf_gpio_pin_read(BOOTLOADER_BUTTON) == 0)&lt;br /&gt; {&lt;br /&gt; return true;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;in&amp;nbsp;nrf_dfu_enter_check() function to not having the button involved.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Or you can&amp;nbsp;declare your own&amp;nbsp;nrf_dfu_enter_check() to overwrite it, since the original&amp;nbsp;nrf_dfu_enter_check() function in nrf_dfu.c is defined as WEAK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822: secure DFU over BLE</title><link>https://devzone.nordicsemi.com/thread/363588?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2022 12:47:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:371cdd73-49f3-4635-81aa-f3a874750bb2</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello, &lt;a href="https://devzone.nordicsemi.com/members/hungbui"&gt;Hung Bui&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Thanks for your feedback.&lt;/p&gt;
&lt;p&gt;We are using our custom-designed board with nRF51822 SoC on it. Pin P0.20 is physically connected to the interrupt output of the accelerometer. We don&amp;#39;t have any external pull-up resistor that will tie the P0.20 to VDD.&lt;/p&gt;
&lt;p&gt;Is something like this necessary?&lt;/p&gt;
&lt;p&gt;Can we configure P0.20 GPIO as input with the internal pull-up resistor? We are interested in buttonless DFU in our use case.&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822: secure DFU over BLE</title><link>https://devzone.nordicsemi.com/thread/363578?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2022 12:34:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a2f1d34-e9fa-4518-9b98-55f7072412bd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Bojan,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you check if you have any error log on the device when&amp;nbsp; you do DFU update ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Which hardware did you test your bootloader on ? Please be note that by default the DFU bootloader is always entered if a button (BOOTLOADER_BUTTON = BSP_BUTTON_3 = Pin P0.20) is pressed (connect to ground). Check function&amp;nbsp;nrf_dfu_enter_check(). I suspect that the button was not connected to VDD and causing the bootloader to enter DFU all the time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For testing I would suggest to try doing DFU a very simple project, for example the&amp;nbsp;\peripheral\blinky\pca10028\s130&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think merge the bootloader and application and softdevice would make any different here.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I would suggest to test using the debug version of the bootloader. With that you can step into the code and check&amp;nbsp;why the bootloader doesn&amp;#39;t want to jump to the application. Please focus on&amp;nbsp;nrf_dfu_init() function in nrf_dfu.c , in that function you can find out why the bootloader stay in DFU mode instead of jumping application, focus on&amp;nbsp;nrf_dfu_enter_check() and&amp;nbsp;nrf_dfu_app_is_valid()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>