dotnet / iot

This repo includes .NET Core implementations for various IoT boards, chips, displays and PCBs.
MIT License
2.18k stars 586 forks source link

SPI_Mcp3008CanRead is frequently failing on CI #2339

Open krwq opened 3 months ago

krwq commented 3 months ago

The most likely issue is that MCP3008 needs a reset but there is no way to software reset it. The other possibility is that something got disconnected but this is a path on the PCB so it seems unlikely.

    System.Device.Gpio.Tests.ProtocolsTests.SPI_Mcp3008CanRead [FAIL]
      Assert.InRange() Failure: Value not in range
      Range:  (1018 - 1023)
      Actual: 0
      Stack Trace:
        /_/src/System.Device.Gpio.Tests/ProtocolTests.cs(32,0): at System.Device.Gpio.Tests.ProtocolsTests.SPI_Mcp3008CanRead()

Seen on:

krwq commented 2 months ago

[Triage] Our best shot is to modify CreateAdc and try passing -1 as CS and manually set CS with LibGpiod - that will at least eliminate possiblity of CS not working through SpiConnectionSettings