git clone https://github.com/pfalcon/esp-open-sdk.git
cd esp-open-sdk
git submodule init
git submodule update
#edit crosstool-config-overrides to build static toolchain
CPPFLAGS= CFLAGS= CXXFLAGS= LDFLAGS= LD_LIBRARY_PATH= make
patch examples/blinky/Makefile < ../blinky_Makefile.patchblinky_Makefile.patch is:
--- Makefile.old 2017-02-01 22:03:52.089133574 +0000
+++ Makefile 2017-02-01 21:58:59.589922223 +0000
@@ -1,17 +1,17 @@
CC = xtensa-lx106-elf-gcc
CFLAGS = -I. -mlongcalls
-LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -Wl,--end-group -lgcc
+LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lc -lphy -Wl,--end-group -lgcc
LDFLAGS = -Teagle.app.v6.ld
-blinky-0x00000.bin: blinky
- esptool.py elf2image $^
+blinky.bin: blinky
+ esptool elf2image --version=2 -o $@ $^
blinky: blinky.o
blinky.o: blinky.c
-flash: blinky-0x00000.bin
- esptool.py write_flash 0 blinky-0x00000.bin 0x40000 blinky-0x40000.bin
+flash: blinky.bin
+ esptool write_flash 0 blinky.bin --verify
clean:
- rm -f blinky blinky.o blinky-0x00000.bin blinky-0x40000.bin
+ rm -f blinky blinky.o blinky.binHowever, anything that I compile with it results in the following error message being spammed until I reset the ESP:
Fatal exception (28):
epc1=0x4000228b, epc2=0x00000000, epc3=0x00000000, excvaddr=0x000000b5, depc=0x00000000After I reset the ESP, nothing useful is outputted.
I've tried to compile and flash both blinky, and the following file, but both result in the same error:
void user_init() {
}Precompiled binaries flash to the ESP without any problems. I've tried flashing three ESPs, but haven't been able to get any of them to work.
Any ideas?
Edit: Found the problem. It was to do with
esptool elf2image --version=2 -o $@ $^esptool elf2image $^