Espcomm_upload_mem failed

ok, the problem of the library is solved, but now there’s another one error:

Sketch uses 235437 bytes (54%) of program storage space. Maximum is 434160 bytes.
Global variables use 34164 bytes (41%) of dynamic memory, leaving 47756 bytes for local variables. Maximum is 81920 bytes.
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

you know whats the issue?

thanks in advance.

This means that the ESP didn’t respond (or didn’t respond in the way that the Arduino IDE expected) when you tried to upload the code.

The first thing to try is hitting the upload button again. This will often fix the issue of everything else is okay. If that doesn’t work then try unplugging your ESP and re-connecting and trying again.

If that doesn’t work then check your Arduino IDE settings. Do you have the correct type of device selected, and the correct memory size selected for your type of device.

If you’re using an ESP-01, or a device like a Sonoff, then GPIO0 needs to be connected to Ground when powering-up the board to put it into flash mode. Failing to do this will result in the type of messages that you’re getting.


1 Like

Hi, i tryied all your tips, but it gives me the same error. I found also the datasheet of my esp (AI cloud inside), but nothing.

Aaaahg! the dreaded ESP-01 :cry:

You should do some careful reading about what you need to do to put these into flash mode, it’s quite fiddly.
Also, some of the cheap ESP-01 to USB programming adapters aren’t made correctly. They have a flash button that needs to be pressed when plugging-in the adapter, but the button isn’t wired correctly, so it doesn’t work.
Read this thread and it’s associated link

I’d save yourself a lot of hassle and buy a Wemos D1 Mini. Better still, order a pack of 10


1 Like

Such a trivial “thing” like the baudrate has been set correctly at both sides of the setup? (USB-Serial bridge <–> ESP-01)

@Rick7 is trying to use the ESP-01 as a stand-alone device, but he’s having a problem flashing it. Probably because it’s not in flash mode when he’s trying to upload the code.


I’ve already connected GPIO0 with GND to set the esp in flash-mode. Moreover, i use a ttl converter different from the CH34G, change something?

Are you connecting as follows:

TTL Converter . . . . ESP-01
Tx pin ---------------> RX pin
Rx pin ---------------> Tx pin
3.3v ------------------> Vcc pin + CH-PD pin
Gnd ------------------> Gnd pin + GPIO0 pin (temporarily - while applying power)


:man_facepalming: sorry… Not applicable, while flashing the device (and 9600 is a VERY LOW speed to flash - use 115200)… But the COM port… You choose the correct one? And no Serial monitor of any kind is blocking the access?? The Arduino serial monitor disconnects automatically, if I do remember, but others needs manual disconnection…
Other things to check as @PeteKnight has pointed. And the 3.3V… Use power adapter, not the 3.3V output from USB-Serial bridge (Well, I own one that has separate 3.3V 1A LDO, but it is not a common case)

ckecked everything, COM port, baudrate, serial monitor, connections…nothing different, same error.

Post some photos of your setup, and details of the Arduino IDE settings you’re using.


There are two possibilities…

  1. Board faulty
  2. Your fault.

I see no other option, as normally it just works… Check the board, if it works (responds to AT commands if it is still original firmware), the build-in LED behaviour, the bootloader serial output at 74880bps, …

in fact i was wrong. by mistake I connected the reset to VCC instead of CH… now seems it works. i’ll test it and i let you know.
you have been very helpful, thank you very much!

Which is exactly why I asked you to post photos :grinning:

Glad it’s working now.
Have you ordered your Wemos D1 Mini’s yet? Only USD 2.18 each with free shipping on AliExpress:


yes, 9600 baud


Not yet, but I thinking of buying it! Seems to be a really interesting board!
Thanks again

2 posts were split to a new topic: Problems Flashing ESP-01