Flash BLE Connectivity Firmware on the nRF52840 USB dongle using the nrfutil dfu usb-serial Utility

Hi,

We are currently trying to flash the BLE connectivity firmware on the nRF52840 USB dongle using the nrfutil dfu usb-serial utility.

OS: Ubuntu 18.04

Command: nrfutil dfu usb-serial -pkg ~/Downloads/connectivity_4.1.1_usb_with_s132_5.1.0_dfu_pkg.zip -p /dev/ttyACM0 -b 115200

Connectivity Firmware: connectivity_4.1.1_usb_with_s132_5.1.0_dfu_pkg.zip

Baud Rate: 115200

nrfutil version: 6.1.0

nrfjprog version: 10.15.1 external
JLinkARM.dll version: 7.58b

 

Before running the nrfutil command, we change the serial port permissions for the dongle from-

crw-rw---- 1 root dialout 166, 0 Nov 29 02:03 /dev/ttyACM0

to

crwxrwxrwx 1 root dialout 166, 0 Nov 29 02:03 /dev/ttyACM0

using the sudo chmod 777 /dev/ttyACM0 command.

We are seeing the following error logs when we run the above command-

mantisfw15@mantisfw15-NUC7i5DNKE:~/nRF_setup$ nrfutil dfu usb-serial -pkg ~/Downloads/connectivity_4.1.1_usb_with_s132_5.1.0_dfu_pkg.zip -p /dev/ttyACM0 -b 115200
[##############----------------------] 40% 00:00:48
Traceback (most recent call last):
File "/home/mantisfw15/.local/lib/python3.6/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyACM0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/mantisfw15/.local/lib/python3.6/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 199, in open
baudrate=self.baud_rate, rtscts=self.flow_control, timeout=self.DEFAULT_SERIAL_PORT_TIMEOUT)
File "/home/mantisfw15/.local/lib/python3.6/site-packages/serial/serialutil.py", line 244, in __init__
self.open()
File "/home/mantisfw15/.local/lib/python3.6/site-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/mantisfw15/.local/bin/nrfutil", line 8, in <module>
sys.exit(cli())
File "/home/mantisfw15/.local/lib/python3.6/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/home/mantisfw15/.local/lib/python3.6/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/mantisfw15/.local/lib/python3.6/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/mantisfw15/.local/lib/python3.6/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/mantisfw15/.local/lib/python3.6/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/mantisfw15/.local/lib/python3.6/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/mantisfw15/.local/lib/python3.6/site-packages/nordicsemi/__main__.py", line 1015, in usb_serial
timeout)
File "/home/mantisfw15/.local/lib/python3.6/site-packages/nordicsemi/__main__.py", line 970, in do_serial
dfu.dfu_send_images()
File "/home/mantisfw15/.local/lib/python3.6/site-packages/nordicsemi/dfu/dfu.py", line 127, in dfu_send_images
self._dfu_send_image(self.manifest.application)
File "/home/mantisfw15/.local/lib/python3.6/site-packages/nordicsemi/dfu/dfu.py", line 88, in _dfu_send_image
self.dfu_transport.open()
File "/home/mantisfw15/.local/lib/python3.6/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 203, in open
". Reason: {1}".format(self.com_port, e.strerror))
pc_ble_driver_py.exceptions.NordicSemiException: Serial port could not be opened on /dev/ttyACM0. Reason: could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'

We observe the PermissionError after 40% completion. On rechecking the COM port permissions, we notice the following-

crw-rw---- 1 root dialout 166, 0 Nov 29 05:14 /dev/ttyACM0

It looks like the Permissions are being reset during the flash. 

Any information on this error would be greatly appreciated.

Thanks and Regards,

Akshata

Related