oxidecomputer / oxidecomputer/hubris

SPI API is too cleverly complex for its own good

Open
#407 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

robustness stm32
Dominant language
Rust
Stars
3.6k
Forks
239
Avg merge
1d 12h
Merged PRs (30d)
23

Description

Currently the SPI API sports read, write, and exchange operations. The exchange operation reads from one buffer and writes to another. It currently allows those buffers to be different lengths, kind of, sometimes -- I think the written buffer can be shorter than the read buffer but not necessarily vice versa? And the fact that read and write can technically be described in terms of exchange means that clever programmers (mostly me) have tried to implement the former in terms of the latter?

Anyway, long story short, the resulting driver state machine is too complex for my liking and I want to rewrite it. We've found and fixed a number of subtle bugs, and created new subtle bugs in the process.

I am totally open to changing the API during this process.

Contributor guide

Open the contributing guide

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 tracing the SPI API's read, write, and exchange operations through the driver state machine described in the issue. Clarify the intended buffer-length rules and revised API, then verify that the redesign addresses the subtle state-machine bugs without relying on exchange to implement read or write.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.