oxidecomputer / oxidecomputer/hubris

consider mechanism to lock essential GPIO pin functions

Open
#345 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I discovered recently that ITM is (and has been) broken -- but only on one board (the Nucleo H743/H753). I definitely didn't take the shortest route to debug this problem, but -- with a tip of the chapeau to Robert Ledru -- it turned out to be due to my enhancement of the SPI driver as part of eee1bb8e4fba0b7ac2bfecd0d8b4c4709c5cc67d. That commit takes several pins for SPI on that board (PA4, PB3, PB4 and PB5). The problem, as it turns out, is that PB3 AF0 on the H743/H753 is TRACESWO -- changing the function on that pin turns off ITM. On the one hand, this is yet more evidence that ITM (and SWV/SWO) is considered fringe rather than essential: unlike SWDIO and SWCLK (each of which has their own dedicated pins that can't be used for anything else), TRACESWO is forced into the general GPIO population where this kind of programming mistake is possible. But it also may highlight a slightly more general issue in which we may want to lock pins to a purpose and not allow them to be programmed? (One could imagine the GPIO task getting configuration for pins that cannot be reprogrammed, similar to what we have done with I2C in the application TOML.) Clearly, this specific problem needs to be fixed by Not Doing That, but it would nice to not reintroduce this.

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 reviewing commit eee1bb8e4fba0b7ac2bfecd0d8b4c4709c5cc67d and the SPI driver changes affecting PA4, PB3, PB4, and PB5 on the Nucleo H743/H753. Then inspect the GPIO task and the application TOML I2C configuration for existing pin restrictions. Done means a decided mechanism prevents essential functions such as PB3 TRACESWO from being reprogrammed without breaking intended GPIO configuration.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.