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

nrfutil v6.1.0 dfu ble fail with connectivity firmware v4.1.2

Hi, devzone

I tested nrfutil6.1.0 dfu ble feature and pca10040 as host board to upgrade another board pca10040, successful!

when test nrf connect desktop v3.6.0 and pca10059 as host board to upgrade another board pca10040, successful!

But, when test nrfutil6.1.0 and pca10059 as host board to upgrade another board pca10040 , result fail(BLE Connection failed due to 0x3e)

Env:

PC:WIN10, python3.8, installed nrfutil 6.1.0 and pc-ble-driver-py 0.15.0

Hardware: PCA10059 and PCA10040

Connectivity Firmware: connectivity_4.1.2_usb_with_s132_3.1.0_dfu_pkg.zip

pca10040 dfu package: SDK15.3\..ble_app_buttonless_dfu_without_bonds_s132.zip

bootloader: SDK15.3\..open_bootloader\pca10059_usb_debug

First, Test with nRF_Connect_desktop v3.6.0

erase pca10059 and programe open usb bootloader. Result is OK, dfu successful and stable.

nRF Connect Desktop 3.6.0 log:

14:13:26.926	Device setup completed
14:13:26.932	Connectivity firmware version: ble-connectivity 4.1.2+Jul-14-2020-05-48-48. SoftDevice API version: 5. Baud rate: 1000000.
14:13:26.973	Opening adapter connected to COM3
14:13:27.944	Successfully opened COM3. Baud rate: 1000000. Flow control: none. Parity: none.
14:13:27.946	Reset performed on adapter COM3
14:13:29.032	Adapter connected to COM3 opened

Then, Test with nrfutil v6.1.0 :

1>erase pca10059 and program usb bootloader

2>change nrfutil python code where https://github.com/NordicSemiconductor/pc-nrfutil/blame/v6.1/nordicsemi/__main__.py#L1177 to select connectivity  usb firmware pkg v4.1.2

    python driver that comes with nrfutil_v6.1.0 is pc-ble-driver-py(v0.15.0), inside folder has hex/sd_api_v3 and sd_api_v5, all firmware file is version 4.1.2, not 4.1.1.

    I also tested tconnectivity firmware v4.1.1, Fail, there are a lot of  other error that I forget to record , and, this should not be the point of this problem

    PS: I had been report a issue on nrfutil github here https://github.com/NordicSemiconductor/pc-nrfutil/issues/341

3>run cmd: nrfutil dfu ble <...> -f 

PS C:\Users\Administrator> nrfutil dfu ble -ic NRF52 -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -n Nordic_Buttonless -f
Please select connectivity serial port:
        0 : COM4 - C13C3EDEBED8
Enter your choice: : 0
Flashing connectivity firmware...
Connectivity firmware flashed.
PS C:\Users\Administrator> nrfutil dfu ble -ic NRF52 -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -n Nordic_Buttonless -p COM3

Traceback (most recent call last):
  File "C:\Python38\Scripts\nrfutil-script.py", line 11, in <module>
    load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
  File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\python38\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\python38\lib\site-packages\nordicsemi\__main__.py", line 1197, in ble
    dfu.dfu_send_images()
  File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
    self._dfu_send_image(self.manifest.application)
  File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 88, in _dfu_send_image
    self.dfu_transport.open()
  File "c:\python38\lib\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 "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 153, in connect
    self.verify_stable_connection()
  File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 257, in verify_stable_connection
    raise Exception("Failure - Connection failed due to 0x3e")
Exception: Failure - Connection failed due to 0x3e

Similar problem in thread nrfutil dfu random failures

Hope someone can figure out,and let me know,any point will be appreciated

