I2C on 40 pin connector not working on Win 64

EMBEXYS
EMBEXYS New Member Posts: 7
Hello,

I need to use for new product development the I2C interface (I2C-1 of the 40 pins GPIO connector) on windows 64 bits.

I tried to use the EAPI library to control this interface, but the call to "EApiI2CWriteTransfer()" always returns 0xFFFFF0FF.
Moreover, I do not know what ID I should use for the I2C-1 interface of the 40 pins connector. I tried "EAPI_ID_I2C_EXTERNAL" and "EAPI_ID_SMBUS_EXTERNAL" with the same wrong result.

The EAPI library is working for controlling the simple IO of the 40 pins GPIO connector.

Could you tell me how to make the I2C interface work ?

Best regards

Alain

Comments

  • EMBEXYS
    EMBEXYS New Member Posts: 7
    Has anyone been able to run on Windows 10 the I2C interface of the 40 pins ccimmector?

    Regards
  • NoelStephens
    NoelStephens New Member Posts: 25
    This, evidently, is a BIOS issue. Currently the only version of Windows 10 operating system (I believe) that supports I2C is Windows IoT Core, but you must download and install the 32 bit bios drivers. I have not tested this as I have been *patiently* waiting for the BIOS release that has been in testing for 3+ months (or longer sort of confusing how this site/forum is put together).

    The only thing I can think of doing is keep posting "When will I2C work under Windows 10?" questions as it would seem that there is a small % of people trying to develop on actual Windows 10 operating systems (server as well)...as such the most likely reason why it is taking so long (i.e. fix issues for the biggest consumer base then work back around for other issues).

    Like a month ago there was a post that said they were "almost there", and now it seems to be *crickets*.
  • NoelStephens
    NoelStephens New Member Posts: 25
    Hope they fix it soon. It is taking forever for them to push out the BIOS update that is supposed to fix this issue.

    Just posting again to remind the UP folks...there are developers patiently waiting for the update that will allow for I2C communication under windows 10!
    Just supporting GPIO does not "cut the cake"...can't do much with GPIO other than toggle things on or off...I2C is the primary interface (IMO) for most all IoT related projects that are more than turning an LED on or off...

    Hopefully someone will post an actual "set in stone" ETA on the fix for this... it is getting a little annoying that it is almost taking an entire *year* (plus) to resolve this.
  • Drew
    Drew New Member Posts: 6
    Are you using an Up Board or Up^2 ? I'm on the Up^2 , and haven't been able to get even GPIO working with the AeonFramework, under Windows 10x64 . Working in Linux, so it's there, but, no luck with the Windows drivers.
  • NoelStephens
    NoelStephens New Member Posts: 25
    I think the U^2 might require a bios update? I remember reading there was a more recent (i.e. it was changed on 2017-09-13) update that could, at a minimum, fix the issue you might be having with GPIO. Are you using C++ or C# with pinvoke wrappers? If the later (C#) then the I2C example I found floating around in the forums appears to have an error in the pinvoke wrapper for the I2C. I did a little debugging down to the user mode level hooks just before it would hit the kernel layer and it looked like it was expecting something more like this:
    [DllImport("aaeonEAPI.dll", EntryPoint = "EApiI2CReadTransfer", CallingConvention = CallingConvention.Cdecl)]
    unsafe public static extern UInt32 EApiI2CReadTransfer(UInt32 IdI2C, UInt32 address, UInt32 cmd,ref byte[] buffer, UInt32 bufferlen, UInt32 toread);

    [DllImport("aaeonEAPI.dll", EntryPoint = "EApiI2CWriteTransfer", CallingConvention = CallingConvention.Cdecl)]
    unsafe public static extern UInt32 EApiI2CWriteTransfer(UInt32 IdI2C, UInt32 address, UInt32 cmd,ref byte[] buffer, UInt32 bufferlen);

    [DllImport("aaeonEAPI.dll", EntryPoint = "EApiBoardGetStringA")]
    public static extern UInt32 EApiBoardGetStringA(UInt32 Id, StringBuilder buffer, ref UInt32 bufflength);

    [DllImport("aaeonEAPI.dll", EntryPoint = "EApiI2CProbeDevice")]
    public static extern UInt32 EApiI2CProbeDevice(UInt32 Id, UInt32 address);

    The above fixes several issues regarding the example you can download from the UPBoard downloads (have not looked at anything under the Up^2 area), however once it was fixed (and not stomping over memory) I realized that it was not returning anything because the BIOS (for Up Board at least) needed an update for it to work properly? (Which seems odd that they need a bios fix for something that already works under Linux using the *same BIOS*)

    Driver issue...bios issue... I2C on Windows has an issue somewhere between the aaeonEAPI.dll and the drivers...but then again they do have different "operating system" selections in the bios...so it could be something like a memory alignment issue or some other weird anomaly.

    That is about all I know thus far, as I am still waiting on some form of response from someone that seems to work for aaeon (Asus) or anyone at the Up-Board shop site (sent them emails about this issue as well)...but have gotten *zero* responses other than other individuals who have run into the same brick wall.
  • Robert Alexander
    Robert Alexander New Member Posts: 16

    I'm also trying to figure this out and found some good information here:
    https://forum.up-community.org/discussion/2918/where-can-i-get-a-up-board-sdk-to-write-my-software-to-control-gpio-pins
    and
    https://forum.up-community.org/discussion/2019/adc-under-windows-drivers-when-available
    They have some example code that I haven't tested out yet. The Hi-Safe utility does not support "SmBus" (I2C) function for the UP-CHT01 which is what I am working on but I'm hopeful to look at the I2C sample code to see if it can work. We have 950 Up boards purchased and soon to be in full use. It would be nice if we can use I2C to communicate with battery back up systems, ambient light detection and backlight control.

  • javibo
    javibo New Member Posts: 1

    EAPI_ID_AONCUS_I2C_EXTERNAL_2;> @EMBEXYS said:

    Hello,

    I need to use for new product development the I2C interface (I2C-1 of the 40 pins GPIO connector) on windows 64 bits.

    I tried to use the EAPI library to control this interface, but the call to "EApiI2CWriteTransfer()" always returns 0xFFFFF0FF.
    Moreover, I do not know what ID I should use for the I2C-1 interface of the 40 pins connector. I tried "EAPI_ID_I2C_EXTERNAL" and "EAPI_ID_SMBUS_EXTERNAL" with the same wrong result.

    The EAPI library is working for controlling the simple IO of the 40 pins GPIO connector.

    Could you tell me how to make the I2C interface work ?

    Best regards

    Alain

    Hola,
    Utiliza esto para I2C-1 . A mi me funciona

    EAPI_ID_AONCUS_I2C_EXTERNAL_2

    Saludos