How to perform complete firmware upload of AT v.20 on ESP8266-12E

rwkiii
Posts: 4
Joined: Thu Mar 10, 2016 11:11 am

How to perform complete firmware upload of AT v.20 on ESP8266-12E

Postby rwkiii » Thu Mar 10, 2016 11:47 am

I have a NodeMCU DevKit v1.0 development board. It has an ESP8266-12E on it and was previously running NodeMCU firmware. I wanted to try some libraries that require AT commands (v.20) so I have been trying to get the AT firmware installed.

I am trying to install the Espressif firmware located at https://github.com/espressif/ESP8266_AT/tree/master/bin - there are instructions at the bottom of that page, but this didn't work. The firmware uploaded succeeded, but I had a repeating exception error when viewing in a serial console.

Are the addresses listed on the above page valid for an ESP8266-12E on a NodeMCU DevKit v1.0 breakout board?

I have had the best luck using ESP FLASH DOWNLOAD TOOL V2.3. There are several other settings used on that tool:

CrystalFreq: 26M
SPI SPEED: 80MHz (also tried 40MHz)
SPI MODE: DIO (also tried QIO)
FLASH SIZE: 32Mbit (also tried 32Mbit-C1)

At this point I'm not able to get stable firmware installed back onto this module - neither Espressif (above link) or NodeMCU. It will upload and I can view the module output in a serial console after pushing reset. Half of the time I get the following output:

Code: Select all

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

load 0x40100000, len 1456, room 16
tail 0
chksum 0xa2
load 0x3ffe8000, len 776, room 8
tail 0
chksum 0xc3
load 0x3ffe8310, len 552, room 8
tail 0
chksum 0xb8
csum 0xb8

2nd boot version : 1.5
  SPI Speed      : 80MHz
  SPI Mode       : DIO
  SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
jump to run user2 @ 101000

error magic!
backup boot failed.

user code done


The other half of the time (pushing reset button) I will see exceptions scrolling nonstop:

Code: Select all

Fatal exception (0):
epc1=0x40100000, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000


Would someone please point me to the proper procedure (settings) required to get this 12E properly flashed again?

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: How to perform complete firmware upload of AT v.20 on ESP8266-12E

Postby ESP_Faye » Fri Mar 11, 2016 11:13 am

Hi,

Would you like to have a try with our latest AT firmware ? http://bbs.espressif.com/viewtopic.php?f=46&p=5964#p5964

To use the latest AT firmware, your flash needs to be 8Mbit or larger.

rwkiii
Posts: 4
Joined: Thu Mar 10, 2016 11:11 am

Re: How to perform complete firmware upload of AT v.20 on ESP8266-12E

Postby rwkiii » Sat Mar 12, 2016 1:46 am

Hi.

I am one who would like to keep up with the latest firmware because I know you're working out a lot of issues... but my objective is to use ESP12E on my WiFi clients around my home. I have a Raspberry Pi 2 setup as a WiFi AP with DHCP, DNS, NTPD, and an MQTT broker.

The ESP8266 WiFi libraries would 'seem' to be buggy, but I am finding that they are all dependent on a specific AT command set version. For example, about the best code I've found for publishing and subscribing MQTT on clients is the PubSubClient.h library - (https://github.com/knolleary/pubsubclient). I have read that this library relies on AT v0.20 command set and attempted to upload the firmware they linked to (https://github.com/espressif/ESP8266_AT), but now I have a very unstable 12E that will not respond to any AT command at any baud rate, nor can I get it flashed back to any firmware of any version and after pressing reset a few times will go into neverending loops of Exception(0).

It is the addresses that confused me - the way addresses and sizes are referred to doesn't make sense to me and so I have

The device I am trying to get working again is a NodeMCU DevKit v1.0 development board. I have had the best luck uploading firmware with the ESP FLASH DOWNLOAD TOOL v2.3.

After uploading the firmware, I can load a serial console (Ie: Esplorer) and press reset on the NodeMCU dev board. I see:

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

load 0x40100000, len 1456, room 16
tail 0
chksum 0xa2
load 0x3ffe8000, len 776, room 8
tail 0
chksum 0xc3
load 0x3ffe8310, len 552, room 8
tail 0
chksum 0xb8
csum 0xb8

2nd boot version : 1.5
SPI Speed : 80MHz
SPI Mode : DIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user2 @ 81000

error magic!
backup boot failed.

user code done

I have tried just about every combination possible - methodically even. Of course, the above results vary.

