<?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 Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82146/dfu-bootloader-with-s340-softdevice</link><description>Hi, I learned how to replace the softdevice for a normal application. I&amp;#39;ve replaced 140 with 340 in my app. However I don&amp;#39;t know to do that for the boolloader. 
 What I want to achieve is 
 - Have a BLE bootloader with S340 
 - Have my app on top, which</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Nov 2021 14:22:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82146/dfu-bootloader-with-s340-softdevice" /><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341336?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 14:22:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00e8553f-bda0-412a-8563-27fcc9e124fb</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;I didn&amp;#39;t. To be honest I&amp;#39;m more interested in the mobile app DFU. I was only testing on my computer, because it seemed a faster / easier method (no need to transfer the zip to the phone).&lt;/p&gt;
&lt;p&gt;So thank you for your help so much. I think we can close this topic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341313?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 13:30:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcd4ce99-c67f-4a96-84e3-c2604851a7c5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see.&amp;nbsp;Did you look more into the debugger issue where you did not see the type field?&amp;nbsp;Make sure you test with optimization disabled if you have not done so allready, as that will make debugging easier. The type &lt;em&gt;should&lt;/em&gt; have been 2. Can you also check the handle and op fields, so that we can see if that makes sense?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341295?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 13:05:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ea1f71b-1f91-4233-bbf8-08a126a53409</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;No. I don&amp;#39;t use bonding.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341288?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 12:51:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b76f84d-f3c6-4989-9ac2-d22cac5b213e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Do you use DFU with bonding by any chance, and if so, could it be that you bond when you test on the phone but not when you test with nRF Connect for desktop?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341134?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 16:25:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59d36096-3f6c-4561-8406-c3481ade45a3</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;Ok. I don&amp;#39;t know why, but it doesn&amp;#39;t work from &amp;quot;BLE&amp;quot; app (NRF Connect suit), but it does when I use the nRF Tools on my mobile. New firmware is installed and boots up.&lt;/p&gt;
&lt;p&gt;Should I do something extra on the BLE app?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341114?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 14:40:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47753821-c03f-4d7a-938a-9584513db8d1</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;When I click on &amp;quot;Start DFU&amp;quot;, the app goes to&amp;nbsp;ble_dfu_buttonless_on_ble_evt, then to on_rw_authorize_req&lt;/p&gt;
&lt;p&gt;and there it does not reach the code in the &amp;quot;iffs&amp;quot;.&amp;nbsp;p_auth_req-&amp;gt;type is empty... hm&lt;/p&gt;
&lt;p&gt;This is how it looks:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638197011289v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341083?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 13:08:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f661b38-94f3-489b-b42e-cfa61e955ca8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Good, then the bootloader is there and RTT logging is present in the bootloader and you &lt;em&gt;should&lt;/em&gt; see it again after reset.&lt;/p&gt;
&lt;p&gt;Probably that does not occur, then. With that,&amp;nbsp;I suggest going back to debugging you reapplication (enable RTT in the app for this to make it easier, and disable RTT logging in the bootloader). Is an error handler reached? Or what else happens when it is supposed to enter DFU mode? You should be able to see this from debugging, hopefully you should get much just from observing the log with a debug build.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341061?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 12:09:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:681d8875-600f-4319-8092-217156171761</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;Ok. It&amp;#39;s like I said. When I turn off logging in my app, I can see logs from the bootloader, but they only show when I start app. Then I try to &amp;quot;start the DFU&amp;quot; it goes &amp;quot;initializing&amp;quot; and restarts... but I&amp;#39;m no loonger sure it does, because the log is silent from the moment the app started the first time.&lt;/p&gt;
&lt;p&gt;The log from the first boot below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Inside main
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: In nrf_bootloader_init
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Calling nrf_dfu_settings_init()...
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Using settings page.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Copying forbidden parts from backup page.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0xFE000.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: Enter nrf_bootloader_fw_activate
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: No firmware to activate.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation: CRC check of app failed. Return 1
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: App is valid
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0xFE000.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: Running nrf_bootloader_app_start with address: 0x00001000
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: Disabling interrupts. NVIC-&amp;gt;ICER[0]: 0x0
00&amp;gt; &lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341057?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 11:58:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7954feed-872c-4db0-87f4-565bbde113f1</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;Ok. But it does not get to the bootloader... I think. I mean it does the first time, when there is no app. Then I can connect to it and upload a zip with my app. Next when I connect to my app and try the DFU it reboots back to my app. I will check what you wrote though. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341054?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 11:50:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14f02dfb-c325-4bd2-acf8-298fd9e2dc7c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Your application or the bootloader? You need to build the _debug version of the bootloader, which has RTT logging. I also suggest you disable RTT logging in the application (if you use it) while testing this, as if not you can get problems with the RTT viewer (it searches for a n RTT buffer in memory, and if it finds the RTT buffer from the application before the bootloader that will be used, even though the bootloader may have it&amp;#39;s RTT buffer located at a different place in RAM).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341035?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 10:30:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc5a4a8b-0887-4d1b-8b72-81eeb77468a7</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;I have it compiled with debug and I use RTT. There&amp;#39;s nothing there :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341034?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 10:29:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c55bba28-3ae8-4d0d-83aa-d3d82926da13</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I did not see any questions related to buttonless other than the statement that you want to use it.&lt;/p&gt;
[quote user="dragilla"]What I can say in addition is that the app does not go into the&amp;nbsp;ble_dfu_evt_handler. It just resets.[/quote]
&lt;p&gt;If it &amp;quot;just resets&amp;quot; then something is resetting. An error handler perhaps? Have you attempted to make a debug build (with DEBUG defined) and logging enabled? If so, you should easily see that. Generally, the buttonless DFU mechamism is very simple, by just writing a magic work to GPREGREG and performing a soft reset. Then the bootloader checks GPREGRET for the magic word - and if it is present, it enters DFU mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341029?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 10:26:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40e80bcd-2543-40b2-b91a-c8557773c0e2</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;Hi, Thanks for your answer. This part of my question is clear. Can you please address the other part (buttonless dfu app does not work).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What I can say in addition is that the app does not go into the&amp;nbsp;ble_dfu_evt_handler. It just resets.&lt;/p&gt;
&lt;p&gt;PS: I also implemented parts of the power management example app into my app, which I think might be in conflict.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341009?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 09:17:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ca15574-9bac-48fb-b25e-683ce31255fb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]what should be changed? Are there major differences between 140 and 340?[/quote]
&lt;p&gt;Assuming the S340 SoftDevice you are using is the same major version as the S140 version and you only use a BLE bootloader in both cases, the API etc. is the same (so not just the nrf_sdm.h file). This should be enough, though there could be something I do not think about which you should see when you test.&lt;/p&gt;
&lt;p&gt;Regarding memory, the bootloader is located at the end of the flash, so flash start address will not&amp;nbsp;be a problem even if the SoftDevice increases. If the version is the same and you only use BLE still, the RAM configuration should also be good. Alternatively you could increase the bootloader RAM start address and decrees the size a bit just to be on the safe side (you will get a runtime error when configuring the SoftDevice if this is a problem, though).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/341002?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 08:48:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccd6467f-acd4-43ac-9afc-a67522040f82</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;Ok. I think the bootloader itself is ok, because I can upload a new zip&amp;nbsp;containing my app. However, my app, which I tried to extend with the DFU functionality does not function properly. The DFU service is visible, but when i click on the &amp;quot;Start DFU&amp;quot; button in the BLE app (in the nrf connect suit), after connecting and upploading the zip, my app restarts, but does not go into the bootloader. What am I missing? Where to look for a mistake?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Bootloader with S340 Softdevice</title><link>https://devzone.nordicsemi.com/thread/340967?ContentTypeID=1</link><pubDate>Sun, 28 Nov 2021 11:27:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08075caf-22ad-4aff-9578-c324d299cc51</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;OK. I&amp;#39;ve changed the nrf_sdm.h file to the one provided with the S340 softdevice and it compiled and runs. Please let me know if this should be enough or maybe there is something more I should do. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>