UncleRus / esp-idf-lib

Component library for ESP32-xx and ESP8266
https://esp-idf-lib.readthedocs.io/en/latest/
1.38k stars 428 forks source link

i2c_driver_install error #482

Closed akhilgupta1093 closed 1 year ago

akhilgupta1093 commented 1 year ago

The issue

I'm trying to run i2c_driver_install, and getting back a generic ESP_FAIL error, so I'm not sure how to debug it. Here's my code:

#define I2C_FREQ_HZ 100000
#define I2C_PORT 0
#define CONFIG_I2C_MASTER_SDA 3
#define CONFIG_I2C_MASTER_SCL 4

void nmea_example_init_interface(void)
{
    const i2c_config_t conf = {
        .mode = I2C_MODE_MASTER,
        .sda_io_num = CONFIG_I2C_MASTER_SDA,
        .sda_pullup_en = GPIO_PULLUP_ENABLE,
        .scl_io_num = CONFIG_I2C_MASTER_SCL,
        .scl_pullup_en = GPIO_PULLUP_ENABLE,
        .master.clk_speed = I2C_FREQ_HZ,
    };
    ESP_ERROR_CHECK(i2c_param_config(I2C_PORT, &conf));
    ESP_ERROR_CHECK(i2c_driver_install(I2C_PORT, conf.mode, 0, 0, 0));
}

Any ideas about why this method might fail, and how I can debug it? Thanks!

Which SDK are you using?

esp-idf

Which version of SDK are you using?

ESP-IDF v4.4.2

Which build target have you used?

Component causing the issue

Adafruit Mini GPS PA1010D (https://www.adafruit.com/product/4415)

Anything in the logs that might be useful for us?

E (3181) i2c: i2c driver install error

Additional information or context

No response

Confirmation

trombik commented 1 year ago

the functions in the code are not maintained by us. the issue template says "Report an issue in esp-idf-lib code".