I2C problem with Esp-Idf V4.4-dev-1404
Posted: Thu May 20, 2021 10:22 am
Hello
I am trying to use the latest version (4.4) of esp-idf and I encounter a problem with i2c install
For instance witt the the following program (i2c scan)
If I compile it with esp-idf version 4.1-dev-2020, it works fine on my ESP32.
But if I compile it with lateste version 4.4-dev-1404, on the same board, I get the message :
"i2C clock choice is invalid, please check flag and frequency"
Has someone any idea ?
Thanks in advance
I am trying to use the latest version (4.4) of esp-idf and I encounter a problem with i2c install
For instance witt the the following program (i2c scan)
Code: Select all
printf("i2c scanner\r\n\r\n");
// configure the i2c controller 0 in master mode, normal speed
i2c_config_t conf;
conf.mode = I2C_MODE_MASTER;
conf.sda_io_num = 14;
conf.scl_io_num = 27;
conf.sda_pullup_en = GPIO_PULLUP_ENABLE;
conf.scl_pullup_en = GPIO_PULLUP_ENABLE;
conf.master.clk_speed = 10000;
ESP_ERROR_CHECK(i2c_param_config(I2C_NUM_0, &conf));
printf("- i2c controller configured\r\n");
// install the driver
ESP_ERROR_CHECK(i2c_driver_install(I2C_NUM_0, I2C_MODE_MASTER, 0, 0, 0));
printf("- i2c driver installed\r\n\r\n");
printf("scanning the bus...\r\n\r\n");
int devices_found = 0;
for(int address = 1; address < 127; address++) {
// create and execute the command link
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
i2c_master_start(cmd);
i2c_master_write_byte(cmd, (address << 1) | I2C_MASTER_WRITE, true);
i2c_master_stop(cmd);
if(i2c_master_cmd_begin(I2C_NUM_0, cmd, 1000 / portTICK_RATE_MS) == ESP_OK) {
printf("-> found device with address 0x%02x\r\n", address);
devices_found++;
}
i2c_cmd_link_delete(cmd);
}
if(devices_found == 0) printf("\r\n-> no devices found\r\n");
printf("\r\n...scan completed!\r\n");
But if I compile it with lateste version 4.4-dev-1404, on the same board, I get the message :
"i2C clock choice is invalid, please check flag and frequency"
Has someone any idea ?
Thanks in advance