Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Thread secure DFU

Hi,

I am working on nRF5 Thread 4.1.0 and I am trying to do Thread DFU

I am following https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.thread_zigbee.v2.0.0%2Fthread_example_dfu.html

on 6th point Use nrfutil to run the DFU:

i have run the command

nrfutil dfu thread -f -pkg app_dfu_package.zip -p COM3 --channel 11 --panid 43981 -r 4 -rs 5000 -a FF03::1

D:\nRF5xx\4.nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8\examples\thread\dfu>nrfutil dfu thread -f -pkg app_dfu_package.zip -p COM5 --channel 11 --panid 43981 -r 4 -rs 5000 -a FF03::1
Using connectivity board at serial port: COM5
Traceback (most recent call last):
  File "C:\Python3\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 3201, in call_cmd
    return subprocess.check_output(argstr, stderr=subprocess.STDOUT, shell=True)
  File "C:\Python3\lib\subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Python3\lib\subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'nrfjprog --snr 683959334 --verify C:\Python3\lib\site-packages\nordicsemi\thread\hex\ncp.hex --family NRF52' returned non-zero exit status 55.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python3\Scripts\nrfutil-script.py", line 33, in <module>
    sys.exit(load_entry_point('nrfutil==6.1.3', 'console_scripts', 'nrfutil')())
  File "C:\Python3\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python3\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "C:\Python3\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python3\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python3\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python3\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "C:\Python3\lib\site-packages\nordicsemi\__main__.py", line 1403, in thread
    if flasher.fw_check():
  File "C:\Python3\lib\site-packages\nordicsemi\thread\ncp_flasher.py", line 56, in fw_check
    result = self.verify(self.__get_hex_path())
  File "C:\Python3\lib\site-packages\nordicsemi\thread\ncp_flasher.py", line 52, in verify
    return self.call_cmd(args)
  File "C:\Python3\lib\site-packages\wrapt\decorators.py", line 469, in _synchronized
    return wrapped(*args, **kwargs)
  File "C:\Python3\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 3206, in call_cmd
    raise RuntimeError(f"{e.__str__()}\n{e.output}")
RuntimeError: Command 'nrfjprog --snr 683959334 --verify C:\Python3\lib\site-packages\nordicsemi\thread\hex\ncp.hex --family NRF52' returned non-zero exit status 55.
b'Verifying programming.\r\nERROR: Write verify failed.\r\nNOTE: For additional output, try running again with logging enabled (--log).\r\nNOTE: Any generated log error messages will be displayed.\r\n'

Parents Reply Children
  • I think i upload that hex file directly to the board using the nrf connect for desktop and then i followed the thread dfu.

  • Hi Sunil,

    Thank you this works. Just for my knowledge have you tried out nrf connect SDK? (very few examples are present)

  • C:\Development\Thread_DFU>nrfutil dfu thread -f -pkg app_dfu_package.zip -p COM16 --channel 11 --panid 43981 -r 4 -rs 5000 -a FF03::1
    Using connectivity board at serial port: COM16
    Flashing connectivity firmware...
    Connectivity firmware flashed.
    Waiting for NCP to promote to a router...
    Waiting 20s before starting multicast DFU procedure
    Thread DFU server is running... Press <Ctrl + D> to stop.
    ff03::1: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3.79it/s]
    ff03::1: 38%|███████████████████████████████████████████████████████████████████████▎ | 2458/6413 [11:06<17:16, 3.82it/s]Exception in thread Upload thread:
    Traceback (most recent call last):
    File "C:\Users\spx0847\AppData\Local\Programs\Python\Python39\lib\threading.py", line 973, in _bootstrap_inner
    self.run()
    File "C:\Users\spx0847\AppData\Local\Programs\Python\Python39\lib\threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
    File "C:\Users\spx0847\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\thread\dfu_server.py", line 290, in _upload
    self._send_block(remote,
    File "C:\Users\spx0847\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\thread\dfu_server.py", line 269, in _send_block
    self.protocol.request(request)
    File "C:\Users\spx0847\AppData\Local\Programs\Python\Python39\lib\site-packages\piccata\core.py", line 559, in request
    return self._transaction_layer.send_request(request, response_callback, response_callback_args, response_callback_kw)
    File "C:\Users\spx0847\AppData\Local\Programs\Python\Python39\lib\site-packages\piccata\core.py", line 442, in send_request
    self._message_layer.send_message(request)
    File "C:\Users\spx0847\AppData\Local\Programs\Python\Python39\lib\site-packages\piccata\core.py", line 216, in send_message
    self._transport.send(raw_message, message.remote)
    File "C:\Users\spx0847\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\thread\tncp.py", line 184, in send
    src_addr = ipaddress.ip_address(self._ml_prefix + b'\x00\x00\x00\xff\xfe\x00' + struct.pack('>H', rloc16))
    struct.error: required argument is not an integer

  • Getting an error at a later stage. Is it something you came across or Should I create a new query? 

    Regards,

    Tushar

  • Hi,

    Try to erase all the things and upload the latest .hex which is from the sdk itself and try this dfu. if still error is there create the new query

Related