Skip to content

[Linux][HIDSharp] System hangs while I2C read #1

@smdn

Description

@smdn

HIDSharp problem?

repro code

using System;

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;

using Smdn.Devices.MCP2221;

var services = new ServiceCollection();

services.AddLogging(
  builder => builder
    .AddSimpleConsole(static options => options.SingleLine = true)
    .AddFilter(static level => LogLevel.Trace <= level)
);

await using var device = await MCP2221.OpenAsync(services.BuildServiceProvider());

var address = new I2CAddress(0x20); // MCP23017

await device.I2C.WriteByteAsync(address, 0x12); // GPIOA

var buffer = new byte[2];

await device.I2C.ReadAsync(address, buffer); // System hangs here

Console.WriteLine(BitConverter.ToString(buffer));

dotnet build /p:UsbHidDriver=HIDSharp && stdbuf -o0 dotnet run --no-build &> test.log

log

test.log:

(no log recorded)

/var/log/syslog:

(no log recorded)

env

.NET SDK (global.json を反映):
 Version:   5.0.202
 Commit:    db7cc87d51

ランタイム環境:
 OS Name:     ubuntu
 OS Version:  20.04
 OS Platform: Linux
 RID:         ubuntu.20.04-x64
 Base Path:   /usr/share/dotnet/sdk/5.0.202/

Host (useful for support):
  Version: 5.0.5
  Commit:  2f740adc14

Metadata

Metadata

Assignees

No one assigned

    Labels

    usbhid-libraryissue relevant to base USB-HID library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions