This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrfutil for Border Router

I am working with Thread on the nRF52840 and have setup a few nodes and a Border Router 1.0.0 as described in the documentation using Raspberry Pi 3B+.

My sdk is nRF5_SDK_for_Thread_and_Zigbee_v1.0.0

Is it possible to run nrfutil on the Raspberry Pi?

I tried the following on Rasp Pi:

sudo apt-get update

sudo apt-get install python-pip

sudo pip install nrf util

It seemed to successfully install, but I'm thinking it's intended for a PC, not ARM.

I followed the Thread Secure DFU example using my PC successfully, and then prepared another package (appdfu_package_3.zip) with a minor change to the client code.

I ran nrfutil as before, only this time on the Raspberry Pi within the Border Router.  I left off the -f option, since the Border Router is already connected to a DK board running NCP.

nrfutil dfu thread -pkg appdfu_package_3.zip --channel 11 --panid 43981 -r 8 -rs 5000 -a FF03::1
Traceback (most recent call last):
  File "/usr/local/bin/nrfutil", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/nordicsemi/__main__.py", line 901, in thread
    ble_driver_init('NRF52')
  File "/usr/local/lib/python2.7/dist-packages/nordicsemi/__main__.py", line 65, in ble_driver_init
    from pc_ble_driver_py.ble_driver    import BLEDriver, Flasher
  File "/usr/local/lib/python2.7/dist-packages/pc_ble_driver_py/ble_driver.py", line 105, in <module>
    raise RuntimeError("Could not load shared library {} : '{}'.".format(shlib_path, error))
RuntimeError: Could not load shared library /usr/local/lib/python2.7/dist-packages/pc_ble_driver_py/lib/linux/x86_32/libpc_ble_driver_shared_sd_api_v3.so : '/usr/local/lib/python2.7/dist-packages/pc_ble_driver_py/lib/linux/x86_32/libpc_ble_driver_shared_sd_api_v3.so: cannot open shared object file: No such file or directory'.

The libraries is said it couldn't find are in fact there.  But I suspect they are compiled for x86 and not ARM, given the path name.

I saw an older post https://devzone.nordicsemi.com/f/nordic-q-a/15509/trying-to-use-a-nrfutil-command-on-raspbian-os describing how to compile nrfutil from source, but it's a bit old and doesn't mention these libraries.

Is this possible?  Any plans to provide nrfutil for ARM?

Mary

  • Hi,

    You are correct that the library is compiled for x86 Linux and not ARM Linux. The pc-ble-driver library seems to only be used for checking/flashing the NCP firmware when doing Thread DFU. Even though you do not include the -f argument, you will get an error anyway when the application is trying to import the library, and it is not found.

    You can try to remove the import of the library in the __main__.py file (/usr/local/lib/python2.7/dist-packages/nordicsemi/__main__.py), and everything calling functions from this library. 

    The flasher library in pc-ble-driver is dependent on the J-Link ARM dll file for performing firmware flashing and memory operations. The J-Link SDK have not been available for ARM Linux architecture before. According to this post it should now be available, but without any support for the ARM version. I do not think we will add support for this until it is available in stable release, with support from Segger.

    Best regards,
    Jørgen

  • Is there an example showing how to perform DFU using a remote server? 

    How is this expected to be done in the field at a customer site?

    Is there a way to set the master key as well as the panid and channel?

    Mary

  • I would suggest that you read the Thread Secure DFU Example documentation thoroughly, it should explain how the Thread DFU process works in more details. I'm not aware of any examples showing DFU using a remote server. If you can provide some details on the specific use case you are looking into, I can check with our Thread developers if they have some more information.

    Mary said:
    Is there a way to set the master key as well as the panid and channel?

    Is this question related to the DFU process, or are you asking this as a general question?

  • I have read the Thread Secure DFU Example, tested it, and merged the client code into my application.  From the documentation: "For example, the DFU server could be a cloud service, an nRF52840 Development Kit in conjunction with nrfutil, or a mobile phone running an application."

    I don't want to ship my customer a Development Kit in order to perform an update in the field.  So, I'm wanting a server that would run at my customer's site on a host computer.  The same computer that would be communicating with the Thread nodes via the Border Router.  Or, a server that would run on the Border Router.

    I note that nRFConnect is an available Android app, but it doesn't support Thread, only BLE.  Does there exist a DFU server application that communicates with a Thread network through the Border Router?

    Mary said:
    Is there a way to set the master key as well as the panid and channel?

    Is this question related to the DFU process, or are you asking this as a general question?

    When running nrfutil on my PC with the Development Kit, I can set the panid and channel in the nrfutil command.  It uses the default master key (0x00112233445566778899aabbccddeeff).  So, if I formed my network with another master key (which we certainly would do in the field) the DFU doesn't work.  I had to reform my network and recommission the target node using the default master key. So, I want to be able to set the master key, from nrfutil, to match that of my network.

  • Hi,

    I forwarded your questions to our Thread team, this is the feedback I got:

    Though, if you plan to enable internet connectivity to the Thread Network, you may setup DFU server in the cloud and use unicast DFU, where nodes individually will poll a new software while available.

    Unfortunately, there is no standard way of doing this, and so, in our examples we use CoAP – which should be treated as an example implementation of how it may be done.

    When it comes to the question about default masterkey, that is true if you want to connect some random board to your PC and start to upgrade node’s firmware – you need to know masterkey in advance.

    Though, if Border Router with NCP could be a part of a network, then NCP naturally knows masterkey and application (nrfutil) wouldn’t need to bother about this. This however might require some software changes.

    If you want information about multicast DFU as well, I need to check this with the Thread DFU expert when he is back from vacation.

    Best regards,
    Jørgen

Related