Home icon indicating copy to clipboard operation
Home copied to clipboard

ESP32_C6_THREAD thrown an ArgumentException at I2cDevice for busId = 2

Open romankiss opened this issue 1 year ago • 2 comments

Target name(s)

ESP32_C6_THREAD

Firmware version

all versions

Was working before? On which version?

none

Device capabilities

No response

Description

There is an issue at creating the I2cDevice for busId = 2. It looks like there is missing a driver for LP I2C controller.

The following exception is thrown:

++++ Exception System.ArgumentException - 0xfd000000 (1) ++++ ++++ Message: ++++ System.Device.I2c.I2cDevice::NativeInit [IP: 0000] ++++ ++++ System.Device.I2c.I2cDevice::.ctor [IP: 001c] ++++ Exception thrown: 'System.ArgumentException' in System.Device.I2c.dll

How to reproduce

Configuration.SetPinFunction(14, DeviceFunction.I2C2_DATA); Configuration.SetPinFunction(15, DeviceFunction.I2C2_CLOCK); I2cDevice i2c_sht = new(new I2cConnectionSettings(2, Sht4X.I2cDefaultAddress)); // <= thrown exception

Expected behaviour

No response

Screenshots

No response

Aditional information

No response

romankiss avatar Aug 23 '24 07:08 romankiss

The issue here is the 2nd I2C port is a low power port which isn't supported in the legacy I2C API we are using. To use this I2C port we would need to do following:

  1. Update I2C driver to use the new I2C driver API
  2. Update ESP32 build to use espressif IDF 5.3 as LP_I2C is not supported in current IDF

AdrianSoundy avatar Aug 25 '24 03:08 AdrianSoundy

Blocked by #1580 .

josesimoes avatar Feb 05 '25 14:02 josesimoes