Hello,
I've been trying to perform a dfu to a target Nordic device over Bluetooth using an nrf52840 dongle distributed by Laird, however whenever I attempt to run the command:
nrfutil dfu ble -ic NRF52 -pkg <package_name> -a <target_address>
I get a strange error. I will post the verbose output below, but first let me tell about the environment, packages and what firmware is on my device.
This is running on a Raspberry PI 4, with Buster 10.
I have the latest version of pc-ble-driver built on the device, pc-ble-driver-py version 0.14.2, and nrfutil version 6.1.0.
My nrf52840 dongle is flashed with connectivity_6.0.0_usb_with_s140_6.1.1.hex.
Here is the output from running the command:
Please select connectivity serial port: 0 : /dev/ttyACM1 - D67B7A98D69A Enter your choice: : 0 2020-10-08 09:18:03,198 Using connectivity board at serial port: /dev/ttyACM1 2020-10-08 09:18:03,207 Sending Application image. 2020-10-08 09:18:06,616 Successfully opened /dev/ttyACM1. Baud rate: 1000000. Flow control: none. Parity: none. 2020-10-08 09:18:06,617 evt> severity(20) message(Successfully opened /dev/ttyACM1. Baud rate: 1000000. Flow control: none. Parity: none.) 2020-10-08 09:18:06,617 RpcAppStatus.resetPerformed: Target Reset performed 2020-10-08 09:18:06,618 evt> status code(RpcAppStatus.resetPerformed) message(Target Reset performed) 2020-10-08 09:18:07,818 RpcAppStatus.connectionActive: Connection active 2020-10-08 09:18:07,818 evt> status code(RpcAppStatus.connectionActive) message(Connection active) 2020-10-08 09:18:07,823 BLE: Scanning for None 2020-10-08 09:18:08,243 RpcAppStatus.ioResourcesUnavailable: serial port read failed on port /dev/ttyACM1. Error: End of file [2] 2020-10-08 09:18:08,243 evt> status code(RpcAppStatus.ioResourcesUnavailable) message(serial port read failed on port /dev/ttyACM1. Error: End of file [2]) 2020-10-08 09:18:09,324 Failed to receive response for command 2020-10-08 09:18:09,324 evt> severity(30) message(Failed to receive response for command) Traceback (most recent call last): 2020-10-08 09:18:09,325 RpcAppStatus.pktSendError: Error sending packet to target. Code: 0x8016 File "/usr/local/bin/nrfutil", line 11, in <module> 2020-10-08 09:18:09,325 evt> status code(RpcAppStatus.pktSendError) message(Error sending packet to target. Code: 0x8016) load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')() File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/nordicsemi/__main__.py", line 1207, in ble dfu.dfu_send_images() File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/nordicsemi/dfu/dfu.py", line 127, in dfu_send_images self._dfu_send_image(self.manifest.application) File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/nordicsemi/dfu/dfu.py", line 88, in _dfu_send_image self.dfu_transport.open() File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/nordicsemi/dfu/dfu_transport_ble.py", line 476, in open target_device_addr = self.target_device_addr) File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/nordicsemi/dfu/dfu_transport_ble.py", line 152, in connect self.adapter.driver.ble_gap_scan_start() File "/home/pi/.local/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_gap_scan_start. Error code: NRF_ERROR_SD_RPC_SEND
Update:
Some information I forgot to mention was that the target device is using s140_nrf52_6.1.1_softdevice.hex. Now I've since tried different hex files. Before I knew what was really on the target device I tried connectivity_4.1.2_usb_with_s132_5.1.0.hex because it was precompiled with pc-ble-driver-py. The behavior here was that it would perform the update, but fail at 62%. The output was this:
Please select connectivity serial port:
0 : /dev/ttyACM0 - D67B7A98D69A
Enter your choice: : 0
[######################--------------] 62% 00:00:30
Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 11, in <module>
load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/nordicsemi/__main__.py", line 1205, in ble
dfu.dfu_send_images()
File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/nordicsemi/dfu/dfu.py", line 127, in dfu_send_images
self._dfu_send_image(self.manifest.application)
File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/nordicsemi/dfu/dfu.py", line 100, in _dfu_send_image
self.dfu_transport.send_firmware(data)
File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/nordicsemi/dfu/dfu_transport_ble.py", line 572, in send_firmware
response['crc'] = self.__stream_data(data=data, crc=response['crc'], offset=i)
File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/nordicsemi/dfu/dfu_transport_ble.py", line 642, in __stream_data
self.dfu_adapter.write_data_point(list(to_transmit))
File "/usr/local/lib/python3.7/dist-packages/nrfutil-6.1.0-py3.7.egg/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/pi/.local/lib/python3.7/site-packages/pc_ble_driver_py/ble_adapter.py", line 568, in write_cmd
raise e
File "/home/pi/.local/lib/python3.7/site-packages/pc_ble_driver_py/ble_adapter.py", line 554, in write_cmd
response = self.driver.ble_gattc_write(conn_handle, write_params)
File "/home/pi/.local/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: NRF_ERROR_SD_RPC_NO_RESPONSE
After figuring out what was on the target device I've tried the following hex files:
connectivity_4.1.2_usb_with_s140_6.1.1.hex
connectivity_6.1.0_usb_with_s140_6.1.1.hex
connectivity_6.1.1_usb_with_s140_6.1.1.hex
But all of these have exhibited the exact same behavior as in the original post.