This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

create DFU package using nfutil issue

I have followed the procedures to create a DFU package

- Using existing sample hex file "hrs_application_s132.hex"

1. nrfutil keys generate private.pem

2. nrfutil pkg generate --debug-mode --hw-version 52 --sd-req 0x101,0xCAFE --application-version 1 --key-file private.pem --application hrs_application_s132.hex hrs_application_s132.zip

3. Loaded the target board using nRF_Connect (Desktop) with "s132_nrf52_7.2.0_softdevice.hex" and "bootloader_secure_ble_debug_without_bonds_s132.hex"

4. Using the nRF52-DK board to run,  nrfutil dfu ble -ic NRF52 -pkg hrs_application_s132.zip -p COM15 -n "DfuTest" -f

The DFU would fail with ERROR

Connectivity firmware flashed.
[------------------------------------] 0%
Traceback (most recent call last):
File "C:\Tools\Python\Python38\Scripts\nrfutil-script.py", line 33, in <module>
sys.exit(load_entry_point('nrfutil==6.1.3', 'console_scripts', 'nrfutil')())
File "c:\tools\python\python38\lib\site-packages\click\core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "c:\tools\python\python38\lib\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "c:\tools\python\python38\lib\site-packages\click\core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\tools\python\python38\lib\site-packages\click\core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\tools\python\python38\lib\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\tools\python\python38\lib\site-packages\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "c:\tools\python\python38\lib\site-packages\nordicsemi\__main__.py", line 1205, in ble
dfu.dfu_send_images()
File "c:\tools\python\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
self._dfu_send_image(self.manifest.application)
File "c:\tools\python\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 88, in _dfu_send_image
self.dfu_transport.open()
File "c:\tools\python\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 475, in open
self.target_device_name, self.target_device_addr = self.dfu_adapter.connect(
File "c:\tools\python\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 153, in connect
self.verify_stable_connection()
File "c:\tools\python\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 264, in verify_stable_connection
raise Exception("Connection Failure - Device not found!")
Exception: Connection Failure - Device not found!

NOTE : 

if using the "hrs_application_s132.zip" from SDK package, the OTA (DFU) will be working.

I would suspect my parameters were wrong while creating the zip file package

Parents Reply
  • I think it is the Private key issue.

    Since I am using a Private Key to generate the ZIP package but using the SDK pre-build "bootloader_secure_ble_debug_without_bonds_s132.hex" which has different Public Key.

    Question : 

    1. Is there a pre-build non-secure bootloader I could try out the whole process for testing ?

    2. Is the private key available in SDK which will match the public key ?

    Or only way to get this working is create my own bootloader ?

Children
  • dilbert168 said:
    1. Is there a pre-build non-secure bootloader I could try out the whole process for testing ?

    No.

    dilbert168 said:
    2. Is the private key available in SDK which will match the public key ?

    No. This is to make sure that no customers use the public key from the SDK. 

    dilbert168 said:
    Or only way to get this working is create my own bootloader ?

    I would recommend to do so. It doesn't take that long if you follow the guide from my last reply. You can also use nrfutil for the DFU image transfer instead of nRF Connect for mobile (like the guide does). So basically follow everything up to that point. 

    Generating your own keypair is quite simple:

    nrfutil keys generate private.key
    nrfutil keys display --key pk private.key --format code --out_file dfu_public_key.c

    Which will generate a key set that you can replace the dfu_public_key.c.

    Then compile your bootloader, flash it (and the softdevice), generate a dfu image. Use "nrfutil pkg generate --help" for more information, and transfer the image like you did in your first post in this thread.

    Best regards,

    Edvin

  • Thanks for the info in the link.

Related