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

Instructions for bare metal part regarding udev rules didn't work #608

Open
Mandragorian opened this issue May 3, 2023 · 6 comments
Open
Assignees

Comments

@Mandragorian
Copy link
Collaborator

When I tried to run the cargo embed command to flash the microbit:v2 controller, it failed with a permission error regarding device /dev/hidraw0. Unfortunately I do not have the exact error message since I accidentally closed the terminal window.

It turned out that I had to change the udev rules to make it work.

Instead the contents that made it work are:

SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", ATTR{idProduct}=="0204", MODE:="666"

taken from: https://docs.rust-embedded.org/discovery/microbit/03-setup/linux.html#udev-rules

I think this is because the plugdev group is ubuntu specific and according to the Arch Wiki:

Ubuntu's approach is to create a plugdev group that devices are added to, but this practice is not only discouraged by the systemd developers, [[2]](https://bugzilla.redhat.com/show_bug.cgi?id=815093) but considered a bug when shipped in udev rules on Arch

(It could be also that I forgot to reload the rules and/or re-plug in the controller, but I think I did that. At any case I open this issue in case others have the same problem)

@mgeisler
Copy link
Collaborator

mgeisler commented May 4, 2023

Thanks @Mandragorian, it sounds like we should do one or more of the following

  1. Add a note to the setup instructions telling people that they're specifically for Debian/Ubuntu/gLinux or
  2. Add a note about how to do things on Arch
  3. Link to the rust-embedded book you link to

I think I would prefer 3 since it's more future proof.

@qwandor
Copy link
Collaborator

qwandor commented May 4, 2023

The instructions in the course already do say that they are specific to gLinux and Debian. The instructions linked above give all users read-write access to the device, which is probably not what you want.

I guess we could give instructions per distribution, but that might get rather unwieldy.

@mgeisler
Copy link
Collaborator

mgeisler commented May 8, 2023

I guess we could give instructions per distribution, but that might get rather unwieldy.

Yes, we should avoid that — it's not our area of expertise. So could we take out the instructions we have right now and instead point people to a reliable third-party source?

@qwandor
Copy link
Collaborator

qwandor commented May 9, 2023

For the common case of people at Google running gLinux, or people externally using Debian or Ubuntu, the instructions we have are correct and the instructions linked above are less secure: they give all users on the system access to the device, rather than just those who should have access to external devices. I think we should keep the instructions we have, rather than making people take more steps to get the correct setup.

We could also add a link somewhere else for other distributions, but they still need to figure out how to install the other required packages (we only give instructions using apt for Debian based distributions). I'm inclined to just say if you don't use our supported distributions then you're on your own.

@mgeisler
Copy link
Collaborator

I'm inclined to just say if you don't use our supported distributions then you're on your own.

We can do better by linking to the generic instructions on the rust-embedded website. That would basically have saved @Mandragorian from having to find this by himself.

@mgeisler
Copy link
Collaborator

I created a PR in the rust-embedded repository to make the rules better there.

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

No branches or pull requests

4 participants