rust-embedded / rust-embedded/linux-embedded-hal

How to use SPI with gpio_cdev

Open
#116 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
319
Forks
60
Avg merge
12h 31m
Merged PRs (30d)
1

Description

Using gpio_cdev the line handler return Error { kind: Ioctl { kind: LineHandle, cause: EBUSY } } when requesting a pin configured as SPI chip select.

In my case, when running a raspberry pi 5:
line 16: "GPIO16" "spi1 CS2" output active-low [used]

ls /dev/spidev*
/dev/spidev0.0  /dev/spidev1.0  /dev/spidev10.0  /dev/spidev1.1  /dev/spidev1.2

Any suggestion or example of how to use chip selects with the new API ?
It appears to run fine in a Raspberry Pi 4.
line 16: "GPIO16" unused output active-high

ls /dev/spidev
spidev0.0  spidev1.0  spidev1.1  spidev1.2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the gpio_cdev line request on a Raspberry Pi 5 with GPIO16 configured as SPI1 CS2, then compare it with the reported Raspberry Pi 4 behavior. Investigate how the new API handles SPI chip-select lines and the EBUSY result; done means establishing whether this is supported, documenting the correct usage, or identifying a fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, raspberry-pi, rust
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.