Parents
  • Hello,

    Thank you for reporting. I see that nrfutil is missing the connectivity FW for the dongle. I will report this to our developers, and also make them aware of the github issue.

    I see that I answered in the other thread that you link to as well, but nothing has happened from our side as far as I can tell. I will notify them about this as well.

    There are some ways to work around this bug.

    The simplest one is to open the folder:

    C:\Users\<User>\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pc_ble_driver_py\hex\sd_api_v5 (or where you have installed pc_ble_driver_py, probably through Python pip).

    Then copy the file connectivity_4.1.2_usb_with_s132_5.1.0_dfu_pkg.zip, and rename your copy:

    connectivity_4.1.1_usb_with_s132_5.1.0_dfu_pkg.zip

    After that you should be able to use the -f command in nrfutil towards the dongle. Please note that you may need to do it two times, as some times the nRF52 Dongle changes COM port when a new FW is received.

    Alternatively, you can flash the file connectivity_4.1.2_usb_with_s132_5.1.0.hex from the same folder to the nRF52 Dongle using the nRF Connect for Desktop -> Programmer app.

    After that you can perform the nrfutil command without the -f flag. I tested this now, and it works, as long as the softdevice version is the same as nrfutil expects it to be.

    Again, thank you for reporting. I will take it forward to our R&D team.

    Best regards,

    Edvin

  • Hi,

    Thanks for your reply

    I tested it today. as you mentioned above, I use nrfjprog flash connectivity_4.1.2 firmware, all other test environment remain the same.

    The result is barely succeeded, many errors be reported in the process. then, I tried again several times , all of result are like first one, or wrose!

    btw guys, ble connect failure originally mentioned in this post may be due to target board is run in "Nordic_Buttonless" instead of "DfuTarg"

    post some useful logs and attachment

    PS C:\Users\Administrator> nrfjprog -f NRF52 --program "C:\Python38\Lib\site-packages\pc_ble_driver_py\hex\sd_api_v5\connectivity_4.1.2_usb_with_s132_5.1.0.hex"  --chiperase
    Parsing image file.
    Erasing user available code and UICR flash areas.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    PS C:\Users\Administrator> nrfjprog -f NRF52 --verify "C:\Python38\Lib\site-packages\pc_ble_driver_py\hex\sd_api_v5\connectivity_4.1.2_usb_with_s132_5.1.0.hex"
    Parsing image file.
    Verifying programming.
    Verified OK.
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52 -n "Nordic_Buttonless" -p COM3
    ...
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
      [########----------------------------]   23%  00:00:53
    ...
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12290
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
      [###############################-----]   87%  00:00:02
    ...
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12290
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
    ...
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 222, in att_mtu_exchange
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: MTU exchange request failed. Common causes are: missing att_mtu setting in ble_cfg_set, different config tags used in ble_cfg_set and connect.
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
      [##################################--]   95%  00:00:00
    
        File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12290
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
    ...
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 222, in att_mtu_exchange
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: MTU exchange request failed. Common causes are: missing att_mtu setting in ble_cfg_set, different config tags used in ble_cfg_set and connect.
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
    ...
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 489, in write_req
        return result["status"]
    TypeError: 'NoneType' object is not subscriptable
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
      [####################################]  100%
    Device programmed.
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52 -n "Nordic_Buttonless" -p COM3
    
    Traceback (most recent call last):
      File "C:\Python38\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38\lib\site-packages\click\core.py", line 782, in main
        rv = self.invoke(ctx)
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "c:\python38\lib\site-packages\nordicsemi\__main__.py", line 1204, in ble
        dfu.dfu_send_images()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 100, in _dfu_send_image
        self.dfu_transport.send_firmware(data)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 572, in send_firmware
        response['crc'] = self.__stream_data(data=data, crc=response['crc'], offset=i)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 642, in __stream_data
        self.dfu_adapter.write_data_point(list(to_transmit))
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 568, in write_cmd
        raise e
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\wrapt\wrappers.py", line 605, in __call__
        return self._self_wrapper(self.__wrapped__, self._self_instance,
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12290
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
      [#####-------------------------------]   15%  00:01:26
    Traceback (most recent call last):
      File "C:\Python38\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38\lib\site-packages\click\core.py", line 782, in main
        rv = self.invoke(ctx)
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "c:\python38\lib\site-packages\nordicsemi\__main__.py", line 1204, in ble
        dfu.dfu_send_images()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 100, in _dfu_send_image
        self.dfu_transport.send_firmware(data)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 572, in send_firmware
        response['crc'] = self.__stream_data(data=data, crc=response['crc'], offset=i)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 642, in __stream_data
        self.dfu_adapter.write_data_point(list(to_transmit))
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 568, in write_cmd
        raise e
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\wrapt\wrappers.py", line 605, in __call__
        return self._self_wrapper(self.__wrapped__, self._self_instance,
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12290
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
      [#########################-----------]   71%  00:00:06
    Traceback (most recent call last):
      File "C:\Python38\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38\lib\site-packages\click\core.py", line 782, in main
        rv = self.invoke(ctx)
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "c:\python38\lib\site-packages\nordicsemi\__main__.py", line 1204, in ble
        dfu.dfu_send_images()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 100, in _dfu_send_image
        self.dfu_transport.send_firmware(data)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 572, in send_firmware
        response['crc'] = self.__stream_data(data=data, crc=response['crc'], offset=i)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 642, in __stream_data
        self.dfu_adapter.write_data_point(list(to_transmit))
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 568, in write_cmd
        raise e
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\wrapt\wrappers.py", line 605, in __call__
        return self._self_wrapper(self.__wrapped__, self._self_instance,
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12290
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
    
    Traceback (most recent call last):
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 220, in att_mtu_exchange
        self.driver.ble_gattc_exchange_mtu_req(conn_handle, mtu)
      File "c:\python38\lib\site-packages\wrapt\wrappers.py", line 605, in __call__
        return self._self_wrapper(self.__wrapped__, self._self_instance,
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_exchange_mtu_req. Error code: NRF_ERROR_INVALID_PARAM
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "C:\Python38\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38\lib\site-packages\click\core.py", line 782, in main
        rv = self.invoke(ctx)
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "c:\python38\lib\site-packages\nordicsemi\__main__.py", line 1204, in ble
        dfu.dfu_send_images()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 88, in _dfu_send_image
        self.dfu_transport.open()
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 173, in connect
        self.att_mtu = self.adapter.att_mtu_exchange(self.conn_handle, DFUAdapter.LOCAL_ATT_MTU)
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 222, in att_mtu_exchange
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: MTU exchange request failed. Common causes are: missing att_mtu setting in ble_cfg_set, different config tags used in ble_cfg_set and connect.
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
    
    Traceback (most recent call last):
      File "C:\Python38\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38\lib\site-packages\click\core.py", line 782, in main
        rv = self.invoke(ctx)
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "c:\python38\lib\site-packages\nordicsemi\__main__.py", line 1204, in ble
        dfu.dfu_send_images()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 100, in _dfu_send_image
        self.dfu_transport.send_firmware(data)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 565, in send_firmware
        try_to_recover()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 551, in try_to_recover
        response['crc']     = self.__stream_data(data   = to_send,
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 642, in __stream_data
        self.dfu_adapter.write_data_point(list(to_transmit))
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 568, in write_cmd
        raise e
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\wrapt\wrappers.py", line 605, in __call__
        return self._self_wrapper(self.__wrapped__, self._self_instance,
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12290
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
      [############################--------]   79%  00:00:02
    Traceback (most recent call last):
      File "C:\Python38\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38\lib\site-packages\click\core.py", line 782, in main
        rv = self.invoke(ctx)
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "c:\python38\lib\site-packages\nordicsemi\__main__.py", line 1204, in ble
        dfu.dfu_send_images()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 100, in _dfu_send_image
        self.dfu_transport.send_firmware(data)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 572, in send_firmware
        response['crc'] = self.__stream_data(data=data, crc=response['crc'], offset=i)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 642, in __stream_data
        self.dfu_adapter.write_data_point(list(to_transmit))
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 568, in write_cmd
        raise e
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\wrapt\wrappers.py", line 605, in __call__
        return self._self_wrapper(self.__wrapped__, self._self_instance,
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12290
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
      [###############################-----]   87%  00:00:01
    Traceback (most recent call last):
      File "C:\Python38\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38\lib\site-packages\click\core.py", line 782, in main
        rv = self.invoke(ctx)
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "c:\python38\lib\site-packages\nordicsemi\__main__.py", line 1204, in ble
        dfu.dfu_send_images()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 100, in _dfu_send_image
        self.dfu_transport.send_firmware(data)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 572, in send_firmware
        response['crc'] = self.__stream_data(data=data, crc=response['crc'], offset=i)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 642, in __stream_data
        self.dfu_adapter.write_data_point(list(to_transmit))
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 568, in write_cmd
        raise e
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\wrapt\wrappers.py", line 605, in __call__
        return self._self_wrapper(self.__wrapped__, self._self_instance,
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12290
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
    
    Traceback (most recent call last):
      File "C:\Python38\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38\lib\site-packages\click\core.py", line 782, in main
        rv = self.invoke(ctx)
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "c:\python38\lib\site-packages\nordicsemi\__main__.py", line 1204, in ble
        dfu.dfu_send_images()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 100, in _dfu_send_image
        self.dfu_transport.send_firmware(data)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 564, in send_firmware
        response = self.__select_data()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 612, in __select_data
        return self.__select_object(0x02)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 616, in __select_object
        self.dfu_adapter.write_control_point([DfuTransportBle.OP_CODE['ReadObject'], object_type])
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\wrapt\wrappers.py", line 605, in __call__
        return self._self_wrapper(self.__wrapped__, self._self_instance,
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 101, in wrapper
        err_code = wrapped(*args, **kwargs)
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 489, in write_req
        return result["status"]
    TypeError: 'NoneType' object is not subscriptable
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
      [##################################--]   95%  00:00:00
    Traceback (most recent call last):
      File "C:\Python38\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.1.0', 'console_scripts', 'nrfutil')()
      File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38\lib\site-packages\click\core.py", line 782, in main
        rv = self.invoke(ctx)
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "c:\python38\lib\site-packages\nordicsemi\__main__.py", line 1204, in ble
        dfu.dfu_send_images()
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu.py", line 100, in _dfu_send_image
        self.dfu_transport.send_firmware(data)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 572, in send_firmware
        response['crc'] = self.__stream_data(data=data, crc=response['crc'], offset=i)
      File "c:\python38\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 642, in __stream_data
        self.dfu_adapter.write_data_point(list(to_transmit))
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 568, in write_cmd
        raise e
      File "c:\python38\lib\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 "c:\python38\lib\site-packages\wrapt\wrappers.py", line 605, in __call__
        return self._self_wrapper(self.__wrapped__, self._self_instance,
      File "c:\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: 12290
    PS C:\Users\Administrator> nrfutil dfu ble -pkg "E:\nrfutil_DFU_test\ble_app_buttonless_dfu_without_bonds_s132.zip" -ic NRF52  -p COM3
    No target selected. Default device name: DfuTarg is used.
      [####################################]  100%
    Device programmed.
    PS C:\Users\Administrator>

    There must be something wrong, maybe compatibility as issue can't reproduce in your side, i tried my best to solve it(tried to set win10 system time resolution as 1ms, etc), but all in vain.

    Please let me know if there is research progress on this issue, I am glad to test the fix

  • I am a bit confused about your setup. Are you using the nRF52 Dongle as your connecitivity device? The reason I ask is because the dongle doesn't have a programmer, so you can't run this command:

    PS C:\Users\Administrator> nrfjprog -f NRF52 --program "C:\Python38\Lib\site-packages\pc_ble_driver_py\hex\sd_api_v5\connectivity_4.1.2_usb_with_s132_5.1.0.hex"  --chiperase

    If so, then the dongle is not the device that will be programmed. What device is your COM3? What is it programmed with, and how did you program it? 

    Unless you have soldered on a programming header, and used an external programmer on your nRF52 Dongle, then the dongle is not programmed with "C:\Python38\Lib\site-packages\pc_ble_driver_py\hex\sd_api_v5\connectivity_4.1.2_usb_with_s132_5.1.0.hex".

    Best regards,

    Edvin

  • Sorry i didn't make it clear, the log I uploaded was generated by manually inputting instructions, not a batch. I program it via a external jlink swd first, then, plug in dongle which seen as COM3.

    No need to doubt operation, as I have repeatedly confirmed that it is okay many times.

  • So did you remove the pre-flashed bootloader from the Dongle?

    If so, please read the section "Adapting firmware to set REGOUT0 properly" and from the nRF52840 dongle programming tutorial.

    This is usually done in the pre-flashed bootloader. Perhaps you can try to add the bootloader back in, to see if that is the issue you are encountering. 

    I tested (without an external programmer, but programming via nRF Connect for Desktop -> Programmer), and I didn't see the issues that you are seeing. Perhaps they are caused by resets due to incorrect voltage supply. 

    Best regards,

    Edvin

  • Unfortunately, it did not resolve.

    step1, via jlink erase dongle

    step2, via jlink program dongle with bootloader

    step3, PC plug in dongle, Enumerate into nRF52 SDFU USB(COM4)

    step4, open nRF Connect for Desktop->Programmer, select COM3, and upload connectivity_4.1.2_usb_with_s132_5.1.0.hex. hit "Write"

    COM port become nRF Connect USB CDC ACM (COM3)

    It seems that the programmer operation is ok , but still FAIL when use nrfutil dfu ble

  • You did use the bootloader from the nrf52840 dongle programming tutorial? If not, try to use it (attached here: 0045.pca10059_bootloader.zip)

    If you can confirm that this is the bootloader you programmed on the dongle, looking into your log:

    Is the dongle and the target device properly powered? And are they well within range?

    And do you restart the DFU process manually after the error code 12290? And is there something missing in the log at the line saying "..."? Or did nrfutil print this?

    BR,

    Edvin

Reply
  • You did use the bootloader from the nrf52840 dongle programming tutorial? If not, try to use it (attached here: 0045.pca10059_bootloader.zip)

    If you can confirm that this is the bootloader you programmed on the dongle, looking into your log:

    Is the dongle and the target device properly powered? And are they well within range?

    And do you restart the DFU process manually after the error code 12290? And is there something missing in the log at the line saying "..."? Or did nrfutil print this?

    BR,

    Edvin

Children
No Data
Related