-1

I have designed and manufactured a custom PCB, with an ESP32 chip on it. I use my FTDI cable to upload my firmware. I have no problem to flash my firmware, and it runs with no problem. So far so good. But then, any successive attempts to flash again is a dead end as it results into a timeout (of course I still press the boot button on my PCB).

If I take a new PCB, the first flash is OK but I cannot do it again.

Note: to make thing as simple as possible, I simply use the Arduino IDE and my do-nothing code as my firmware replacement:


void setup() {
  Serial.begin(115200);
  //Serial.setDebugOutput(true);
  Serial.println("Yo from SDL!");
}

// the loop function runs over and over again forever
int _loop = 1;

void loop() {
  Serial.print("Loop #");
  Serial.println(_loop++);  
  Serial.println();
  delay(3000); 
}

[UPDATED] Here is the schematic regarding the ESP32 and the GPIO0, GPIO2:

The schematic of the PCB regarding the boot loader

Do you have any clue?!

5
  • Have you properly wired in the GPIOs that trigger the bootloader mode?
    – Majenko
    Jan 3, 2022 at 23:44
  • @Majenko I did wired the boot loader pin and added a button to turn the chip to boot loading mode. To make it clear, I successfully download the firmware in the chip the first time. But after that I cannot update. Jan 4, 2022 at 0:03
  • A "blank" chip will be in bootloader mode by default IIRC. Can you share your schematic and board design?
    – Majenko
    Jan 4, 2022 at 0:06
  • @Makenlo Oh, I see, I might have screwed up the boot loader schematics? let me share this part with you in a few moment Jan 4, 2022 at 0:11
  • @Majenko I have uploade the schematics of the PCB regarding the boot loader Jan 4, 2022 at 16:05

1 Answer 1

1

IO2 needs to be connected to a pulldown resistor (your buzzer FET has a pulldown on its input which does the job, which is fortunate). I would consider moving the buzzer elsewhere and keeping IO2 just for the pulldown resistor if possible.

IO0 needs a pullup resistor.

You need some way of resetting the ESP32 through pulling the EN pin low when you want to reprogram it.

Both IO0 and the EN pin are usually controlled through a combination of the DTR and RTS pins of the USB to UART adapter to do the resetting automatically. Without that you will have to manually hold IO0 LOW while briefly pulling EN low to reset the chip.

3
  • as per the doc the io0 as an internal pull-up: do we really needs to add an external one? (“Each strapping pin is connected to its internal pull-up/pull-down during the chip reset. Consequently, if a strapping pin is unconnected or the connected external circuit is high-impedance, the internal weak pull-up/pull-down will determine the default input level of the strapping pins.”) Jan 5, 2022 at 14:24
  • @StéphanedeLuca Interesting - that I did not know. Still, it's good to be explicit in these things I think to avoid uncertainty. But if the internal one works then that's fine. You still need to toggle EN though ;)
    – Majenko
    Jan 5, 2022 at 14:48
  • So IO0 was OK. But I screwed up the EN (it was attached to a pull up). And how @Majenko pointed out, EN must be briefly set to low. Thanks a lot 👍🏻 Jan 7, 2022 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.