Skip to content

applet.interface.i2c_initiator: timeout & error message when SCL stuck low #187

Open
@electroniceel

Description

@electroniceel

how to reproduce:

  • connect any port IO to GND (like A0)
  • issue any command that uses this io as i2c initiator SCL (like "glasgow run i2c-initiator --port A -V 3.3 scan")
  • glasgow is waiting endlessly for SCL to go high

I suggest to add a generous, but still reasonable timeout (like 1 second) for this case. Also return an explicit error message like "timeout, SCL stuck low" or similar.

I think this kind of error is not uncommon when testing or developing. Cases that come to mind are:

  • wrong IO pin selected
  • flaky connection
  • external pullup resistors not connected or forgotten to enable the internal ones
  • DUT misbehaving

It would be nice to add some similar detection for SDA too, currently you get back all zeros.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions