I've spent a while figuring out how to rebuild and flash the firmware on Ubuntu 14.04 using the esp-open-sdk toolchain.
I've got it to work but the method is a bit involved and doesn't seem to be documented anywhere very obvious. Does anyone know
if there is a better way, or if it would be good to patch the relevant scripts (e.g. app/gen_misc.sh) and do a pull request? Some detail
of the method below; I've also raised this issue: https://github.com/nodemcu/nodemcu-firmware/issues/86
First I install the toolchain from https://github.com/pfalcon/esp-open-sdk (I used the instructions from
http://nathan.chantrell.net/20141230/wi ... e-esp8266/).
Then I clone nodemcu-firmware, cd there and "make". After the initial "make" I do
cd app; gen_misc.sh
This creates some .bin files, but the gen_misc.sh call invokes gen_appbin.py,
which then calls genflashbinv6 -- which isn't available except as a binary for
Windows.
So we get part way there, but not all the .bin files are generated. So then I
use the method from https://github.com/esp8266/esp8266-wiki/wiki/Building to
finish off:
cd .output/eagle/debug/image
esptool-ck/esptool -eo eagle.app.v6.out -bo eagle.app.v6.flash.bin -bs .text -bs .data -bs .rodata -bc -ec
xtensa-lx106-elf-objcopy --only-section .irom0.text -O binary eagle.app.v6.out eagle.app.v6.irom0text.bin
cp eagle.app.v6.flash.bin ../../../../../bin/
cp eagle.app.v6.irom0text.bin ../../../../../bin/
And this gives me the full set of files that I can then flash to the chip like this:
esptool.py --port /dev/ttyAMA0 write_flash 0x00000 eagle.app.v6.flash.bin 0x10000 eagle.app.v6.irom0text.bin 0x7c000 esp_init_data_default.bin 0x7e000 blank.bin
This works (though it was quite hard to figure out!).
So perhaps gen_appbin.py should just omit the genflashbinv6 call on linux, and
gen_misc.sh do the above instead? Or perhaps there's a better way to take the
results of the initial build and make them flashable?
Cheers,
Hamish
https://hamish.gate.ac.uk/