I am attempting to flash an ESP8266EX that is built into an Arduino Mega board. I have 2 boards, both from factory I connect with a serial terminal (at 74880 baud chip default rate) and get the error message:

ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 

tail 8

chksum 0x2d

csum 0x2d



I understand the firmware on the chip from factory should allow me to connect at 115200 and communicate using AT commands.

I have successfully flashed the firmware onto one of the boards using the Arduino IDE and the code below to create a wifi network that I can connect to with my phone, so I know at least one of the boards works, (just not with factory firmware?)

//  Set the DIP switches on the actual board to 1=OFF 2=OFF 3=OFF 4=OFF 5=ON 6=ON 7=ON 8=OFF 
//(USBESP8266 (Update firmware or sketch))

//Under Tools select Board then select the Generic esp8266 Module

//Paste the following sketch into the IDE, save and upload

// Create a WiFi access point and provide a web server on it. 

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>

/* Set these to your desired credentials. */
const char *ssid = "Mega";
const char *password = "12345678";

ESP8266WebServer server(80);

/* Just a little test message. Go to the IP address you setup below in a web browser
connected to this access point to see it.
void handleRoot() {
server.send(200, "text/html", "Hey Dirtbug");
void setup() {
Serial.print("Configuring access point…");

IPAddress local_IP(192,168,0,20);

IPAddress gateway(192,168,0,1);

IPAddress subnet(255,255,255,0);

Serial.print("Setting soft-AP configuration … ");

Serial.println(WiFi.softAPConfig(local_IP, gateway, subnet) ? "Ready" : "Failed!");

Serial.print("Setting soft-AP … ");

Serial.println(WiFi.softAP("ESPsoftAP_01") ? "Ready" : "Failed!");

Serial.print("Soft-AP IP address = ");


/* You can remove the password parameter if you want the AP to be open. */

WiFi.softAP(ssid, password);

// IPAddress myIP = WiFi.softAPIP();

Serial.print("AP IP address: ");


server.on("/", handleRoot);


Serial.println("HTTP server started");


void loop() 



This code works fine. get data in the serial monitor and displays it no issues.

I have tried to flash it with "ESP_8266_NONOS_SDK"(v2.2.1 and v3.0.4) and "ESP8266-IDF-ATV2.2.1.0" using esptools in python, or flashing programs "flash_download_tool_v3.8.8" and "nodemcu-flasher-master" I am always getting these errors or variations of. I am using the following settings as they work in the arduino code:

flash settings in arduino IDE

I have used these settings when configuring the flashing tools, and .bin addresses as shown in this table here from the manufacturer (4096 512+512 for the 32Mb flash):

.bin addresses for flashing

But I'm still getting very similar error codes to above through serial monitor.

Ideally I want to use AT commands through the inbuilt serial between the Mega and ESP8266 to send and receive small packets of information in an SQL database.

Where can I start to try get this thing to work? Is there any Arduino sketch that will give me AT commands? Is there any particular settings I can try tweak to get the firmware to flash properly?

Thanks for your time. I really appreciate any help that can be offered!


1 Answer 1


I have finally got AT commands to work using the following settings and addresses! enter image description here

Havn't tested much functionality yet but so far so good!


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.