ESP32 uploading code but getting strange error

I have ESP32 WROOM-32D bare module on a breaout board. I'm programming it using USB to TTL adapter. I have connected I2C lcd to ESP32 with external 5V and grounded both modules properly. I can successfully upload the code to ESP32 WROOM-32D but ESP32 cannot read LCD I2C device and initially give some strange error as below

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0

That looks like a fairly normal ESP32 power-on message. At what point exactly do you get this? Immediately after uploading, or does it happen some time after it?

It would help if you could show the schematic of your circuit, a clear photograph that shows how everything is connected and the code you're trying to run.

There are onboard 2 buttons for reset and IO.

#include <Wire.h>
 
void setup() {
  Wire.begin();
  Serial.begin(115200);
  Serial.println("\nI2C Scanner");
}
 
void loop() {
  byte error, address;
  int nDevices;
  Serial.println("Scanning...");
  nDevices = 0;
  for(address = 1; address < 127; address++ ) {
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address<16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
      nDevices++;
    }
    else if (error==4) {
      Serial.print("Unknow error at address 0x");
      if (address<16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  }
  else {
    Serial.println("done\n");
  }
  delay(5000);          
}

I can't quite see how they are wired in your circuit diagram.

I assume you've taken note of the required state of some of the IO's on the ESP32 for it to boot successfully. This is addressed in the ESP32's datasheet.

Have you tried outputting some simple Serial.println's to see if they succeed?

Yes, just tested! I can get serial print output!

OK, have you considered the possibility that your setup works and there's not really a problem, per se?

Keep in mind that the ESP32 gives a startup message upon power-on and also after a reset. This is normal behavior.

Okay, I'll take it but It's not detecting I2c devices! I tried i2c scanner and it says no devices found! that's completly weird! I tried 4.7k pull up resistor from sda & scl to 3.3v but still it does not detect my module! So strange!! Bare ESP8266 also do detect i2c devices controller behaving very odd to me!

Probably because you swapped SCL and SDA. Not to worry, you can use whatever IO's for I2C you want on ESP32. You can pass the pins you want to Wire.begin.

Above schematic was made in hurry when you asked! I tried with jumper wire by making sure sda goes to sda and scl goes to scl but still it has problems in detecting it! Its not detecting at all! did it fry I2C lines?

Unlikely, but you can test this by hooking up e.g. a LED and appropriate series resistor (e.g. a red LED and a 1k resistor) to either of these IO's and using digitalWrite to see if they still work. If you can successfully digitalWrite to both pins, you can assume they will work for I2C as well.

I gave it a shot and led blinks on both gpios.

Just to be clear, have you tried like this ?
lcd

from here https://lastminuteengineers.com/esp32-i2c-lcd-tutorial/

Good, this implies your GPIOs are OK.
Have you tried explicitly passing the pins to Wire.begin? Just to be sure.

Also, is it possible to see a photo of the circuit as built?

Yes, indeed!

I removed all wires now from breakout board! For now I have bought a new esp32 dev kit as work was urgent to me! I2c lcd working good with esp32 dev kit but not with esp32 breakout module.

I will give try to Wire.begin. I dont think it'll do magic but lets see!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.