Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidapi error: Permission denied #490

Open
John-Toohey opened this issue Dec 4, 2022 · 4 comments
Open

hidapi error: Permission denied #490

John-Toohey opened this issue Dec 4, 2022 · 4 comments

Comments

@John-Toohey
Copy link

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.

@sudoBash418
Copy link

sudoBash418 commented Dec 7, 2022

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 MODE of 660 to let the group use the device, and then attach a TAG named uaccess.

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.

@Vortoman
Copy link

Had the exact same problem, solution worked. Thanks a lot!

@eldruin
Copy link
Member

eldruin commented Jan 16, 2023

Nice to see that you found a solution.
Could one of you put together a PR adding this to the book?

@bcpeinhardt
Copy link

Same fix worked on Ubuntu, with a udevadm trigger instead of replugging in. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants