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

User avatar
By mamalala
#715 Hello everyone,

i have created a mich simpler Makefile to compile the example from the SDK. This one is prepared for the AT firmware. Shouldn't be too hard to figure out what to modify to use it for the IoT firmware as well. Small README included.

NOTE: Updated Makefiles are at http://www.esp8266.com/viewtopic.php?f=9&t=142&start=20#p772

And here is a tool that will create the proper firmware files from the compiled object file. The original SDK uses that gen_misc.bat thing, which is just silly. That thing calls objcopy and objdump repeatedly, the starts a python script which in turn starts an exe file to create the files. My tool will do all that in one quick go. The above Makefile makes use of this tool already. A precompiles .EXE for Windows is included, as well as a README and the full sources (it's licensed under the GPL v2).

NOTE: There was a bug in the esptool i posted. It is fixed, and can now be found at http://www.esp8266.com/viewtopic.php?f=9&t=142&start=20#p772

Have fun,

Chris
Last edited by mamalala on Fri Sep 19, 2014 5:57 pm, edited 4 times in total.
User avatar
By mamalala
#716 What i forgot to mention:

The Makefile is very simple. I have not added any dependency stuff yet. This means that after each change to a source/include file, you have to do a "make clean" first, and then do a "make". Dunno when i come around to add that.

Feel free to add it yourself if you need it, and please upload the modified Makefile here then.

Greetings,

Chris
User avatar
By tinhead
#721 .. and it dos work very well !
User avatar
By mamalala
#725 Hi all,

seems i made a whoopsie in the tool. For some reason i did the padding for the firmware file with a 32-byte padsize, whereas it should be 16 bytes. That obviously resulted in a wrong checksum field under sertain conditions. Using the tool on the AT firmware was OK, since the actual padding there would coincide with a 32 byte one, whereas the IoT demo was not so lucky. Ah well, crap can happen after a 20+ hour coding marathon ;)

Attached is a ZIP with the corrected version. Hopefully this will solve the problem for the IoT demo.

NOTE: New version is at http://www.esp8266.com/viewtopic.php?f=9&t=142&start=20#p772
Greetings,

Chris
Last edited by mamalala on Fri Sep 19, 2014 5:58 pm, edited 2 times in total.