ESP8266 error: espcomm_upload_mem failed

I’m using a Sparkfun 8266 Thing Dev board and I know “error: espcomm_upload_mem failed” is a common esp8266 problem. I have looked around a fair amount, but am having no luck. I have tried replugging the usb, toggling on/off switch, and rebooting the computer, but am unable to get code to upload to the board. Here is one sketch I’m trying.

More troubleshooting ideas are appreciated.

/*This program will check that I can connect to my
   specified Wifi Network using an ESP8266

//Include the ESP8266 WiFi library.
#include <ESP8266WiFi.h>

//Local Network Settings.
char ssid[] = "ssid";  // your network SSID (name)
char pass[] = "password"; // your network password

void setup() {

  //Set the baud rate for Serial Communication

  //Send some basic info to the Serial Monitor
  Serial.print("Connecting to ");

  //Connect to an Access Point.
  WiFi.begin(ssid, pass);

  //Now we wait for the connetion to be established.
  while (WiFi.status() != WL_CONNECTED)

  // Print the SSID that you are connected with.
  Serial.print("SSID: ");
  Serial.println("You are way cool.");


void loop() {


Make sure you have selected the port of your Arduino board from the Tools > Port menu. You can find it like this:

  • Unplug your Arduino board from the computer.
  • Tools > Port
  • Note the ports, if any, listed in the menu.
  • Close the Tools menu
  • Plug your Arduino board into the computer.
  • Tools > Port - The new port listed in the menu is your Arduino board.

Also make sure you have selected the type of ESP8266 that you are using (or a similar one) from the Tools > Board menu.


Thanks for the replies! I have checked the port and the board and they both seem to be okay. Still getting the same error.