nrfutil connectivity firmware location

Hello Nordic Team

I am successfully using nrfutil connectivity to upload secure ZIPs via secure DFU to my nRF52840 devices and my clients love it. The command in my batch file is:

nrfutil dfu ble -ic NRF52 -f -n %DEV_NAME% -pkg %APP_PATH%%APP_ZIP%

As you are aware, the "-f" switch uploads the connectivity firmware into my connectivity device and everything works extremely well. I later remove the -f switch and use -snr once I know the serial number of the connectivity device. This speeds up subsequent DFU uploads and again everything works well.

My issue is the connectivity firmware shows no indication of a BLE connection or any DFU progress once connected (or not, you can't tell!).

My solution is to create a version of the connectivity firmware with LED indication of status and I would really like nrfutil to flash my connectivity firmware instead of the current version.

So my question is; where is the connectivity firmware located that nrfutil uses to flash the connectivity device and can it be replaced?

I would appreciate any insight you have on the issue.

D

  • Hello,

    Mine is located in:

    C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pc_ble_driver_py\hex\sd_api_v5\connectivity_<version>.hex

    So depending on whether you are using the dongle or the DK, it will pick one from there. Note that it is using s132 whether you are using the nRF52840 or the nRF52832 as your connectivity device. 

    If you are just using the normal DK (nRF52832 or nRF52840) with the cable plugged into the onboard debugger, then it will use the connectivity_4.1.4_1m_with_s132_5.1.0.hex, so this is the file you would want to replace.

    I don't know what sort of impacts it could have to modify this file, so please be aware that you will do it at your own risk. I will however suspect that as long as nrfutil doesn't give you any error messages along the way, then the FW on the target device after the DFU will not be affected, since there are many other safety mechanisms around the DFU procedure. So even a single flipped bit will cause the bootloader on the target device to reject the new FW.

    Best regards,

    Edvin

  • Hi Edvin

    Yes, your reply is in line with  RE: nrfutil v6.1.0 dfu ble fail with connectivity firmware v4.1.2 

    Unfortunately I do not have the same directory structure....

        C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python310\Lib\site-packages

    ... there is no pc-ble-driver-py directory so the rest of the path does not exist.

    My nrfutil version details are as follows:

        nrfutil 7.5.0 (063f665 2023-05-11)
        commit-hash: 063f665c8ef5e4d46167077b52d39cf4e66ca24f
        commit-date: 2023-05-11
        host: x86_64-pc-windows-msvc
        build-timestamp: 2023-05-11T07:46:36.6366955Z
        classification: nrf-external

    I tried reinstalling nrfutil but the directory did not appear, so I am lost as to where nrfutil has put the hex files. I even tried looking for "connectivity*.hex" on all drives but found nothing. Clearly nrfutil is uploading a working connectivity hex, but from where! I already had python 3.10 installed, would this make a difference? Is this version of Python incompatible?

    I installed nrfutil correctly as it works without issue. Could you please reach out to the nrfutil development team to see if they have moved the hex file locations? Perhaps I need to use an older nrfutil (or Python). What version are you using?

    D

  • Hello,

    I actually postponed updating to this nrfutil version until now, because the old one worked just fine Slight smile

    I see that in the new version, the file that I linked to is not in use. I asked the nrfutil developers, and they said that the file is, in fact, not a .hex file located somewhere after you install nrfutil. It is generated during runtime from a python script, so it is not possible to replace it like it used to do.

    If you are only using nrfutil for this, and you don't need any of the new features, I suggest you uninstall nrfutil, and install the old (legacy) version, either directly from:

    https://statics.teams.cdn.office.net/evergreen-assets/safelinks/1/atp-safelinks.html

    or you can use "pip install nrfutil", which will install the latest legacy version. In that case you should find the file located somewhere similar to the one in my previous reply. If you can't find it, just search for ".hex" from the Python folder. When you locate it, replace the file with your custom file, and remember to rename it to what the original file used to be called.

    Best regards,

    Edvin

  • Hi Edvin

    Unfortunately the link does not work - I just get 1 dot, 2 dots, 3 dots... then it starts again.

    I installed nrfutil via pip as suggested and ran into all sorts of issues as specified here : 

     nrfutil ModuleNotFoundError: No module named 'constants' 

    To run legacy nrfutil you have to downgrade python to v3.7 and pip to v20.11! This nrfutil downgrade issue was identified to the development team three years ago; but clearly there was no action as it was not fixed; perhaps in favor of the new solve all (!) Desktop Connect SDK development?

    Unfortunately, I believe I will have to abandon the dream of using nrfutil to automatically load custom connectivity firmware with link status indication - I will look at a manual upload in a batch command or something similar. I don't understand why the Nordic nrfutil/connectivity dev team buried the connectivity hex within a python script, but it clearly wasn't to assist Nordic clients. A very disappointing result from Nordic as this action seems more of a way to obfuscate a far cleaner legacy process. 

    I feel nrfutil is an integral tool for use with the SDK and to include only a basic connectivity solution without ANY indicators that cannot be upgraded! - this path is a very poor call from Nordic. Is it too much to expect such useful and important code components to be upgradable and customizable? We have connectivity firmware examples, but no way to include these hex files automatically with nrfutil?  Again, disappointed.

    D

  • Hello,

    Edvin is currently out of the office, so I will try to follow up on this. As pointed out in this thread, if you need to customize the python script or swap out the pre-compiled connectivity hex files, you will need to modify the Python source code available at https://github.com/NordicSemiconductor/pc-nrfutil . Afterward, you can install nrfutil from this modified code by running the 'setup.py' script provided in the project.

    However, if the goal is only to use a customized connectivity FW, then I think a more straight forward approach would be to simply program this FW to your board prior to invoking nrfutil. E.g from a batch script. Then you should be able to use nrfutil without any modifications (you just have to avoid using the '-f, --flash_connectivity' argument to now overwrite your custom FW).

    Dano said:
    To run legacy nrfutil you have to downgrade python to v3.7 and pip to v20.11! This nrfutil downgrade issue was identified to the development team three years ago; but clearly there was no action as it was not fixed; perhaps in favor of the new solve all (!) Desktop Connect SDK development?

    Dependency issues like these are one of the reasons for why the nRF Util now is only being distributed as a pre-compiled executable. Please note that The Secure DFU support in nRF util is not being actively maintained now as the nRF5 SDK has been put in maintenance mode (  nRF Connect SDK and nRF5 SDK statement )

Related