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

nrfutil dfu random failures

We're using nrfutil v.6.1.0 in order to perform DFU updates to our target board using nrf52840-Dongle, and we're experiencing some issues. Everytime we try a download, even if sometimes we're able to successfully perform it, we often witness a high failure rate, mostly caused by random errors happening while trying to connect to the target board, like the following:

pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_exchange_mtu_req. Error code: NRF_ERROR_INVALID_PARAM

pc_ble_driver_py.exceptions.NordicSemiException: MTU exchange request failed. Common causes are: missing att_mtu setting in ble_cfg_set, different config tags used in ble_cfg_set and connect.

We tried with a lower MTU, or disabling the MTU negotiation inside the nrfutil python script, but it did not solve the issue.

We tried to perform the download using nRF Connect v3.5.0 (Bluetooth Low Energy App v.2.4.0) using the same dongle, and we experienced no issues at all, 100% download success rates;
so we assumed that the issue was not inside the nrf connectivity Fw of the dongle, nor in our target board bootloader.

We did some research and found out that at the time of writing, nRF Connect v3.5.0 relies on pc-ble-driver-js v2.7.2 library to perform DFU updates, while nrfutil uses pc-ble-driver-py v0.14.2.
Both libraries relies on pc-ble-driver library but the phyton lib is outdated and currently points to pc-ble-driver v4.1.1, while the Node.JS lib points to pc-ble-driver v4.1.2.

In the release notes of pc-ble-driver v4.1.2, the following it's stated:

Bug fixes

  • Fixed an issue where events after SD_BLE_GAP_CONNECT were occasionally not received
  • Fixed an issue where USB connectivity firmware hangs after receiving many notifications

We're suspecting that those fixes are related to the issues we're experiencing and so we're wondering if you could update pc-ble-driver-py to the latest pc-ble-driver version and release an updated nrfutil tool.
Since we're planning to use nrfutil to perform updates on the company assembly line by december, we cannot rely on the current unstable behavior, so the issue is quite urgent and we'd like to have a stable version asap.

Can you please comment on our considerations? could it be the root cause? are you already planning a new release of nrfutil? if yes, when?

Thank you very much for your support.

Regards.

Parents
  • Hello,

    How did you install nrfutil v6.1.0? Can you try to install it using pip install?

    I can't say that I have seen this issue before. What dongle version do you have? What does it say on the sticker on the dongle?

    Best regards,

    Edvin

  • Hi,

    yes, we did both pip install and installation from sources, but both methods produced failures.

    Dongle Information:

    nRF52840-Dongle

    PCA10059

    1.2.0

    2019.37

    F9:4F:15:99:31:88

    we tried flashing the Dongle Connectivity Fw using both Nrf Connect Ble and nrfutils (using -f option) but the results were the same.

    We are experiencing the same problems on 2 different PCs with 2 different dongles ( the second has 2020.07 reported on the sticker, the other values are the same except for the MAC address obviously).

  • When you are using nrfutil, you should flash the device using nrfutil as well. It is not the same FW running when you use the dongle as the connectivity dongle on nRF Connect for Desktop and when you use it as the connectivity dongle for nrfutil.

    Let me give it a go tomorrow (I am sorry. I am not in the office today, and I don't have a dongle with me, so I will have to try tomorrow).

    Just in case I have some difficulties reproducing. What SDK is your bootloader from, and what Hardware is the target device running? Does it reproduce with an unmodified bootloader as well?

    Best regards,

    Edvin

  • i narrowed down the issue in order to help you reproduce it. The best configuration i found was the following:

    Target board: PCA10100

    IDE: Segger Embedded Studio

    i compiled and flashed the following fw: examples\dfu\secure_bootloader\pca10100_s140_ble from SDK 17.0.0 using a public key generated from a private key generated with nrfutils 6.1.0

    i compiled the following fw: \examples\ble_peripheral\ble_app_uart\pca10100\s140 from from SDK 17.0.0 and created a DFU package using the previously created private key.

    i started DFU update with nrfutils 6.1.0 after flashing the dongle Fw with the -f option (the dongle shows a green LED on) and i tried 10 downloads. 2 of them showed the following error just after the connection phase:

    pc_ble_driver_py.exceptions.NordicSemiException: MTU exchange request failed. Common causes are: missing att_mtu setting in ble_cfg_set, different config tags used in ble_cfg_set and connect.

    I also tried with PCA10056 eval board using precompiled FW from examples\dfu\secure_dfu_test_images\ble\nrf52840 and i was not able to reproduce the issue, so COULD be a something influenced by the HW, but  in my opinion still related to the tools performing the update, not to the target itself.

    I still believe that an update of pc-ble-driver-py library with the pc-ble-driver v4.1.2 could be one of the first things to do, due to the release notes issues that i posted in the main post.

Reply
  • i narrowed down the issue in order to help you reproduce it. The best configuration i found was the following:

    Target board: PCA10100

    IDE: Segger Embedded Studio

    i compiled and flashed the following fw: examples\dfu\secure_bootloader\pca10100_s140_ble from SDK 17.0.0 using a public key generated from a private key generated with nrfutils 6.1.0

    i compiled the following fw: \examples\ble_peripheral\ble_app_uart\pca10100\s140 from from SDK 17.0.0 and created a DFU package using the previously created private key.

    i started DFU update with nrfutils 6.1.0 after flashing the dongle Fw with the -f option (the dongle shows a green LED on) and i tried 10 downloads. 2 of them showed the following error just after the connection phase:

    pc_ble_driver_py.exceptions.NordicSemiException: MTU exchange request failed. Common causes are: missing att_mtu setting in ble_cfg_set, different config tags used in ble_cfg_set and connect.

    I also tried with PCA10056 eval board using precompiled FW from examples\dfu\secure_dfu_test_images\ble\nrf52840 and i was not able to reproduce the issue, so COULD be a something influenced by the HW, but  in my opinion still related to the tools performing the update, not to the target itself.

    I still believe that an update of pc-ble-driver-py library with the pc-ble-driver v4.1.2 could be one of the first things to do, due to the release notes issues that i posted in the main post.

Children
No Data
Related