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

nrfutil dfu ble timeout

I'm attempting to use nrfutil with a nRF52 DK to perform dfu over BLE. The command I'm using and the result I get is:

% nrfjprog --eraseall                                       
Erasing user available code and UICR flash areas.
Applying system reset.
% nrfutil dfu ble -ic NRF52 -pkg app_dfu_package_1_1.0.0.zip
No target selected. Default device name: DfuTarg is used.
Please select connectivity serial port:
	0 : /dev/tty.usbmodem0006821181671 - 000682118167
Enter your choice: : 0

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/nrfutil", line 11, in <module>
    load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/__main__.py", line 1197, in ble
    dfu.dfu_send_images()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu.py", line 115, in dfu_send_images
    self._dfu_send_image(self.manifest.softdevice_bootloader)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu.py", line 88, in _dfu_send_image
    self.dfu_transport.open()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 473, in open
    self.dfu_adapter.open()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 103, in open
    self.adapter.driver.open()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pc_ble_driver_py/ble_driver.py", line 103, in wrapper
    raise NordicSemiException(
pc_ble_driver_py.exceptions.NordicSemiException: Failed to open. Error code: NRF_ERROR_TIMEOUT

This is with the latest nrfutil 6.1.0, on windows or mac, the result is the same.

Parents
  • Hi, 

    Try to add -f into the command to flash the connectivity FW as

    nrfutil dfu ble -ic NRF52 -f -pkg app_dfu_package_1_1.0.0.zip

    -Amanda H.

  • Ok it would be good if the error suggested that.

    Now I have another error:

    % nrfutil dfu ble -ic NRF52 -f -pkg app_dfu_package_1_1.0.0.zip
    No target selected. Default device name: DfuTarg is used.
    Please select connectivity serial port:
    	0 : /dev/tty.usbmodem0006821181671 - 000682118167
    Enter your choice: : 0
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pc_ble_driver_py/ble_driver.py", line 2851, in __init__
        snr = [d.serial_number for d in serial_ports if d.port == serial_port][0]
    IndexError: list index out of range
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.8/bin/nrfutil", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 782, in main
        rv = self.invoke(ctx)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/__main__.py", line 1159, in ble
        flasher = Flasher(serial_port=port, snr=jlink_snr)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pc_ble_driver_py/ble_driver.py", line 2853, in __init__
        raise NordicSemiException("Board not found: {}".format(serial_port or snr))
    pc_ble_driver_py.exceptions.NordicSemiException: Board not found: /dev/tty.usbmodem0006821181671

    edit: this only occurs on macos, it worked on windows.

  • Hi,

    Can you try to use the full path to the COM port:

    nrfutil dfu ble -ic NRF52 -pkg app_dfu_package_1_1.0.0.zip -f -p /dev/tty.usbmodem0006821181671

    It worked for someone else having some problems with Mac and nrfutil. If it still cannot find the board, you might try to reboot the Mac and do it again. 

    -Amanda H.

Reply Children
  • No, this results in the same error even after reboot

  • After disabling, unplugging, reconnecting and retrying I get the same error. I think this is probably a bug in nrfutil.

  • Please try the following command and provide the log if it cannot work. 

    nrfutil dfu ble -ic NRF52 -pkg app_dfu_package_1_1.0.0.zip -f -snr 000682118167

    -Amanda H.

  • This gets further, it connects to the device, but encounters another error.

    nrfutil dfu ble -ic NRF52 -pkg package.zip  -f -snr 000682118167 --name "AirTurn D96D"
    Board already flashed with connectivity firmware.
    
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.8/bin/nrfutil", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 782, in main
        rv = self.invoke(ctx)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/__main__.py", line 1197, in ble
        dfu.dfu_send_images()
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu.py", line 115, in dfu_send_images
        self._dfu_send_image(self.manifest.softdevice_bootloader)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu.py", line 88, in _dfu_send_image
        self.dfu_transport.open()
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 477, in open
        self.__set_prn()
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 583, in __set_prn
        self.dfu_adapter.write_control_point([DfuTransportBle.OP_CODE['SetPRN']] + list(struct.pack('<H', self.prn)))
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 347, in write_control_point
        self.adapter.write_req(self.conn_handle, DFUAdapter.CP_UUID, data)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pc_ble_driver_py/ble_driver.py", line 101, in wrapper
        err_code = wrapped(*args, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pc_ble_driver_py/ble_adapter.py", line 489, in write_req
        return result["status"]
    TypeError: 'NoneType' object is not subscriptable

Related