When doing some project or building your device using components esp8266 for network or Arduino’s for processing we have a core block that is connections and burning code to such device but when we get stuck in any of this step like a very common error of espcomm_upload_mem failed comes when burning code into device because of which it becomes very difficult to accomplish the task and since I have been totally through the issues like these I have decided to share some troubleshooting tips.

Fix error of espcomm_upload_mem failed when uploading code for ESP or Arduino of any kind. 
I have been using esp 01 module which is one of the best in this cheap range so while working with esp I have many time come across the upload mem failed error while uploading the code which at times get very irritating and guys same thing happens when working with Arduino or any other device of this category so I have come up with a solution that I wanted to share so that I may rescue you guys out there if you are also stuck with it.
Without being more say lets get started, I have esp 01 connected to my Arduino IDE through USB ttl and I m trying to upload a program which is and led blink program to my esp.
void setup() {
  // initialize digital pin LED_BUILTIN as an output.

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second

But it shows error that is upload mem failed after the sketch compilation it means our Arduino IDE is
unable to connect to our esp module so we can conclude that it is some connection issue over here.

esp-01 resolve upload mem failed

For resolving this we will remove the usb and we will disconnect the rst pin if it is connected and now connect it with the ground pin as shown in the figure.

esp8266-1 hard reset
So since we have attached the rst pin to ground pin as per the diagram it will flush the program already in it and this will reset the device. And if we will again run the program after detaching the rst from gnd pin don’t forget to connect your USB and click on UPLOAD button to upload the code. This will burn the code and you can check the running of the code as your led will start to blink so all this procedure will work well with Arduino also. For Arduino you will have to use the FLASH button and your work is done.

Categorized in: