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

Thread secure DFU example error

Hi,

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

I am following infocenter.nordicsemi.com/index.jsp

i have run the command

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

I get the following error:

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.84it/s]
ff03::1: 37%|████████████████████████████████████████████████████████████████████▏ | 2349/6413 [10:37<17:52, 3.79it/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

I have tried the solutions from this ticket as I had similar issues at first,

https://devzone.nordicsemi.com/f/nordic-q-a/82416/thread-secure-dfu

But then I get this error. 

Python: 3.9.1, nrfutil: 6.1.3, nrfjprog: 10.15.4 external JlinkARM.dll: 7.58b

Parents Reply Children
  • Hello Tushar,

    So when you followed the guide, did you use the same client example as the guide suggested? 

    It is not clear to me what exactly you did from the ticket that you linked to. Can you please elaborate? What HW is your connectivity board (the one that is COM16 in "nrfutil dfu thread ...")? And what did you flash it with, seeing as you didn't use the "flash flag", -f ?

    Best regards,

    Edvin

  • Hi Edvin, 

    Yes I have used the same client example as the guide suggested and followed every step available on https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.1.0%2Fthread_example_dfu.html

    The ticket which I linked here had the problem of file ncp.hex. As suggested there I downloaded the latest file provided there and ran it to which I get the above error. 

    COM16 is the nrf52840 DK connected. I have 2 nrf52840 DK, one of which acts as dfu client and the other I am using as dfu server. 

    Kind regards,

    Tushar

  • Hi Edvin,

    After many trials, the only thing which works (i.e. atleast the Thread dfu server is running) is original ncp.hex file (from nrfutil-6.1.3) has to be flashed on to the nrf52840 DK before doing the dfu thread package update. 

    But now I get a different error. 

    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.

    After this there is no response from the client side.

    Kind regards,

    Tushar

  • Hello Tushar,

    It is a bit "sensitive". I believe you need to start the DFU server shortly after the DFU client has started. At least it is possible to see some logging from the client that some things times out after a while. Do you see the log from the client?

    Without knowing the details exactly, I believe that the client stops looking for the DFU server after a given amount of time. But at the same time, I believe you need to turn on the DFU server after the client is promoted to router (or leader) in it's network. Can you test this?

    Best regards,

    Edvin

Related