This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU Update: "Upload Failed: Unknown Command" & Signature-less Bootloader

I am trying to package a firmware update and flash it over BLE DFU and I keep getting the following error on the nRF Toolbox app:

"Upload Failed: Unknown Command"

I cannot figure out why this is happening and I can't find anyone else having this error on here.  Here are the commands I used to create the initial bootloader and settings (flashed over J-Link).

Generating the Settings hex:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
nrfutil settings generate --family NRF52 --application ../AKDP/BUILD/AKDP_RevE.hex --application-version 20 --bootloader-version 1 --bl-settings-version 1 akdp_bl_settings.hex
Generated Bootloader DFU settings .hex file and stored it in: akdp_bl_settings.hex
Bootloader DFU Settings:
* File: akdp_bl_settings.hex
* Family: nRF52
* Start Address: 0x0007F000
* CRC: 0x9F32BF67
* Settings Version: 0x00000001 (1)
* App Version: 0x00000014 (20)
* Bootloader Version: 0x00000001 (1)
* Bank Layout: 0x00000000
* Current Bank: 0x00000000
* Application Size: 0x0003EEB8 (257720 bytes)
* Application CRC: 0xD62A0BD6
* Bank0 Bank Code: 0x00000001
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Merging the settings hex with the bootloader hex:

Fullscreen
1
2
3
4
5
mergehex -m akdp_bl_settings.hex ./bootloader_secure_ble/pca10040_debug/armgcc/_build/nrf52832_xxaa_s132.hex -o akdp_bl_with_settings.hex
Parsing input hex files.
Merging files.
Storing merged file.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

After flashing the softdevice and the bootloader, here is what I used to generate the package file:

Fullscreen
1
nrfutil pkg generate --application ../AKDP/BUILD/AKDP_RevE.hex --application-version 21 --hw-version 52 --sd-req 0x9D,0xA5 AKDP_RevE_with_BL_pkg.zip
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Other information:

  • Device: nRF52832
  • SDK: 14.2.0
  • Board: Custom

I cannot understand why this isn't working.  It all looks fine to me.  The bootloader build completed without any problems.  Any help would be greatly appreciated.

Parents
  • Hi,

    Can you upload a log of the DFU upgrade process to give a bit more understanding of what is going on? You can also try upgrading using the nRF Connect app for mobile or desktop. It might also be useful to see the log from the nRF side, which you can get by using the debug version of the bootloader (with RTT logging).

Reply
  • Hi,

    Can you upload a log of the DFU upgrade process to give a bit more understanding of what is going on? You can also try upgrading using the nRF Connect app for mobile or desktop. It might also be useful to see the log from the nRF side, which you can get by using the debug version of the bootloader (with RTT logging).

Children
  • Here's the log from the RTT viewer:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    0> <info> app: Inside main
    0> <debug> app: In nrf_bootloader_init
    0> <debug> app: in weak nrf_dfu_init_user
    0> <debug> app: In real nrf_dfu_init
    0> <debug> nrf_dfu_settings: Running nrf_dfu_settings_init(sd_irq_initialized=false).
    0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=false)...
    0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    0> <debug> app: Initializing the clock.
    0> <debug> app: Enter nrf_dfu_continue
    0> <debug> app: Valid App
    0> <info> app: Bootloader Button read: Pressed
    0> <debug> app: Application sent bootloader request
    0> <debug> app: In nrf_dfu_transports_init
    0> <debug> app: num transports: 1
    0> <debug> app: Initializing BLE DFU transport
    0> <debug> app: vector table: 0x00073000
    0> <debug> app: vector table: 0x00073000
    0> <debug> app: Error code - sd_softdevice_vector_table_base_set: 0x00000000
    0> <debug> app: Enabling SoftDevice.
    0> <warning> nrf_sdh_ble: RAM starts at 0x20002830, can be adjusted to 0x20002180.
    0> <warning> nrf_sdh_ble: RAM size can be adjusted to 0xDE80.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    And here's the log from nRF Connect:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    nRF Connect, 2018-08-03
    DfuTarg (DA:B9:73:AE:5B:2C)
    V 10:00:43.841 Connecting to DA:B9:73:AE:5B:2C...
    D 10:00:43.842 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE)
    D 10:00:44.106 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I 10:00:44.106 Connected to DA:B9:73:AE:5B:2C
    D 10:00:44.124 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    V 10:00:44.126 Discovering services...
    D 10:00:44.126 gatt.discoverServices()
    D 10:00:44.619 [Callback] Services discovered with status: 0
    I 10:00:44.619 Services discovered
    V 10:00:44.640 Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    - Central Address Resolution [R] (0x2AA6)
    Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
    Client Characteristic Configuration (0x2902)
    Secure DFU Service (0xFE59)
    - DFU Packet [WNR] (8ec90002-f315-4f60-9fb8-838830daea50)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks for your help.

  • I just flashed the same bootloader but unsecured and in debug mode.  I tried using DFU to send one of the example .zip packages and it worked fine.  So it doesn't seem like the problem is in the bootloader, but in my application package.  I'm not sure what it is though.  If I flash the firmware and bootloader directly, everything works fine.  Then if I package the exact same application and try to flash over DFU, that's when I get this Unknown Command error.  Do you see something wrong with the settings I am using with nrfutil to package my application?