Forum Discussion

jmorand's avatar
jmorand
Copper Contributor
Jul 13, 2022
Solved

I2cDevice class / Method WriteReadPartial issuing "unknown error"

Hello community,

 

I'm currently working on an Intel Atom E39340 platform with Windows 10 IOT 2021 LTSC installed on it.

The Read and Write methods of the I2cDevice class everything are working just fine.

Nevertheless, one of my sensors needs a Write+Read access (Start / Write / Restart / Read  /Stop) to access some registers.

When I use the WriteRead(byte[] writebuffer, byte[] readbuffer) I get a System.Argument.Exception:'The parameter is incorrect'. (which is really weird because its compiling). When I use the WriteReadPartial(byte[] writebuffer, byte[] readbuffer) method to get the error code the result is 4 (i.e Unknown error). Overall, nothing happens on the I2C bus.

 

I have explored the online documentation but can't find a lead...

 

https://docs.microsoft.com/en-us/uwp/api/windows.devices.i2c.i2cdevice.writereadpartial?view=winrt-22621

 

Does anyone has ever experienced this ?

 

Thanks a lot for your feedback.

Best regards.

 

  • Hi community,

    While comparing my project properties with the "I2CPortExpander" sample from MSFT sources, I realized that I was compiling for x86 targets... Now that I've changed this to x64 everything seem to be working just fine.

    Best regards.

1 Reply

  • jmorand's avatar
    jmorand
    Copper Contributor
    Hi community,

    While comparing my project properties with the "I2CPortExpander" sample from MSFT sources, I realized that I was compiling for x86 targets... Now that I've changed this to x64 everything seem to be working just fine.

    Best regards.

Resources