cannot convert 'NoneType' object to bytearray while flashing with nrfutil

Hi, devzone,

I'm currently trying to flash the nrf52840 dongle from a custom IMX6-Ull board where it is attached and I'm also able to communicate and run the application flashed in the dongle. 

I want to integrate the nrfutil tool into the board for firmware upgrade purposes and get the following error while running the dfu usb-serial command.

> nrfutil dfu usb-serial -pkg zephyr.zip -p /dev/ttymxc6

This is the error I'm getting as a response TypeError: cannot convert 'NoneType' object to byte array

  [------------------------------------]    0%
Traceback (most recent call last):
  File "/usr/bin/nrfutil", line 33, in <module>
    sys.exit(load_entry_point('nrfutil==6.1.7', 'console_scripts', 'nrfutil')())
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/nordicsemi/__main__.py", line 1032, in usb_serial
    do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, False,
  File "/usr/lib/python3.8/site-packages/nordicsemi/__main__.py", line 988, in do_serial
    dfu.dfu_send_images()
  File "/usr/lib/python3.8/site-packages/nordicsemi/dfu/dfu.py", line 127, in dfu_send_images
    self._dfu_send_image(self.manifest.application)
  File "/usr/lib/python3.8/site-packages/nordicsemi/dfu/dfu.py", line 88, in _dfu_send_image
    self.dfu_transport.open()
  File "/usr/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 217, in open
    self.__get_mtu()
  File "/usr/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 366, in __get_mtu
    self.mtu = struct.unpack('<H', bytearray(response))[0]
TypeError: cannot convert 'NoneType' object to bytearray

While trying through the USB interface(ttyACM0) from the PC I'm able to flash the firmware successfully

Any suggestions? 

Thank you in advance

Related