oxidecomputer / oxidecomputer/humility

`humility gpio` should not show values for pins in analog mode on STM32

Open
#38 0 comments 0 reactions 1 assignee View on GitHub

@bcantrill is already working on this.

Since Nov 14, 2021.

Dominant language
Rust
Stars
584
Forks
63
Avg merge
3h
Merged PRs (30d)
2

Description

STM32 parts offer an "analog mode" pin configuration that disconnects the input Schmitt trigger from the pin, to avoid disturbing weak analog signals or hanging out in metastable ranges.

STM32H7 reference manual (RM0433 rev 7) section 11.3.13 "Analog Configuration" provides the skinny here, but the short version is

  1. In Analog mode the "input" always reads as zero and is unconnected to the pin.
  2. Many, many pins reset in analog mode. Nearly all of them in fact.

When Humility displays gpio state for pins, it would ideally not display "0" for pins that are in analog mode, as it has misled people into thinking that the connected nets are being held low, when in fact it indicates nothing of the sort.

This will require changes outside Humility -- the GPIO driver doesn't expose this information, in particular, because applications don't typically care. They configure their pins and then do the things, there's no need to check whether it has mysteriously reverted to analog at each step. But, for applications like Hiffy, we could add an operation to read out the mask of which pins are providing legit input values, and which are disconnected, say.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.