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

Raspberry Pi 3: how do I enable UART and GPIO access? #100620

Closed
tmplt opened this issue Oct 15, 2020 · 5 comments
Closed

Raspberry Pi 3: how do I enable UART and GPIO access? #100620

tmplt opened this issue Oct 15, 2020 · 5 comments
Labels
0.kind: question Requests for a specific question to be answered 6.topic: hardware

Comments

@tmplt
Copy link
Member

tmplt commented Oct 15, 2020

I'm working on a project with a Raspberry 3 Model B where I need to use SPI, UART and the GPIO pins. I'm building a bootable image by importing <nixpkgs/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix>.

By some help of @sorki, I've managed to get SPI up and running by applying a device-tree overlay on linuxPackages_4_19 using #79370. But thus far I've had no success with UART or GPIO.

When using boot.kernelPackages = pkgs.linuxPackages_rpi3 (the only kernel tried where the expected /dev/ttyAMA0 appears), a UART loopback test (shorting the UART TX/RX pins and using screen /dev/ttyAMA0 115200 to enter some bytes) fails.

I haven't digged as much into GPIO support yet: thus far I have tried to use gpiozero which fails because it tries to parse out a "Revision\t:" field from /proc/cpuinfo that does not exist.

Is there a known way to properly enable GPIO and UART access?


For sake of context, my NixOS configuration can be found here.

@tmplt tmplt added 0.kind: bug Something is broken 0.kind: question Requests for a specific question to be answered and removed 0.kind: bug Something is broken labels Oct 15, 2020
@Gaelan
Copy link
Contributor

Gaelan commented Jan 6, 2021

For GPIO, see if the commands from libgpiod work. Those use the new character device ABI (/dev/gpiochip0), which is the preferred way to do such things these days. If you can find a library for your language that uses that ABI, that would be best.

@stale
Copy link

stale bot commented Jul 8, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 8, 2021
@adminy
Copy link
Contributor

adminy commented Jul 26, 2023

will this work for orange Pi 5 plus also?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 26, 2023
@sorki
Copy link
Member

sorki commented Oct 18, 2023

will this work for orange Pi 5 plus also?

Not sure what exactly are you asking about but both libgpiod and UART should work out of box on most boards.

@sorki
Copy link
Member

sorki commented Oct 18, 2023

Looks very dated and no sure if there's anything actionable here, feel free to reopen if needed.

@sorki sorki closed this as completed Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: question Requests for a specific question to be answered 6.topic: hardware
Projects
None yet
Development

No branches or pull requests

5 participants