Upload failed with nRF52840 on Ubuntu Linux 18.04 [FIX]

Compile OK but upload failed. Adafruit nRF52840 works fine on the same computer. The problem is the Linux Modem Manager opens /dev/ttyACMx ports after a port reset which prevents the DFU loader from opening the port. One solution is to “sudo apt remove modemmanager”. Or add a udev rule so modem manager ignores SparkFun boards. This is why the Adafruit board works because I added /etc/udev/rules.d/99-adafruit-boards.txt a long time ago.

I created /etc/udev/rules.d/99-sparkfun-udev.rules which contains the following. This fixes the problem without removing Modem Manager.

# Rule to blacklist SparkFun USB boards from being manipulated by ModemManager.
# Fixes issue with hanging references to /dev/ttyACM* devices
ATTRS{idVendor}=="1b4f", ENV{ID_MM_DEVICE_IGNORE}="1"

Hi bbx10node,

Thanks for sharing this fix! I have edited the title to include [FIX] just to make it clear that this is a solution so it is easier to search for if other users run into the same problem.

Thanks again and Happy Hacking!

Wow! I’ve been struggling for months with both the Adafruit and Sparkfun NRF52 boards and /dev/ttyACMx flakiness. Now, it just works.