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

[dfu] nrftil pc_ble_driver_py.exception.NordicSemiException

Hi. I'm dfu test for sdk13.


NRF52832 EVM board nrfutil version : nrfutil version 3.2.0


D:\nordic_nrf52832>**nrfutil.exe dfu ble -ic NRF52  -f -pkg dfu_test_app_hrm_s132.zip -p COM8**
No target selected. Default device name: DfuTarg is used.
Board already flashed with connectivity firmware.
  [------------------------------------]    0%
Traceback (most recent call last):
  File "nordicsemi\__main__.py", line 872, in <module>
  File "site-packages\click\core.py", line 722, in __call__
  File "site-packages\click\core.py", line 697, in main
  File "site-packages\click\core.py", line 1066, in invoke
  File "site-packages\click\core.py", line 1066, in invoke
  File "site-packages\click\core.py", line 895, in invoke
  File "site-packages\click\core.py", line 535, in invoke
  File "nordicsemi\__main__.py", line 746, in ble
  File "nordicsemi\dfu\dfu.py", line 122, in dfu_send_images
  File "nordicsemi\dfu\dfu.py", line 83, in _dfu_send_image
  File "nordicsemi\dfu\dfu_transport_ble.py", line 227, in open
  File "nordicsemi\dfu\dfu_transport_ble.py", line 87, in open
  File "site-packages\pc_ble_driver_py\ble_driver.py", line 126, in wrapper
**pc_ble_driver_py.exceptions.NordicSemiException: Failed to open. Error code: 3**
Failed to execute script __main__
  • Are you using two nRF52 DKs, i.e. one for the connectivity board connected to your pc and one that is the DFU target?

  • Thank you for help. I retry to test. pc connected to board only one. other devices are power off.

    D:\nordic_nrf52832>nrfutil.exe dfu ble -ic NRF52  -f -pkg dfu_test_app_hrm_s132.zip -p COM8 -n "DfuTest" -f
    Flashing connectivity firmware...
    Connectivity firmware flashed.
      [------------------------------------]    0%
    File "nordicsemi\dfu\dfu_transport_ble.py", line 230, in open File "nordicsemi\dfu\dfu_transport_ble.py", line 108, in connect
    pc_ble_driver_py.exceptions.NordicSemiException: Timeout. Target device not found.
    Failed to execute script __main__
    
  • Ok, that is expected if the DFU Target is powered off. Can you try to run the command promt as administrator and then try to perform a DFU with both devices powered on?

  • Hello!

    I'm having the same issue and couldn't find a thread on the forum that actually answers the question.

    I have a nRF52840 dongle connected to COM6 which is able to DFU my nrf52832 device without problem. 

    But when i try to perform  DFU from command line (running windows 10). I get the same error as in the original issue above. The command I use is:

    nrfutil dfu ble -ic NRF52 -pkg dfu_package.zip -p COM6 -a "E5:15:E0:5E:E9:82"


    I have also tried using the MAC address for the 832 when it is in DFU mode and I have also tried using -n "DeviceName" where the name I use is the same that is displayed in nRF Connect instead of the -a flag. 

    This is the error I get:

    Traceback (most recent call last):
      File "C:\Python27\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==5.2.0', 'console_scripts', 'nrfutil')()
      File "c:\python27\lib\site-packages\click\core.py", line 764, in __call__
        return self.main(*args, **kwargs)
      File "c:\python27\lib\site-packages\click\core.py", line 717, in main
        rv = self.invoke(ctx)
      File "c:\python27\lib\site-packages\click\core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python27\lib\site-packages\click\core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python27\lib\site-packages\click\core.py", line 956, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python27\lib\site-packages\click\core.py", line 555, in invoke
        return callback(*args, **kwargs)
      File "c:\python27\lib\site-packages\nordicsemi\__main__.py", line 1151, in ble
        dfu.dfu_send_images()
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 129, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 90, in _dfu_send_image
        self.dfu_transport.open()
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 453, in open
        self.dfu_adapter.open()
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 106, in open
        self.adapter.driver.open()
      File "c:\python27\lib\site-packages\wrapt\wrappers.py", line 562, in __call__
        args, kwargs)
      File "c:\python27\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 127, in wrapper
        raise NordicSemiException('Failed to {}. Error code: {}'.format(wrapped.__name__, err_code))
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to open. Error code: 3

  • Hi Berrag, 

    It should be possible to perform DFU with nrfutil and the nRF52840 Dongle, see https://devzone.nordicsemi.com/f/nordic-q-a/39630/windows-command-line-dfu-over-ble-with-pca10059

    Is the nRF52840 Dongle programmed with the connectivity firmware ? It should be listed as  USB: Nordic Semiconductor nRF52 Connectivity in nRF Connect for desktop: Bluetooth Low Energy application.

    Also which version of nrfutil  and which version of the SDK are you using? 

    Best regards 

    Bjørn

Related