<?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 package for targets with and without softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64273/dfu-package-for-targets-with-and-without-softdevice</link><description>Is it possible to generate a DFU package for both bootloader-only and fully-programmed (bootloader, softdevice, and app) chips? I&amp;#39;m unable to do so for an nrf52833 using nrfutil version 6.1.0. Here&amp;#39;s how I generate the package: nrfutil pkg generate \</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Jul 2020 02:12:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64273/dfu-package-for-targets-with-and-without-softdevice" /><item><title>RE: DFU package for targets with and without softdevice</title><link>https://devzone.nordicsemi.com/thread/262480?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2020 02:12:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f6591e6-b03c-4a64-998c-721d09e9c967</guid><dc:creator>lynaghk</dc:creator><description>&lt;p&gt;Great, thanks for getting to the bottom of this so quickly Einar.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU package for targets with and without softdevice</title><link>https://devzone.nordicsemi.com/thread/262425?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2020 13:30:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de3eee06-612a-489d-9619-45a7c3a957b9</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I suspect there is a bug in the bootloader. Doing the same test with the BLE bootloader everything works as expected. However, with the USB bootloader, you get this error, which is interesting for a couple of reasons: First of all, the ID is correct. And second of all, it does not matter for the bootloader itself, as unlike the BLE bootloader, it has no dependency on the SoftDevice (it still should check compatibility between SoftDevice and application, though).&lt;/p&gt;
&lt;p&gt;Looking at the log from the bootloader when it fails you can see that prevalidation fails, and digging a bit further this is because of the result set on line 134 nrf_dfu_ver_validation.c. You can work around this by setting&amp;nbsp;NRF_DFU_APP_DOWNGRADE_PREVENTION to 0 in the sdk_config.h of the bootloader. I will report the bug internally.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU package for targets with and without softdevice</title><link>https://devzone.nordicsemi.com/thread/262409?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2020 12:44:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fe136d4-521d-45e6-8542-7a878890d0dc</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="lynaghk"]Here are steps to reproduce.[/quote]
&lt;p&gt;Thank you. I followed this using unmodified SDK examples and reproduced it on my side&amp;nbsp; using the nRF52840 DK and unmodified SDK examples. For reference:&lt;/p&gt;
&lt;p&gt;SDK 17.0.0 secure USB bootlaoder (non-standard public key):&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-de19c598bfa34991a10b77a4b32bbd8e/secure_5F00_bootloader_5F00_usb_5F00_mbr_5F00_pca10056_5F00_debug.hex"&gt;devzone.nordicsemi.com/.../secure_5F00_bootloader_5F00_usb_5F00_mbr_5F00_pca10056_5F00_debug.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;MBR:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-de19c598bfa34991a10b77a4b32bbd8e/mbr_5F00_nrf52_5F00_2.4.1_5F00_mbr.hex"&gt;devzone.nordicsemi.com/.../mbr_5F00_nrf52_5F00_2.4.1_5F00_mbr.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Application (unmodified SDK 17 HRS example):&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-de19c598bfa34991a10b77a4b32bbd8e/ble_5F00_app_5F00_hrs_5F00_pca10056_5F00_s140.hex"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_hrs_5F00_pca10056_5F00_s140.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;SoftDevice:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-de19c598bfa34991a10b77a4b32bbd8e/s140_5F00_nrf52_5F00_7.0.1_5F00_softdevice.hex"&gt;devzone.nordicsemi.com/.../s140_5F00_nrf52_5F00_7.0.1_5F00_softdevice.hex&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;DFU zip generated like this (same as you did, using my key file):&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-de19c598bfa34991a10b77a4b32bbd8e/app_5F00_dfu.zip"&gt;devzone.nordicsemi.com/.../app_5F00_dfu.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfutil dfu usb-serial -p /dev/tty.usb* --package _build/app_dfu.zip&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then erase, program bootloader + MBR, DFU update, reset to DFU mode via button press, and run DFU again in this sequence:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;gt;nrfjprog.exe -e
Erasing user available code and UICR flash areas.
Applying system reset.

