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

DFU over BLE using nRF52840-Dongle fails with error code 8

Hello!

I'm trying to perform DFU over BLE using a nRF52840-Dongle (PCA10059) devkit. I'm getting the following error:

nrfutil dfu ble -ic NRF52 -pkg '/Users/user/Downloads/package.zip' -p /dev/tty.usbmodem -a 12:34:56:78:99:00

Traceback (most recent call last):

  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/nrfutil", line 33, in <module>

    sys.exit(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 127, in dfu_send_images

    self._dfu_send_image(self.manifest.application)

  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 474, in open

    self.target_device_name, self.target_device_addr = self.dfu_adapter.connect(

  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 153, in connect

    self.verify_stable_connection()

  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 262, in verify_stable_connection

    self.adapter.driver.ble_gap_scan_stop()

  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 ble_gap_scan_stop. Error code: NRF_ERROR_INVALID_STATE

I've tried to add '-cd 5' and '-f' options, but error still happens. 

I've seen a similar question, but there is no solution.

Parents Reply Children
  • Ah, I see. I read your question too quickly. I would not have expected the "Failed to ble_gap_scan_stop. Error code: NRF_ERROR_INVALID_STATE" error in this case.

    Which version of nrfutil do you use? And which connectivity firmware have you flashed on the dongle? Does it work if you first use the BLE app via nRF Connect with the dongle, and program the connectivity firmware from there (ensuring that the connectivity firmware version matches the pc-ble-driver)?

  • Nrfutil 6.1.0, nRFconnect 3.5.0, bluetooth low energy 2.4.0.

    It works correctly with nRF connect. 

    I tried firmware that suggests bluetooth low energy app, I tried to add -f option to nrfutil dfu ble command, no changes.

    One more detail: I have a custom application with pc-ble-driver 4.1.2. I'm using it to scan devices, select one and run nrfutil. Before running nrfutil I deinitialize dongle with the following commands:

    sd_rpc_conn_reset(adapter, SOFT_RESET);
    sd_rpc_close(adapter);

  • Hi,

    I see. Your nrfutil command is correct and should work, and versions also seem good. Do you see this error if you power-cycle the dongle before you do this, so that it is in a known state (as you have used it before)?

  • Hi,

    We just saw another issue where there seems to be problems combining pc-ble-driver 4.1.2 and 4.1.1. Can you try the attached nrfutil executable (8688.nrfutil_test.zip), which is includes pc-ble-driver 4.1.2?

  • nrfutil_test.exe dfu ble -ic NRF52 -pkg dfu-application-package.zip -p COM4 -a FF:AA:EE:99:66:AA
    
    Traceback (most recent call last):
      File "nordicsemi\__main__.py", line 1537, in <module>
      File "click\core.py", line 829, in __call__
      File "click\core.py", line 782, in main
      File "click\core.py", line 1259, in invoke
      File "click\core.py", line 1259, in invoke
      File "click\core.py", line 1066, in invoke
      File "click\core.py", line 610, in invoke
      File "nordicsemi\__main__.py", line 1197, in ble
      File "nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
      File "nordicsemi\dfu\dfu.py", line 88, in _dfu_send_image
      File "nordicsemi\dfu\dfu_transport_ble.py", line 474, in open
      File "nordicsemi\dfu\dfu_transport_ble.py", line 153, in connect
      File "nordicsemi\dfu\dfu_transport_ble.py", line 262, in verify_stable_connection
      File "wrapt\wrappers.py", line 605, in __call__
      File "pc_ble_driver_py\ble_driver.py", line 103, in wrapper
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gap_scan_stop. Error code: NRF_ERROR_INVALID_STATE
    [8932] Failed to execute script __main__

Related