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

nrfutil for nrf52840

Hello,

We are trying to use nrfutil to perform DFU on our linux system which includes two host targets 1 an Intel machine and the other ARM machine

On the Intel machine DFU worked with version 6.1.0, but "pip install nrfutil" installs 5.2.0 version.  Is there a way to force pip to install version 6.1.0

On the ARM machine pip attempts to install 6.1.0 however it fails with the following error:


root@apalis-imx8:/dev# python3 -m pip install nrfutil
Collecting nrfutil
Using cached nrfutil-6.1.0.tar.gz (842 kB)
Requirement already satisfied: click in /usr/lib/python3.8/site-packages (from nrfutil) (7.1.2)
Requirement already satisfied: crcmod in /usr/lib/python3.8/site-packages (from nrfutil) (1.7)
Requirement already satisfied: ecdsa in /usr/lib/python3.8/site-packages (from nrfutil) (0.13.3)
Requirement already satisfied: intelhex in /usr/lib/python3.8/site-packages (from nrfutil) (2.3.0)
Requirement already satisfied: libusb1 in /usr/lib/python3.8/site-packages (from nrfutil) (1.9.2)
ERROR: Could not find a version that satisfies the requirement pc_ble_driver_py>=0.14.2 (from nrfutil) (from versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4)
ERROR: No matching distribution found for pc_ble_driver_py>=0.14.2 (from nrfutil)

My question is what is the version of the nrfutil that is recommended along with what version of python for ARM and INTEL machines for the "nrf52840" device?

Thank you.

Omid Athari

Nikola Motor Inc

Parents
  • Hi,

    ARM architecture is not supported by nrfutil or pc-ble-driver-py in the releases from Nordic. I assume that your ARM machine fetches the wheels from piwheels (or something similar), and not from PyPi directly. As you can see from the link, there is no build of pc-ble-driver-py available from piwheels newer than v0.11.4.

    Note that pc-ble-driver-py depends on linkable libraries from pc-ble-driver, which are not built for ARM architecture. You may need to rebuild the libraries from source for your architecture to get it working. 

    What are you planning to use nrfutil for? Some of the functionality does not depend directly on pc-ble-driver(-py), and you may be able to run it directly without installing through pip as described in step 3 on this page.

    Best regards,
    Jørgen

  • BTW we are running linux on both the Intel host and the ARM target machine.

  • nrfutil v5.2.0 should be able to generate and perform DFU on nRF52840, the documentation say all version above 2.2.0 will support nRF52840. To support SDK versions later than nRF5 SDK v15.3.0, you need nrfutil v5.0.0 or above.

    Note that Python 3 support was not added to nrfutil until v6.0.0, the error you are seeing it because you run the old version (which only supports Python 2.7.x) on a Python 3.8.x release.

  • I see. So therefore we need to install python2.7 first and then install pip2 and then install nrfutil using pip2. Correct?

    Is there another standalone program to perform the DFU on the arm board.  I was told that there is a c++ program that is capable of uploading the firmware to the device.  Is that correct?

  • OmidAthari said:
    So therefore we need to install python2.7 first and then install pip2 and then install nrfutil using pip2. Correct?

    Yes, that is correct

    OmidAthari said:
    Is there another standalone program to perform the DFU on the arm board.  I was told that there is a c++ program that is capable of uploading the firmware to the device.  Is that correct?

    That depends on how the ARM board will perform the DFU. For DFU over BLE, the only options available is nrfutil and nRF Connect applications on desktop and mobile (desktop version is based on pc-ble-driver-js). For serial DFU, there is a DFU master example written in C available in this post. It is also possible to implement a custom solution for DFU over BLE, but we do not have any examples for this. A customer have given some guidelines in this post

  • Hi Jorgen,

    We were trying to avoid installing python 2  on our ARM target board if at all possible.  We have very limited resources on that board.  

    On the ARM target all we want to do is to update the application on the device via the serial port with something like this:

    "nrfutil dfu usb-serial -p /dev/tty-device -pkg ./application.zip"

    The DFU master code that you pointed me to looks like is geared towards one Nordic device updating a second device that is running in DFU mode.  Correct? I suppose this code can be used as a guide to create a custom C program to do the what "nrfutil dfu" does.  Is that right?

    Is there no such C program already created? I was told that this exists.  That way we don't have to install python on our ARM at all which would be very desirable.

    Please advise 

    Thank you 

  • Hi,

    OmidAthari said:
    We were trying to avoid installing python 2  on our ARM target board if at all possible.  We have very limited resources on that board. 

    I can understand your concerns.

    OmidAthari said:

    On the ARM target all we want to do is to update the application on the device via the serial port with something like this:

    "nrfutil dfu usb-serial -p /dev/tty-device -pkg ./application.zip"

    Ok, so you want to do serial DFU, and not DFU over BLE.

    OmidAthari said:
    The DFU master code that you pointed me to looks like is geared towards one Nordic device updating a second device that is running in DFU mode.  Correct? I suppose this code can be used as a guide to create a custom C program to do the what "nrfutil dfu" does.  Is that right?

    Yes, that is correct.

    OmidAthari said:
    Is there no such C program already created? I was told that this exists.  That way we don't have to install python on our ARM at all which would be very desirable.

    I'm not aware of any official solutions for this, but you may find this repository useful: https://github.com/jimmywong2003/nrf-slim-serial-uart-dfu-host-c-code. Since this is based on nRFutil v3.5.0 and nRF5 SDK v15.2.0, it may not support SDK versions from SDK 15.3.0 and above, as these introduces some changes to the packets, but I'm not sure if this only affects generating packets or also performing DFUs.

    Best regards,
    Jørgen

Reply
  • Hi,

    OmidAthari said:
    We were trying to avoid installing python 2  on our ARM target board if at all possible.  We have very limited resources on that board. 

    I can understand your concerns.

    OmidAthari said:

    On the ARM target all we want to do is to update the application on the device via the serial port with something like this:

    "nrfutil dfu usb-serial -p /dev/tty-device -pkg ./application.zip"

    Ok, so you want to do serial DFU, and not DFU over BLE.

    OmidAthari said:
    The DFU master code that you pointed me to looks like is geared towards one Nordic device updating a second device that is running in DFU mode.  Correct? I suppose this code can be used as a guide to create a custom C program to do the what "nrfutil dfu" does.  Is that right?

    Yes, that is correct.

    OmidAthari said:
    Is there no such C program already created? I was told that this exists.  That way we don't have to install python on our ARM at all which would be very desirable.

    I'm not aware of any official solutions for this, but you may find this repository useful: https://github.com/jimmywong2003/nrf-slim-serial-uart-dfu-host-c-code. Since this is based on nRFutil v3.5.0 and nRF5 SDK v15.2.0, it may not support SDK versions from SDK 15.3.0 and above, as these introduces some changes to the packets, but I'm not sure if this only affects generating packets or also performing DFUs.

    Best regards,
    Jørgen

Children
No Data
Related