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

DFU fails with nrfutil dfu ble

Hi,

I'm trying to perform a DFU firmware update via command line using nrfutil dfu ble. The same update using nRF connect works fine. The dongle is flashed with connectivity_1.2.0_115k2_with_s132_3.0. Using the option verbose and some debug I can see that it's able to connect to the target (buttonless DFU) and transition the device into DFU, reconnect to the target (with address + 1) and start the procedure. It writes few characteristics:

handle, uuid, data

18 0x01 [2, 0, 0]

18 0x01 [6, 1]

18 0x01 [4]

18 0x01 [6, 2]

18 0x01 [4]

18 0x01 [1, 2, 0, 16, 0, 0]

but it stops in a write request with a "TypeError: 'NoneType' object has no attribute 'getitem'g" error. It seems that the function doesn't return with a result, maybe because it's interrupted by something(e.g. timeout).

I'm using Linux but even with windows and nrfutil.exe I stumble in the same identical error.

Traceback (most recent call last):

  File "/usr/local/bin/nrfutil", line 11, in <module>
    sys.exit(cli())

  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)

  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)

  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/nordicsemi/__main__.py", line 814, in ble
    dfu.dfu_send_images()

  File "/usr/local/lib/python2.7/dist-packages/nordicsemi/dfu/dfu.py", line 122, in dfu_send_images
    self._dfu_send_image(self.manifest.application)

  File "/usr/local/lib/python2.7/dist-packages/nordicsemi/dfu/dfu.py", line 95, in _dfu_send_image
    self.dfu_transport.send_firmware(data)

  File "/usr/local/lib/python2.7/dist-packages/nordicsemi/dfu/dfu_transport_ble.py", line 553, in send_firmware
    self.__create_data(len(data))

  File "/usr/local/lib/python2.7/dist-packages/nordicsemi/dfu/dfu_transport_ble.py", line 572, in __create_data
    self.__create_object(0x02, size)

  File "/usr/local/lib/python2.7/dist-packages/nordicsemi/dfu/dfu_transport_ble.py", line 576, in __create_object
    + map(ord, struct.pack('<L', size)))

  File "/usr/local/lib/python2.7/dist-packages/nordicsemi/dfu/dfu_transport_ble.py", line 333, in write_control_point
    self.adapter.write_req(self.conn_handle, DFUAdapter.CP_UUID, data)

  File "/usr/local/lib/python2.7/dist-packages/pc_ble_driver_py/ble_driver.py", line 124, in wrapper
    err_code = wrapped(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/pc_ble_driver_py/ble_adapter.py", line 309, in write_req
    return result['status']

TypeError: 'NoneType' object has no attribute '__getitem__'

Thanks Fausto

  • Hi,

    Please provide more information on :

    • Which SDK and softdevice your bootloader using ?

    • Which nrfutil version you are using ?

  • Thanks for the reply!

    I'm using:

    • SDK 14.2.0
    • softdevice s132_nrf52_5.0.0_softdevice.hex
    • nrfutil 3.4
  • @Fausto: You mentioned "The dongle is flashed with connectivity_1.2.0_115k2_with_s132_3.0". Could you tell a little bit more about the dongle ? was it a nRF51 chip or nRF52 chip ?

    Have you tried to test DFU with just softdevice + bootloader ( no buttonless) ?

    I just tested here with the same setup but didn't see any problem.

  • Hi, 

    I also face a problem when trying to perform a DFU firmware update via command line using nrfutil dfu ble. 

    I'm using windows 10 and nrfutil.exe version 3.5.0

    nrfutil dfu ble -ic NRF52 -pkg app_dfu_package.zip -p COM7 -n "DfuBoot_2018_07_18"
      [------------------------------------]    0%
    Traceback (most recent call last):
      File "nordicsemi\__main__.py", line 983, 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 834, in ble
      File "nordicsemi\dfu\dfu.py", line 129, in dfu_send_images
      File "nordicsemi\dfu\dfu.py", line 90, in _dfu_send_image
      File "nordicsemi\dfu\dfu_transport_ble.py", line 450, in open
      File "nordicsemi\dfu\dfu_transport_ble.py", line 106, 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: 13
    Failed to execute script __main__

    I am using for the PCA10040 EVB as connectivity device, the SOFTDEVICE ans SDK on my target device
    are the same as was used by Fausto above.

  • Hi, 

    Please open a new case. Please check if you can communicate with the board via COM7 (test using uart example in the SDK), also make sure you flashed the connectivity firmware to be used with nrfutil. 

Related