First, is there a way of getting a link to a stable AT firmware download and a full list of settings required on the ESP FLASH DOWNLOAD TOOL v2.3 window? I read where people refer to 1024 - use 4Mbit and that would be the 32MBit option... :S I am sure this makes perfect sense to some who know much more than I, but this is very confusing talk...

I don't know when to use 0x01000 instead of 0x40000 and when to use 0x7C000/0x7E000 instead of 0xFC000/0xFE000. I haven't determined yet if these settings are dependent on the hardware, the compiled firmware - or if these are settings I actually have some flexibility with.

Would you know how to get this NodeMCU DevKit v1.0 development board back to operational?

Thank you. I appreciate your help.

rwkiii
Posts: 4
Joined: Thu Mar 10, 2016 11:11 am

Re: How to perform complete firmware upload of AT v.20 on ESP8266-12E

Postby rwkiii » Sat Mar 12, 2016 2:06 am

@Espressif_Faye, I have used Esplorer to write Lua scripts using NodeMCU builds from http://nodemcu-build.com

NodeMCU works ok... I like some of its features, but I don't need it.

I also use the Arduino IDE (for now) to upload sketches to Arduinos and ESP8266.

I am good with using the latest firmware - but do you know of any Arduino IDE WiFi libraries that are compatible with the latest Espessif firmware? I need a library that has methods to connect, disconnect, check connection status, publish/subscribe to the local MQTT broker, etc. I am not up to the task of creating these libraries.

So, my frustration is not being able to install ANY firmware that runs/runs stable. Can't get back to square-one. I prefer to run the latest Espressif firmware. I think I am going to prefer AT commands. But, I also need the Arduino libraries that would support Espressif's latest - if they exist? Otherwise I would be stuck again. :S

rwkiii
Posts: 4
Joined: Thu Mar 10, 2016 11:11 am

Re: How to perform complete firmware upload of AT v.20 on ESP8266-12E

Postby rwkiii » Sat Mar 12, 2016 1:15 pm

@Expressif_Faye,

Per your lead I downloaded the latest firmware at the link you provided (v1.5.2).

Per ./esp_iot_sdk_v1.5.2/bin/at/readme.txt I set ESP FLASH DOWNLOAD TOOL V2.3 to this configuration:

Flash size 32Mbit: 512KB+512KB
boot_v1.2+.bin 0x00000
user1.1024.new.2.bin 0x01000
esp_init_data_default.bin 0x3fc000 (optional)
blank.bin 0x7e000 & 0x3fe000

Code: Select all

0x00000   \esp_iot_sdk_v1.5.2\bin\boot_v1.5.bin
0x01000   \esp_iot_sdk_v1.5.2\bin\at\512+512\user1.1024.new.2.bin
0x3FC000 \esp_iot_sdk_v1.5.2\bin\esp_init_data_default.bin
0x7E000   \esp_iot_sdk_v1.5.2\bin\blank.bin
0x3FE000 \esp_iot_sdk_v1.5.2\bin\blank.bin


Code: Select all

CrystalFreq: 26M
SPI SPEED: 80MHz
SPI MODE: DIO
FLASH SIZE: 32MBit


Code: Select all

DETECTED INFO:
flash vendor:
E0h : N/A
flash devID:
4016h
QUAD;32Mbit
crystal:
26 Mhz


The firmware upload completes successfully. The only baud rate that displays legible output is 74480. From a serial console I press reset and the following is output:

Code: Select all

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

load 0x40100000, len 1856, room 16
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8
tail 0
chksum 0x79
csum 0x79

2nd boot version : 1.5
  SPI Speed      : 80MHz
  SPI Mode       : DIO
  SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000

êq«Ð×*ÕnEêý¨Ín=á


I am unable to see 'ready' or 'OK' from any AT command at any baudrate, even though I see no errors above.

Keep in mind, this is a NodeMCU DevKit v1.0 development board with a 12E onboard. I have read that this board is 80MHz and that the communication between the board chip and 12E is only DIO even though the 12E is QIO. I don't know if this is accurate information. Even Expressif's documentation for the latest version (you link) first says to load user1.bin at 0x10000 and then in another doc it says 0x01000.

From what I have shown you, can you see why AT commands are not working?

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: How to perform complete firmware upload of AT v.20 on ESP8266-12E

Postby ESP_Faye » Tue Mar 15, 2016 9:59 am

Hi,

Using AT firmware, the baud rate is 115200. And AT commands end up with a new line(\r\n, CR LF).

Input "AT" and a new line through UART, you will get an "OK" as response.

Who is online

Users browsing this forum: No registered users and 2 guests