&amp;gt;nrfjprog.exe --program mbr_nrf52_2.4.1_mbr.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

&amp;gt;nrfjprog.exe --program secure_bootloader_usb_mbr_pca10056_debug.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

&amp;gt;nrfjprog.exe --reset
Applying system reset.
Run.

&amp;gt;nrfutil dfu usb-serial -p COM60 --package app_dfu.zip
  [####################################]  100%
Device programmed.

&amp;gt;nrfutil dfu usb-serial -p COM60 --package app_dfu.zip

Traceback (most recent call last):
  File &amp;quot;c:\python37\lib\runpy.py&amp;quot;, line 193, in _run_module_as_main
    &amp;quot;__main__&amp;quot;, mod_spec)
  File &amp;quot;c:\python37\lib\runpy.py&amp;quot;, line 85, in _run_code
    exec(code, run_globals)
  File &amp;quot;C:\Python37\Scripts\nrfutil.exe\__main__.py&amp;quot;, line 7, in &amp;lt;module&amp;gt;
  File &amp;quot;c:\python37\lib\site-packages\click\core.py&amp;quot;, line 764, in __call__
    return self.main(*args, **kwargs)
  File &amp;quot;c:\python37\lib\site-packages\click\core.py&amp;quot;, line 717, in main
    rv = self.invoke(ctx)
  File &amp;quot;c:\python37\lib\site-packages\click\core.py&amp;quot;, line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File &amp;quot;c:\python37\lib\site-packages\click\core.py&amp;quot;, line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File &amp;quot;c:\python37\lib\site-packages\click\core.py&amp;quot;, line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File &amp;quot;c:\python37\lib\site-packages\click\core.py&amp;quot;, line 555, in invoke
    return callback(*args, **kwargs)
  File &amp;quot;c:\python37\lib\site-packages\nordicsemi\__main__.py&amp;quot;, line 1015, in usb_serial
    timeout)
  File &amp;quot;c:\python37\lib\site-packages\nordicsemi\__main__.py&amp;quot;, line 970, in do_serial
    dfu.dfu_send_images()
  File &amp;quot;c:\python37\lib\site-packages\nordicsemi\dfu\dfu.py&amp;quot;, line 119, in dfu_send_images
    self._dfu_send_image(self.manifest.softdevice)
  File &amp;quot;c:\python37\lib\site-packages\nordicsemi\dfu\dfu.py&amp;quot;, line 95, in _dfu_send_image
    self.dfu_transport.send_init_packet(data)
  File &amp;quot;c:\python37\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py&amp;quot;, line 256, in send_init_packet
    self.__execute()
  File &amp;quot;c:\python37\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py&amp;quot;, line 421, in __execute
    self.__get_response(DfuTransportSerial.OP_CODE[&amp;#39;Execute&amp;#39;])
  File &amp;quot;c:\python37\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py&amp;quot;, line 502, in __get_response
    raise NordicSemiException(&amp;#39;Extended Error 0x{:02X}: {}&amp;#39;.format(resp[3], data))
pc_ble_driver_py.exceptions.NordicSemiException: Extended Error 0x07: The array of supported SoftDevices for the update does not contain the FWID of the current SoftDevice.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I don&amp;#39;t understand why this is, but I will continue to look into it and get back to you.&lt;/p&gt;
[quote user="lynaghk"]I&amp;#39;m not sure what you mean here --- isn&amp;#39;t the bootloader staying the same?[/quote]
&lt;p&gt;&amp;nbsp;Yes, you do not include the bootloader in this case. If you did, it must have had an increasing version, but it is not relevant in this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU package for targets with and without softdevice</title><link>https://devzone.nordicsemi.com/thread/262378?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2020 11:32:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bd3b7de-85f1-4210-9741-4cf9b3c65172</guid><dc:creator>lynaghk</dc:creator><description>&lt;p&gt;Thanks for your help Einar!&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/64273/dfu-package-for-targets-with-and-without-softdevice/262369"] the bootloader version must be higher every time[/quote]
&lt;p&gt;I&amp;#39;m not sure what you mean here --- isn&amp;#39;t the bootloader staying the same? The DFU update should only update the app and softdevice.&lt;/p&gt;
&lt;p&gt;Glad to know that this is expected to work. Is there a way to upload files privately? I can send you the bootloader and app hex files for testing, but they should not be public.&lt;/p&gt;
&lt;p&gt;Here are steps to reproduce.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;## Erase Chip&lt;br /&gt;&lt;br /&gt;openocd -f openocd.cfg -c &amp;quot;init; reset halt; nrf5 mass_erase&amp;quot;&lt;br /&gt;&lt;br /&gt;openocd.cfg contains&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; source [find interface/stlink.cfg]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; transport select hla_swd&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; source [find target/nrf52.cfg]&lt;br /&gt;&lt;br /&gt;Version: Open On-Chip Debugger 0.10.0+dev-01293-g7c88e76a (2020-06-28-19:39)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;## Build + Flash bootloader&lt;br /&gt;&lt;br /&gt;Build secure_bootloader_usb_mbr_pca10100e example using GCC.&lt;br /&gt;(Note: this example already has `#define NRF_DFU_APP_ACCEPT_SAME_VERSION 1`.)&lt;br /&gt;Then combine with MBR&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mergehex --merge \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bootloader/_build/bootloader.hex \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(SDK_ROOT)/components/softdevice/mbr/hex/mbr_nrf52_2.4.1_mbr.hex \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --output bootloader/_build/bootloader_mbr.hex&lt;br /&gt;&lt;br /&gt;Then flash:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; openocd -f openocd.cfg -c &amp;quot;program bootloader/_build/bootloader_mbr.hex verify reset exit&amp;quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;## Flash softdevice and app via DFU&lt;br /&gt;&lt;br /&gt;nrfutil pkg generate \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --hw-version 52 \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --sd-req 0x00,0xCA \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --sd-id 0xCA \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --application _build/app.hex \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --application-version-string 0.0.0 \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --softdevice /Users/dev/Downloads/nRF5_SDK_17.0.0_9d13099/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --key-file app.pem \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _build/app_dfu.zip&lt;br /&gt;&lt;br /&gt;nrfutil dfu usb-serial -p /dev/tty.usb* --package _build/app_dfu.zip&lt;br /&gt;&lt;br /&gt;This works fine the first time.&lt;br /&gt;App starts up fine as expected, and I initiate a reset into DFU mode through the app.&lt;br /&gt;&lt;br /&gt;Then when I run&lt;br /&gt;&lt;br /&gt;nrfutil dfu usb-serial -p /dev/tty.usb* --package _build/app_dfu.zip&lt;br /&gt;&lt;br /&gt;again, I get the error:&lt;br /&gt;&lt;br /&gt;pc_ble_driver_py.exceptions.NordicSemiException: Extended Error 0x07: The array of supported SoftDevices for the update does not contain the FWID of the current SoftDevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU package for targets with and without softdevice</title><link>https://devzone.nordicsemi.com/thread/262369?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2020 10:41:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:697a6676-9e01-4b10-8885-1807e0876912</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I do not make sense of the error, since the SoftDevice ID should be correct. However, you must make sure that either the application and bootloader version is increasing (a higher number than already present on the device). For the application, you could also configure the bootloader to accept the same version by setting NRF_DFU_APP_ACCEPT_SAME_VERSION to 1 in the bootloader&amp;#39;s sdk_config.h, but the bootloader version must be higher every time. But again, I do not see a link between this and the error you get, and I have not been able to reproduce it.&lt;/p&gt;
&lt;p&gt;Can you reproduce this and upload all the relevant files here to that I can test on my side as well? Please describe each step of the process so that I do not miss anything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>