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

Firmware DFU over BLE fails since nrfutil has been updated to version 6.0.

I have an existing setup, where firmware is transferred to a nRF52832 over a BLE USB dongle PCA10031 (V1.1.0) and nrfutil. This setup has been automated on our CI system/tools server and was working with nrfutil V5.2.0 reliably.

On 2019-12-16 I updated Python to version 3.7 so that nrfutil V6.0.0 got loaded. Since then the setup doesn't transfer the firmware.

The used command is:

nrfutil dfu ble --package /home/beamer/tbplatform.zip --conn-ic-id NRF51 --jlink_snr 680624486 --address C8:2D:57:C3:81:65

When used with nrfutil V6.0.0 I get the following output:

WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Traceback (most recent call last):
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/bin/nrfutil", line 10, in <module>
    sys.exit(cli())
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/nordicsemi/__main__.py", line 1142, in ble
    dfu.dfu_send_images()
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/nordicsemi/dfu/dfu.py", line 127, in dfu_send_images
    self._dfu_send_image(self.manifest.application)
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/nordicsemi/dfu/dfu.py", line 95, in _dfu_send_image
    self.dfu_transport.send_init_packet(data)
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 524, in send_init_packet
    self.__stream_data(data=init_packet)
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 642, in __stream_data
    self.dfu_adapter.write_data_point(list(to_transmit))
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 350, in write_data_point
    self.adapter.write_cmd(self.conn_handle, DFUAdapter.DP_UUID, data)
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/pc_ble_driver_py/ble_adapter.py", line 514, in write_cmd
    raise e
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/pc_ble_driver_py/ble_adapter.py", line 502, in write_cmd
    response = self.driver.ble_gattc_write(conn_handle, write_params)
  File "/home/beamer/tbconnect-beamer-debug-tools/.venv/lib/python3.7/site-packages/pc_ble_driver_py/ble_driver.py", line 107, in wrapper
    error_code=err_code,
pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12292
terminate called without an active exception
/tmp/nix-shell-27261-0/rc: line 1: 27306 Aborted                 (core dumped) nrfutil dfu ble --package /home/beamer/tbplatform.zip --conn-ic-id NRF51 --jlink_snr 680624486 --address C8:2D:57:C3:81:65

When rolling back to Python 2.7 and therefore using nrfutil V5.2.0 it works after I reprogram the Flash connectivity firmware to the BLE USB dongle using the additional command line switch -f. (Without reprogramming the Flash connectivity firmware the old nrfutil also fails with: pc_ble_driver_py.exceptions.NordicSemiException: Failed to open. Error code: 13)

Today I retried this with nrfutil V6.0.1 and got the same problem as with nrfutil V6.0.0.

I get this error/exception immediatelly after I started nrfutil, so I guess it isn't really communicating with the nRF52832 in our product yet. I have the impression, that the problem is in nrfutil itself or the interworkings of nrfutil and the BLE USB stick PCA10031.

If I interpret the error code 12292 correctly this is 0x3004 which is BLE_ERROR_INVALID_ADV_HANDLE.

At that point I'm quite stuck and don't know how to further debug into this.

Is there something wrong with my command line or do I have to do it in a different way? Is the PCA10031 V1.1.0 still supported by nrfutil?

General setup:

- NixOS 19.09 (Linux)

- Python 2.7.17 or Python 3.7.5

- JLink_Linux_V660d_x86_64

- nRF-Command-Line-Tools_10_5_0_Linux-amd64

Parents Reply Children
No Data
Related