TinyCLR OS 2.2 Release

Originally published at: TinyCLR OS 2.2 Release – GHI Electronics

We’re pleased to announce that TinyCLR OS 2.2 is RTW (Ready to Wear!). The production of 2.2 adds many improvements over 2.1, including:

Added Features Include:

  • Add USB Client mass storage allowing access files right from USB (similar to SD card readers).
  • CPU Usage statistics feature.
  • I2C Slave support.
  • Gauge and Charts added to UI.
  • TCA file generation from within Visual Studio 2022.
  • Reduce CPU workload and power consumption.
  • Many other stability fixes and improvements.

See release notes for full details on all the new features and bug fixes.

Release Notes
Downloads
2 Likes

And improved Touch Monitor through USB as well.

after update I can`t WriteReadPartial to i2c device in the mode Master:
#### Exception System.NotSupportedException - 0x00000000 (1) ####
#### Message: Not supported in master mode.
#### GHIElectronics.TinyCLR.Devices.I2c.I2cDevice::WriteReadPartial [IP: 0010] ####

1 Like

There is one property that is only for to I2Cslave. Post your code here or check your initialize code.

int address = 0x68;
uint clockRateHz = 100_000;
I2cController controller = I2cController.FromName(SC20260.I2cBus.I2c1); 
I2cConnectionSettings settings = new I2cConnectionSettings(address >> 1, I2cAddressFormat.SevenBit, clockRateHz);
I2cDevice device = controller.GetDevice(settings);
...
byte SetGetReg(byte addr, byte val)
{
  byte[] outBuffer = new byte[] { addr, val };
  byte[] inBuffer = new byte[1];
  int transferred = 0;
  try
  {
    transferred = this.device.WriteReadPartial(outBuffer, inBuffer).BytesTransferred;
  }
  catch (Exception ex)
  {
    Debug.WriteLine(ex.Message);
  }
  if (transferred != 3)
    return 1;
  else
    return 0;
}

I was able to reproduce it.

I have checked library source, we added this to prevent “WriteReadPartial” in master mode, trying to remember why, there should be a reason.

If you know how to add an external source, just add i2c as external source instead of nuget, and remove those code.

Or, you can wait for us done few other thing.

1 Like

2.2.0.4200 libraries and extension released out last couple minutes,

Update them then the issue will be gone.

Firmware has not changed.