Skip to content

F0080 pin-6

Rule: Every pin has one owner.

Code F0080 (stable, never reused)
Id pin-6
Category pin
Source spirit_level
Fix by hand

Level per tier

Tier Level Reason
small off
small-workspace off
medium off
big off
ai off
embedded deny bedrock error: Two owners of a pin (a diagnostic or test API and a driver task): one owner per pin, the other refused
ui off
egui off
units-strict off
units-paranoid off

Why

A pin that two independent pieces of code can both claim (a diagnostic/test API meant for bring-up, and the driver task that normally owns that pin in production) will have whichever one wrote last win, silently, with no indication to either side that the other also has an opinion about that pin. The failure mode is specific to whichever two features happen to collide, and looks like an intermittent hardware fault rather than two owners stepping on each other.

Example

Usb_io_fw's pin-diagnostic feature (IF-16) could still take GPIO8/GPIO9 as generic diagnostic points (b200_board::pin_diag::MCU_PINS, every pin BoardState::available lists) even though the I2C master task owns those same two pins whenever it's running; a diag.pins request could put them under SIO control out from under a live I2C transaction, and the I2C task would only reclaim them on its own next configure — bus recovers, but by luck of timing, not by design.

How to fix

Track pin ownership centrally (one registry that every feature checks before taking a pin) and refuse a request for a pin another feature currently owns, with an error the host can see, instead of letting the last writer win.

How it is checked

Check: src hard — proving two independent code paths can reach the same pin concurrently needs the full firmware model (every task, every API handler, what each one can touch), not a local pattern.

Source

Ported from embedded_bedrock's firmware check catalogue, PIN-6 (book/checks.md, detail in book/checks/pin.md). Found on: usb_io_fw IF-16.

Configure

[lints.pin-6]
level = "deny"
reason = "why this project wants it at this level"

Allow one finding in the code with // spirit-level: allow(pin-6) <reason> (waivers); the code works there too, as in [lints.F0080].