hidapi error: Permission denied
When I run the following command:
$ cargo embed --features v1 --target thumbv6m-none-eabi
I get:
Error Probe could not be created
Caused by:
0: hidapi error: Permission denied
1: hidapi error: Permission denied
Despite having:
$ cat /etc/udev/rules.d/99-microbit.rules
# CMSIS-DAP for microbit
SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", ATTR{idProduct}=="0204", MODE:="666"
I have rebooted several times and even checked the file permission on my device (/dev/bus/usb/001/010):
$ ls /dev/bus/usb/001/010
crw-rw-rw- 189,9 root 4 Dec 07:17 /dev/bus/usb/001/010
My kernel is 6.0.10 and I run archlinux. Any help would be much apreciated.
Not sure if this will fix your issue, but I was facing the same error and fixed it with the following udev rule:
# CMSIS-DAP for microbit
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0d28", ATTRS{idProduct}=="0204", MODE="0660", TAG+="uaccess"
I also needed to use /etc/udev/rules.d/70-microbit.rules, as recommended by the probe-rs docs.
According to the Arch Wiki:
The modern recommended approach for systemd systems is to use a
MODEof660to let the group use the device, and then attach a TAG nameduaccess.
After editing the file, I ran sudo udevadm control --reload and replugged the micro:bit; at which point I was able to run cargo embed without issue.
Had the exact same problem, solution worked. Thanks a lot!
Nice to see that you found a solution. Could one of you put together a PR adding this to the book?
Same fix worked on Ubuntu, with a udevadm trigger instead of replugging in. :)
Didn't work for me with a v1, not sure why. On Debian 12. Provided my solution here.
@l-0-l Thanks for that.
Note that we are currently planning to remove Microbit v1 from this guide to reduce confusion. If folks feel strongly that we need to continue to support this board, please comment on https://github.com/rust-embedded/wg/pull/759