Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32_C6_THREAD thrown an ArgumentException at I2cDevice for busId = 2 #1534

Open
romankiss opened this issue Aug 23, 2024 · 1 comment
Open

Comments

@romankiss
Copy link

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

@nfbot nfbot changed the title ESP32_C6_THREAD thrown an ArgumentException at I2cDevice for busId = 2. ESP32_C6_THREAD thrown an ArgumentException at I2cDevice for busId = 2 Aug 23, 2024
@AdrianSoundy
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants