The problem occurs when I connect sensors with SPI and I2C, VSPI and I2C both at same time.
When I assign these pins for SPI and I2C, esp32 could not read datas from I2C sensor because of I2C command time out (ESP_ERR_TIMEOUT).
Code: Select all
// I2C
gpio_num_t SDA = GPIO_NUM_21;
gpio_num_t SCL = GPIO_NUM_22;
// SPI
gpio_num_t sclk = GPIO_NUM_18;
gpio_num_t miso = GPIO_NUM_23;
gpio_num_t mosi = GPIO_NUM_19;
gpio_num_t cs = GPIO_NUM_5;
https://github.com/natanaeljr/esp32-MPU-driver for I2C sensor(MPU9250).
I try to change I2C pin assign to SCD = GPIO_NUM_26, SCL = GPIO_NUM_15, then it works.
Is anybody knows why these above configuration could not work?