I2C/GPIO Access from .NET Core 6?

TheZNerd
TheZNerd New Member Posts: 11

WinRT support has been removed from .NET Core 5 and up: https://docs.microsoft.com/en-us/dotnet/core/compatibility/interop/5.0/built-in-support-for-winrt-removed

The SDK does not provide support for .NET Core 5 and up at this point - I cannot gain access to any GPIO using the standard namespaces (System.Device.I2c, System.Device.Gpio, etc.). Please advise - this makes the board unusable for any modern development.

Tagged:

Answers

  • TheZNerd
    TheZNerd New Member Posts: 11

    Hey @camillus - I see that you seem to be the owner of the current SDK setup files. Can you chime in here please? Has any thought been given to support for the standard libraries/namespaces for .NET Core 5+ (System.Device.Gpio)?

    If we can't use the Windows APIs directly, is there any example code for interfacing with GPIO/I2C/etc. from netcore5+? Right now, the SDK includes a WinMD for netcore <5 but this metadata file cannot be used directly in netcore5+ projects.

  • TheZNerd
    TheZNerd New Member Posts: 11

    One additional thought is that a projection could be created using the C#\WinRT package from Microsoft. See here: https://github.com/microsoft/CsWinRT

    Although it would be preferable to just have a driver that allows for access via the standard namespaces (System.Device.GPIO/System.Device.I2c) which just wrap the Windows.Devices.GPIO.dll assembly. My knowledge in this space is extremely limited - but this might serve as a base for support: https://docs.microsoft.com/en-us/windows-hardware/drivers/gpio/gpio-driver-support-overview - although I suspect the driver side of the equation is fully up to AAEON?

  • garyw
    garyw New Member, Moderator, AAEON Posts: 39 admin

    @TheZNerd currently Up Framework has supported .Net Core 3+ not support .Net 5+ yet.
    May we know what purpose or reason you have to use .Net 5+ and let us to speed up .Net 5+ support in Up Framework.

    Thanks.

  • TheZNerd
    TheZNerd New Member Posts: 11

    @garyw - support for .NET Core 3.1 ends December 3rd of 2022, no reason to develop a new application on a platform with a shortened support window that has breaking changes between it and the current version. I was previously developing on the DragonBoard 410c, however since Microsoft appears to have dropped support for IoT Core I needed to move to a full windows platform. Additionally .NET Core 5 was released over a year ago (November 2020) - which feels like plenty of time to have tackled this already.

  • garyw
    garyw New Member, Moderator, AAEON Posts: 39 admin

    @TheZNerd Thanks fot the informantion, there are 3 years support in .Net Core lts version like .Net Core 3.1 and .Net Core 3.0 still can using right now just not support from MS.
    So most user using UWP app or Desktop app with Up Framework(supported Windows Apis and EAPI) to control GPIO, just few user using .Net Core 3+, so maybe you can considering to using .Net Core 3.1 first and transfer to .Net 5+ when Up Framework is .Net 5+ ready.
    We'll plan to support .Net 5+ into Up Framework ASAP, thanks.

  • TheZNerd
    TheZNerd New Member Posts: 11

    Thanks @garyw - while I appreciate that they may still be used, I don't like writing new software for unsupported frameworks. I'm not sure all the work it would take to migrate this project to .NET Core 3.1, but I'm willing to investigate. Additionally, this change would require me also to rollback to EF Core 3.1 from EF Core 6, which is much less desirable given the amount of work already put into this project.

    I need to make a decision on whether to continue with the UP Squared or look into another platform - can a more solid answer to the timeline other than "ASAP" be provided?

  • TheZNerd
    TheZNerd New Member Posts: 11

    Initial assessment shows this is going to be a massive mess since the project is also written in WinUI 3. I'm not sure it's feasible to rollback to .NET Core 3.1 in a reasonable amount of time.

  • TheZNerd
    TheZNerd New Member Posts: 11

    @garyw @camillus - WinUI 3 does not support .NET Core 3.1... only supports 5+ - I cannot migrate this project to .NET Core 3.1 or lower at this time. Please advise on updated framework timeline or notify your partner in the service department to allow me to return this device.

  • TheZNerd
    TheZNerd New Member Posts: 11

    Or is there another method? I can enable the RHProxy on the system by setting the OS to "Windows 10 IOT Core" in BIOS (I'm running Windows 10 Enterprise). I get further with this method as the Windows namespaces can at least see an I2C bus at address 0, but still cannot access the device at the appropriate address (0x77).