Working on an ESP32 environmental monitor prototype reading temperature, pressure, and humidity via a BME280 sensor on I2C bus 0.

During startup, the master bus initialisation succeeds, but probing the sensor address (0x76) immediately hangs and throws a timeout error:

E (1392) i2c: i2c_master_cmd_begin(1435): I2C transaction timeout E (1394) bme280: Failed to read chip ID register 0xD0 (ESP_ERR_TIMEOUT) 

Here is the full VS Code workspace screenshot showing the I2C read implementation alongside the serial monitor crash log:

ESP32 I2C Transaction Timeout in VS Code

Setup details:

  • Board: ESP32-WROOM-32D Development Board
  • IDE: Visual Studio Code with PlatformIO (ESP-IDF framework)
  • Pins: SDA configured on GPIO 21, SCL on GPIO 22
  • Pull-ups: Internal pull-ups enabled via gpio_set_pull_mode()
  • Clock: Standard 100 kHz bus frequency

Has anyone observed intermittent ESP_ERR_TIMEOUT on ESP-IDF when using internal pull-ups alone versus adding dedicated 4.7kΩ external resistors on SDA/SCL lines? Looking to hear hardware experiences before revising the PCB layout.