<?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>Bootloader: DFU Start by Flash content instead of Key operation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22615/bootloader-dfu-start-by-flash-content-instead-of-key-operation</link><description>Controller:
nRF52832-QFAA 
 Reference project:
nRF5_SDK_11.0.0_89a8197/examples/dfu/bootloader/pca10040/dual_bank_ble_s132 
 Question:
The idea is, to store a init_DFU_by_flag into the data flash by the application to initiate the DFU service after</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Jun 2017 13:48:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22615/bootloader-dfu-start-by-flash-content-instead-of-key-operation" /><item><title>RE: Bootloader: DFU Start by Flash content instead of Key operation</title><link>https://devzone.nordicsemi.com/thread/88953?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 13:48:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc4ba74c-f30d-4e35-b200-c5baddd53aa4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Softreset will resets the softdevice, it&amp;#39;s opposite with branching, which keeps the softdevice initialized.
You can find the example here: \examples\ble_peripheral\ble_app_hrs\pca10040\s132_with_dfu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader: DFU Start by Flash content instead of Key operation</title><link>https://devzone.nordicsemi.com/thread/88954?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 13:37:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70ccd678-49a1-40ca-a126-d232b7682af0</guid><dc:creator>Uwe</dc:creator><description>&lt;p&gt;Sorry. Where can I find ble_app_hrm with dfu?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader: DFU Start by Flash content instead of Key operation</title><link>https://devzone.nordicsemi.com/thread/88952?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 13:32:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64737bd7-0a4d-44ee-8010-053fc4bf8345</guid><dc:creator>Uwe</dc:creator><description>&lt;p&gt;Many Thanks. But NVIC_SystemReset(); is a software resest, i.e. the softdevice will be kept active and the content of GPREGET-RAM isn&amp;#39;t cleared? And a second question: Does the branchingh to the boot loader requires special preparations of the softdevice functions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader: DFU Start by Flash content instead of Key operation</title><link>https://devzone.nordicsemi.com/thread/88956?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 12:55:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16be022e-624a-4c88-9d90-be79c1c254b1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please set a break point inside the bootloader and check. Note that in SDK v11 we expect the application to branch to the softdevice, not to do a reset.&lt;/p&gt;
&lt;p&gt;If you do a reset you need to comment out the line  &lt;code&gt;if (init_softdevice)&lt;/code&gt; inside ble_stack_init() in main.c&lt;/p&gt;
&lt;p&gt;If you plan to branch instead of softreset, please have  a look at the example ble_app_hrm with dfu.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader: DFU Start by Flash content instead of Key operation</title><link>https://devzone.nordicsemi.com/thread/88958?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 11:43:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20366a35-7317-49f1-b3bc-f1321305068b</guid><dc:creator>Uwe</dc:creator><description>&lt;p&gt;Sorry for my delayed next question. Sometimes I had to work on other parts of the project:
I set the GPREGRET register with the value 0xB1 and tried to start the DFU - with the following sequency:&lt;/p&gt;
&lt;p&gt;err_code = sd_power_gpregret_clr(0xFF);
APP_ERROR_CHECK(err_code);
err_code = sd_power_gpregret_set(BOOTLOADER_DFU_START);
APP_ERROR_CHECK(err_code);
err_code = sd_power_gpregret_get(&amp;amp;GPREGRET);
APP_ERROR_CHECK(err_code);
if (0xB1==GPREGRET)
{ NVIC_SystemReset(); }&lt;/p&gt;
&lt;p&gt;But the bootloader didn&amp;#39;t start the DFU and went ahead with the normal start of application.
What is wrong?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader: DFU Start by Flash content instead of Key operation</title><link>https://devzone.nordicsemi.com/thread/88957?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2017 11:15:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cd746d1-5e2d-4221-be90-14ed0f0098dd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Uwe,&lt;/p&gt;
&lt;p&gt;In your application , I would suggest you to use pstorage instead of pstorage raw. If you use pstorage raw, make sure you implement &lt;a href="https://devzone.nordicsemi.com/question/139880/raw-mode-pstorage_rawc-bug-in-sdk9-and-sdk-10/"&gt;this deadlock fix&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The bootloader on SDK v12 is quite different from SDK v11. If you don&amp;#39;t have the need of having Secure DFU, where the integrity and genuine of the firmware is verified by a signature, then you can continue to use the bootloader on SDK v11.&lt;/p&gt;
&lt;p&gt;I mentioned SDK v12 just as an example you can have a look. I don&amp;#39;t see a problem using flash to set the flag. Just less clean than using the GPREGRET.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader: DFU Start by Flash content instead of Key operation</title><link>https://devzone.nordicsemi.com/thread/88955?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2017 17:22:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:908c15e4-2db6-4ad9-8a7a-bd9eb9075ea9</guid><dc:creator>Uwe</dc:creator><description>&lt;p&gt;Many thanks for your answer.
To be honest, I&amp;#39;m a little bit afraid of changing the application from SDK11 base to SDK12 base.
Or is it sufficient to change only the bootloader SDK from 11 to 12? The application based on SDK11 uses pstorage RAW functions and it wasn&amp;#39;t so easy (for us) to get the system running.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader: DFU Start by Flash content instead of Key operation</title><link>https://devzone.nordicsemi.com/thread/88951?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2017 10:36:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68d96428-5ccd-486a-89f7-cfb5048d4b72</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;May I ask why don&amp;#39;t you want to use GPREGRET retention register to do the task ( as default ) ?&lt;/p&gt;
&lt;p&gt;If you want to use flash to send the command, it&amp;#39;s fine. That actually how we did it in our Secure DFU in SDK v12.0
We write to bootloader setting to tell the bootloader to enter DFU mode.
pstorage was not used though.&lt;/p&gt;
&lt;p&gt;Note that we prefer to use GPREGRET as it&amp;#39;s easier to fall back after you switch to bootloader. For example  if there is a problem when updating firmware, you can always reset and come back to the application. If you write to flash, and if the bootloader isn&amp;#39;t managed to erase the flash, then you will stuck in bootloader mode, can&amp;#39;t go back to normal application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>