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
  • Thank you charlie .I will test and send my feedback

  • Hi charlie,

    1. Is it possible to upload the firmware using Serial (Thread only application)

    2. I have Adafruit 4333 board with bootloader . is it possible to upload Thread .hex to the board using the default bootloader

    https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/README.md

    https://github.com/adafruit/Adafruit_nRf52_nrfutil

  • 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

  • I found the problem

    That is when the DK is empty and using the above nrfutil dfu thred .... command

    it use nrfjprog to upload the ncp.hex

    and it gets failure because of verification failed , instead of that when i upload the ncp.hex using programmer and then i run these nrfutil dfu thread command . then the command works and it took so much time to upload the file

Related