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

OTA DFU error 60-04-05 on nRF Connect v2.6.1

I am testing on my own board.
The SDK is nRF5_SDK_12.3.0_d7731ad
IDE is IAR Embedded for arm 8.30, windows version.
Softdevice is S130.
chip nRF51822_xxAC.


The firmware incorporates nus + dfu buttenless + secure dfu + hid keyboard.

A long time ago I succeeded in ota dfu in this environment.
Of course, by creating a custome private key.


But after a long time, I work again and everything is new.
So I have been using "nrfutil v4.0.0 User Guide v1.4" and "Getting started with Nordic's Secure DFU bootloader, a step by step guide"
I'm working on it again.


button less application seems to work well.
The reason for this is that the application enters dfu via the nRF Connector pc-program.
However, I get a 60-04-05 error when up-loading the package (.zip) file from dfu.
nrf Dev. I see that the key is not right.


Package list and version information installed through python.
e: \ Work \ svn \ Aronia \ FW \ nrf51 \ merge> pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format = (legacy | c
columns) in your pip.conf under the [list] section) to disable t
his warning.
altgraph (0.16.1)
behave (1.2.6)
Click (7.0)
dis3 (0.1.2)
ecdsa (0.13)
enum34 (1.1.6)
future (0.17.1)
intelhex (2.2.1)
ipaddress (1.0.22)
linecache2 (1.0.0)
macholib (1.11)
nrfutyl (4.0.0)
parse (1.9.0)
parse-type (0.4.2)
pc-ble-driver-py (0.11.4)
pefile (2018.8.8)
piccata (1.0.1)
Pip (9.0.3)
protobuf (3.6.1)
PyInstaller (3.4)
pyserial (3.4)
pyspinel (1.0.0a1)
pywin32-ctypes (0.2.0)
setuptools (40.6.2)
six (1.11.0)
SomePackage (1.2.3)
tqdm (4.28.1)
traceback2 (1.4.0)
wrapt (1.10.11)
You are using pip version 9.0.3, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.


My work is like this.
1. PRIVATE.key key has been created.
   nrfutil.exe keys generate PRIVATE.key

2. You have created a public key.
  nrfutil keys display --key pk --format code RIVATE.key --out-file PUBLIC_KEY.c

3. secure bootloader I created the BOOTLOADER.hex file by building the bootloader firmware with reference to buttonless with the PUBLIC_KEY.c file.


4. Refer to SDK Example to build Firmware that supports HID-Keyboard service and Firmware that does not support HID-Keyboard by using integrated application firmware
  The names are HID_APPLICATION.hex and NO_HID_APPLICATION.hex.

5. I created a DFU Setting Page file file (BOOTLOADER_SETTING.hex).
nrfutil settings generate --family NRF51 --application NO_HID_APPLICATION.hex --application-version 0 --bootloader-version 0 --bl-settings-version 1 --no-backup BOOTLOADER_SETTING.hex

6. Setting file + application + softdevice + bootloader file has been merged.
  mergehex -m BOOTLOADER_SETTING.hex NO_HID_APPLICATION.hex -o OUTPUT_SETT_APP.hex
  mergehex -m OUTPUT_SETT_APP.hex BOOTLOADER.hex SOFT_DEVICE.hex -o OUTPUT.hex
  
7. I Flashig the Chip.
  nrfjprog -f nrf51 --program OUTPUT.hex --chiperase --verify --reset
  
8. I created a package file (.zip) to upload.
  I created a .zip file with the firmware available for hid-keyboard.
  nrfutil pkg generate --hw-version 51 --application-version 1 --application HID_APPLICATION.hex --sd-req 0x87 --key-file PRIVATE.key app dfu PACKAGE.zip
  
9. Use the nRF Connect pc-program to enter the DFU mode (success so far), then select the PACKAGE.zip file and proceed with the up-load.
  An error occurs during this process.
  
  
  Where did it go wrong?
  
  
The following is information about the PACKAGE.zip file
.. \ merge> nrfutil pkg display app_dfu_package.zip

DFU Package: <PACKAGE.zip>:
|
| - Image count: 1
|
| - Image # 0:
   | - Type: application
   | - Image file: HID_APPLICATION.bin
   | - Init packet file: HID_APPLICATION.dat
      |
      | - op_code: INIT
      | - signature_type: ECDSA_P256_SHA256
      | - signature (little-endian): 5672f283e36098497881f47490132f0d29d4ae10a49ae545c4a823eb3ca029d5
0fac0c2bb57456a4dbed13572c16d59fb3ff35ce608f9b1b60423c3a2cfd2ead
      |
      | - fw_version: 0x00000001 (1)
      | - hw_version 0x00000033 (51)
      | - sd_req: 0x87
      | - type: APPLICATION
      | - sd_size: 0
      | - bl_size: 0
      | - app_size: 53952
      |
      | - hash_type: SHA256
      | - hash (little-endian): cfbf8ea6ca149a6ff103c6dac1151897c1cad1e53094caf1861464a33bfaefe0
      |
      | - is_debug: False

Parents
  • Hi,

    Error code 0x05 NRF_DFU_RES_CODE_INVALID_OBJECT (which is what you got) may have several reasons, that you must check:

    • fw_version (must be higher or equal for application)
    • hw_version (51 looks correct)
    • matching set of keys used (public key used for building bootloader corresponds to private key used for generating update zip)
    • malformed init packet (although unlikely, it looks good from what I can tell)

    If all of those seems to be in order, then you could try with the debug version of the bootloader. That one will give you log messages that may help in deciding where exactly it goes wrong. Another option is to do a debug session, with breakpoints at the locations where NRF_DFU_RES_CODE_INVALID_OBJECT may be returned, in order to locate the exact position.

    Regards,
    Terje

Reply
  • Hi,

    Error code 0x05 NRF_DFU_RES_CODE_INVALID_OBJECT (which is what you got) may have several reasons, that you must check:

    • fw_version (must be higher or equal for application)
    • hw_version (51 looks correct)
    • matching set of keys used (public key used for building bootloader corresponds to private key used for generating update zip)
    • malformed init packet (although unlikely, it looks good from what I can tell)

    If all of those seems to be in order, then you could try with the debug version of the bootloader. That one will give you log messages that may help in deciding where exactly it goes wrong. Another option is to do a debug session, with breakpoints at the locations where NRF_DFU_RES_CODE_INVALID_OBJECT may be returned, in order to locate the exact position.

    Regards,
    Terje

Children
No Data
Related