udev rule for OpenOCD

If you are debugging a board using the Atmel ICE debugger with OpenOCD, you may want a udev rule so you don’t have to run commands as root.

This was the incantation that worked for me. I added the file /etc/udev/rules.d/42-openocd.rules with the following contents:

ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2141", ACTION=="add", MODE="0666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2111", MODE="666", GROUP="plugdev"

Then, reload your rules with:

sudo udevadm control --reload-rules

Unplug and plug back in the debugger and you should be able to enjoy non-root debugging.