Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By lupu
#24317 Hello,

what bootloader should we use "boot_v1.2.bin" or "boot_v1.4(b1).bin" ?

also what is the size limitation (user1/2.bin) for esp-01 (4mbit/512kB);
(would like a confirmation that what "2A-ESP8266__IOT_SDK_User_Manual__EN_v1.1.0.pdf" says is correct: 236kb per app.bin )

- my app has 200k (with sdk 1.1.1)

Upgrade Log with boot_v1.4(b1).bin:
Code: Select allsystem_upgrade_start
upgrade_connect
[OTA]Upgrading...
done fw check
upgrade_connect_cb
GET /Firmware/esp8266/user1.512.new.0.bin HTTP/1.1
Host: $IP:80
Connection: close

sumlength = 198640

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

wdt reset
load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0

2nd boot version : 1.4(b1)
  SPI Speed      : 40MHz
  SPI Mode       : QIO
  SPI Flash Size & Map: 4Mbit(256KB+256KB)
jump to run user1 @ 1000

error magic!
backup boot failed.

user code done
User avatar
By jhuebner
#73337 Thanks to the info provided here I was able to adapt this.
I'm using the Olimex MOD-WIFI which has GPIO0 on solder bridges. Since I want to flash 50 units soon I am looking for a way to use the stock AT firmware to flash my own application. My host system is linux.

Here is what I did:
1. Set up a hotspot on linux, make sure it uses /etc/hosts
2. Add 10.42.0.1 iot.espressif.cn to /etc/hosts (default IP address of linux Mint hotspot)
3. Apache with php must be installed, index.php below, user1.bin, user2.bin goes to /var/www/html/v1/device/rom
4. Now run following AT commands
AT+CWMODE_DEF=3
AT+CWSAP_DEF="apssid","appwd",5,4 //optional
AT+CWJAP_DEF="mint hotspot","pwd"
AT+CIPDNS_CUR=1,"10.42.0.1"
AT+CIUPDATE

Done, no change of GPIO0 needed :)
Generating userX.bin from arduino code was a 10 hour fight, I ended up doing to build runs modifying ld-script in between and then modifying gen_misc.sh to work with the current sdk
The actual firmware doesn't contain wifi credentials, it uses those supplied by the AT commands.