Udev rules for spark core & USB device/vendorid

The 48-stm32dfu.rules that came with my dfu-utils package didn’t work with the spark core, so I had to run make program-dfu using sudo to flash freshly-compiled firmwares.

I’ve now created a new udev rules file based on the above that just has the correct usb vendor and device id for the spark core, based on the stm32dfu rules I mentioned earlier; with these, I can run make program-dfu as a normal user. Perhaps I should’ve renamed the symlink to “spark”…

% cat /etc/udev/rules.d/48-stm32dfu.rules 
# stm32 boards, with onboard DFU support

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", \
    MODE:="0666", \
    SYMLINK+="stm32_dfu"

# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.

By the way - for some reason my spark core shows up as OpenMoko… Is this intentional?

Bus 001 Device 006: ID 1d50:607f OpenMoko, Inc. 
2 Likes

Thanks man!

We are on a special version of DFU so is there something we can fix to resolve this? :slight_smile:

i just made an /etc/udev/rules.d/75-sparkcore.rules with the following (same as for an arduino usbasp) and now i don’t need to use root/sudo, should be all on one line:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="607f", GROUP="dialout", MODE="0666"

either reboot or run “udevadm control --reload” as root for the changes to take effect. oh this assumes you’re in the dialout group as the arduino or modems etc. use, you could just add your user group instead.