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

User avatar
By magicsmoke
#6107 Hi,

I finished setting up my toolchain on Ubuntu following https://github.com/esp8266/esp8266-wiki/wiki/Toolchain. I compiled the blinky example successfully. Then I grounded GPIO0 following https://github.com/esp8266/esp8266-wiki/wiki/Uploading, reset the ESP8266, and ran
Code: Select allmake ESPPORT=/dev/ttyUSB0 flash
like the instructions say. This called esptool.py which is where the trouble started. esptool.py has been very shaky and unstable for me. It crashes with various errors, gets stuck at some random percentage midway through a flash, or just doesn't connect at all. After trying about 50 times I got it to write successfully all the way 4 or 5 times however only once GPIO2 actually started blinking after it finished flashing and flashing other things has also been spotty.

Is my setup wrong, is esptool.py still not stable enough, or is something likely wrong with my board? I've dabbled with other programs to flash the chip with little success.

Any ideas?
User avatar
By magicsmoke
#6119 Maybe more helpful is that once I manage to successfully flash my board with some AT firmware it continually resets every couple seconds printing to the serial port
Code: Select all ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 24236, room 16
tail 12
chksum 0xb7
ho 0 tail 12 room 4
load 0x3ffe8000, len 3008, room 12
tail 4
chksum 0x2c
load 0x3ffe8bc0, len 4816, room 4
tail 12
chksum 0x46
csum 0x46

ready
User avatar
By kenn
#6139 esptool.py has been rock-solid for me.

When i first tried to upload to an ESP8266, I had problems similar to yours and the flashes wouldn't complete. I was also getting bogus characters occasionally in the serial output from the ESP8266.The problem turned out to be in my serial connection to my PC - my serial path consisted of a USB to RS-232 adaptor, then a handmade RS232 to TTL adaptor using a MAX232. It turns out I had omitted one connection on the homemade adaptor which caused a poorly-shaped serial output from the ESP8266; once I fixed that I had no more problems.

So, I'm fairly certain you have some problems with your serial chain. An oscilloscope will help you spot problems in the datastream.