Digispark and Debian

Following Brian’s lead, I recently picked up a couple of Digispark USB development boards. It’s a cheap, tiny, Arduino-like microcontroller. There are a couple of interesting project ideas that I have in mind for these. It’s been over 6 years since I last hacked on a microcontroller.

Unfortunately, support for the Digispark on Linux is spotty. Just as with any hardware project, the details are irreversibly messy. It can’t make use of the standard Arduino software for programming the board, so you have to download a customized toolchain. This download includes files that have the incorrect vendor ID, requiring a manual fix. Worse, the fix listed in their documentation is incomplete, at least for Debian and Debian-derived systems.

The main problem is that Linux will not automatically create a /dev/ttyACM0 device like it normally does for Arduino devices. Instead it gets a long, hidden, unpredictable device name. The fix is to ask udev to give it a predictable name by appending the following to the first line in the provided udev rules file (49-micronucleus.rules),

SYMLINK+="ttyACM%n"

The whole uncommented portion of the rules file should look like this:

The == is a conditional operator, indicating that the rule only applies when the condition is met. The := and += are assignment operators, evaluated when all of the conditions are met. The SYMLINK part tells udev put a softlink to the device in /dev under a predictable name.

Have a comment on this article? Start a discussion in my public inbox by sending an email to ~skeeto/public-inbox@lists.sr.ht [mailing list etiquette] , or see existing discussions.

null program

Chris Wellons

wellons@nullprogram.com (PGP)
~skeeto/public-inbox@lists.sr.ht (view)