Microbit on Debian/Ubuntu using webusb or usbfs

On: Tue 08 April 2025

I use debian and ubuntu and found the documentation for using microbit was insufficient.

I got permission denied errors using webusb, and git had persistent 503, 504 and 521 errors when trying to copy hex files using usbfs.

I found several wiki pages online which pointed to udev solution of webusb, but none for usbfs. I reached out to microbit support, who said issue was the mount needed the sync option similar too:

mount | grep MICROBIT
/dev/sdb on /media/$USER/MICROBIT type vfat (rw,nosuid,nodev,relatime,sync,uid=1115,gid=1115,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,errors=remount-ro,uhelper=udisks2)

So, the full solution is to create a udeb rule /etc/udev/rules.d/99-microbit-webusb.rules similar too:

SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", ATTR{idProduct}=="0204" \
  MODE="0666"

and /etc/udev/rules.d/99-microbit-usbfs.rules:

#
# Skip if not a block device or if requested by other rules
#
SUBSYSTEM!="block", GOTO="microbit_udisks_mount_options_end"
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="?*", GOTO="microbit_udisks_mount_options_end"

#
# Add sync option
#
SUBSYSTEMS=="usb", ENV{ID_FS_USAGE}=="filesystem", \
ATTRS{idVendor}=="0d28", ENV{UDISKS_MOUNT_OPTIONS_DEFAULTS}="sync"

LABEL="microbit_udisks_mount_options_end"

Reload the udev rules

sudo udevadm control --reload-rules

Drop me a line using one of the contact methods