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'

  • 1. Is there any use case or example that working on UART for Thread DFU

    Yes, I know about the NCS and

    I am using NCS for BLE,

    But for Thread and zigbee i didn't work on NCS. Let me try NCS for Thread also

    Thanks for your suggestion.

  • No. As it is general dfu use case, it should be similar as example Secure DFU Bootloader over Serial Link (UART/USB). For nRF5_SDK_for_Thread_and_Zigbee_v4.1.0, it is located in examples\dfu\secure_bootloader.

    Best regards,

    Charlie

  • Hi,

    I have python 3.9.8

    as you said  download ot_ncp_ftd_nRF52840DK.hex   to C:\Python3\Lib\site-packages\nordicsemi\thread\hex and change name to ncp.hex

    also i got the error

    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 COM22 --channel 11 --panid 43981
    Address not specified. Using ff03::1 (all Thread nodes)
    Using connectivity board at serial port: COM22
    Flashing connectivity firmware...
    Connectivity firmware flashed.
    2021-12-17 00:04:00,840 Failed to set property PROP_IPv6_ICMP_PING_OFFLOAD
    Traceback (most recent call last):
      File "C:\Python3\lib\site-packages\nordicsemi\__main__.py", line 1438, in thread
        transport.open()
      File "C:\Python3\lib\site-packages\nordicsemi\thread\tncp.py", line 227, in open
        if (not self._attach_to_network()):
      File "C:\Python3\lib\site-packages\nordicsemi\thread\tncp.py", line 107, in _attach_to_network
        self._set_property(*props)
      File "C:\Python3\lib\site-packages\nordicsemi\thread\tncp.py", line 90, in _set_property
        raise Exception("Failed to set property {}".format(self.__class__._propid_to_str(propid)))
    Exception: Failed to set property PROP_IPv6_ICMP_PING_OFFLOAD
    Exception in thread Thread-2:
    Traceback (most recent call last):
      File "C:\Python3\lib\threading.py", line 973, in _bootstrap_inner

    even though I un Comment line 223 and 224

  • How to create this ncp.hex for nrf52833DK

    i used mSYS and following error is shown

    SUNIL@DESKTOP-5IFRU4Q /d/nRF5xx/ot-nrf528xx-main
    $ ./script/bootstrap
    ++ dirname ./script/bootstrap
    + ./script/../openthread/script/bootstrap
    ./script/bootstrap: line 32: ./script/../openthread/script/bootstrap: No such file or directory
    
    SUNIL@DESKTOP-5IFRU4Q /d/nRF5xx/ot-nrf528xx-main
    $ ./script/build nrf52833 UART_trans
    + OT_CMAKE_NINJA_TARGET=
    + NRF_PLATFORMS=(nrf52811 nrf52833 nrf52840)
    + readonly NRF_PLATFORMS
    + NRF_BUILD_TYPES=(UART_trans USB_trans SPI_trans_NCP soft_crypto soft_crypto_threading)
    + readonly NRF_BUILD_TYPES
    ++ pwd
    + readonly OT_SRCDIR=/d/nRF5xx/ot-nrf528xx-main
    + OT_SRCDIR=/d/nRF5xx/ot-nrf528xx-main
    + OT_OPTIONS=("-DCMAKE_BUILD_TYPE=MinSizeRel" "-DOT_PLATFORM=external" "-DOT_SLAAC=ON")
    + readonly OT_OPTIONS
    + main nrf52833 UART_trans
    + [[ 2 == 0 ]]
    + local platform=nrf52833
    + echo nrf52811 nrf52833 nrf52840
    + grep -wq nrf52833
    + [[ 2 == 1 ]]
    + local nrf_build_type=UART_trans
    + echo UART_trans USB_trans SPI_trans_NCP soft_crypto soft_crypto_threading
    + grep -wq UART_trans
    + shift
    + shift
    + local_options=()
    + local local_options
    + options=("${OT_OPTIONS[@]}")
    + local options
    + case "${platform}" in
    + local_options+=("-DCMAKE_TOOLCHAIN_FILE=src/${platform}/arm-none-eabi.cmake")
    + case "${nrf_build_type}" in
    + options+=("${local_options[@]}")
    + options+=("$@")
    + build -DNRF_PLATFORM=nrf52833 -DCMAKE_BUILD_TYPE=MinSizeRel -DOT_PLATFORM=external -DOT_SLAAC=ON -DCMAKE_TOOLCHAIN_FILE=src/nrf52833/arm-none-eabi.cmake
    + local builddir=build
    + mkdir -p build
    + cd build
    + cmake -GNinja -DOT_COMPILE_WARNING_AS_ERROR=ON -DNRF_PLATFORM=nrf52833 -DCMAKE_BUILD_TYPE=MinSizeRel -DOT_PLATFORM=external -DOT_SLAAC=ON -DCMAKE_TOOLCHAIN_FILE=src/nrf52833/arm-none-eabi.cmake /d/nRF5xx/ot-nrf528xx-main
    ./script/build: line 57: cmake: command not found

Related