Move entirely to mamalalas C-based esptool

pull/30/head
Jeroen Domburg 10 years ago
parent a8b0da04c5
commit 39eb85dc6b
  1. 19
      Makefile

@ -22,8 +22,11 @@ SDK_EXTRA_LIBS ?= /opt/Espressif/arch/lib
SDK_BASE ?= /opt/Espressif/ESP8266_SDK SDK_BASE ?= /opt/Espressif/ESP8266_SDK
#Esptool.py path and port #Esptool.py path and port
ESPTOOL ?= esptool.py ESPTOOL ?= esptool
ESPPORT ?= /dev/ttyUSB0 ESPPORT ?= /dev/ttyUSB0
#ESPDELAY indicates seconds to wait between flashing the two binary images
ESPDELAY ?= 3
ESPBAUD ?= 115200
# name for the target project # name for the target project
TARGET = httpd TARGET = httpd
@ -72,7 +75,6 @@ LD := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc
#### ####
#### no user configurable options below here #### no user configurable options below here
#### ####
FW_TOOL ?= /usr/bin/esptool
SRC_DIR := $(MODULES) SRC_DIR := $(MODULES)
BUILD_DIR := $(addprefix $(BUILD_BASE)/,$(MODULES)) BUILD_DIR := $(addprefix $(BUILD_BASE)/,$(MODULES))
@ -117,11 +119,11 @@ all: checkdirs $(TARGET_OUT) $(FW_FILE_1) $(FW_FILE_2)
$(FW_FILE_1): $(TARGET_OUT) firmware $(FW_FILE_1): $(TARGET_OUT) firmware
$(vecho) "FW $@" $(vecho) "FW $@"
$(Q) $(FW_TOOL) -eo $(TARGET_OUT) $(FW_FILE_1_ARGS) $(Q) $(ESPTOOL) -eo $(TARGET_OUT) $(FW_FILE_1_ARGS)
$(FW_FILE_2): $(TARGET_OUT) firmware $(FW_FILE_2): $(TARGET_OUT) firmware
$(vecho) "FW $@" $(vecho) "FW $@"
$(Q) $(FW_TOOL) -eo $(TARGET_OUT) $(FW_FILE_2_ARGS) $(Q) $(ESPTOOL) -eo $(TARGET_OUT) $(FW_FILE_2_ARGS)
$(TARGET_OUT): $(APP_AR) $(TARGET_OUT): $(APP_AR)
$(vecho) "LD $@" $(vecho) "LD $@"
@ -140,9 +142,10 @@ firmware:
$(Q) mkdir -p $@ $(Q) mkdir -p $@
flash: $(FW_FILE_1) $(FW_FILE_2) flash: $(FW_FILE_1) $(FW_FILE_2)
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin $(Q) $(ESPTOOL) -cp $(ESPPORT) -cb $(ESPBAUD) -ca 0x00000 -cf firmware/0x00000.bin -v
sleep 3 $(Q) [ $(ESPDELAY) -ne 0 ] && echo "Please put the ESP in bootloader mode..."
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x40000 firmware/0x40000.bin $(Q) sleep $(ESPDELAY)
$(Q) $(ESPTOOL) -cp $(ESPPORT) -cb $(ESPBAUD) -ca 0x40000 -cf firmware/0x40000.bin -v
webpages.espfs: html/ mkespfsimage/mkespfsimage webpages.espfs: html/ mkespfsimage/mkespfsimage
cd html; find | ../mkespfsimage/mkespfsimage > ../webpages.espfs; cd .. cd html; find | ../mkespfsimage/mkespfsimage > ../webpages.espfs; cd ..
@ -152,7 +155,7 @@ mkespfsimage/mkespfsimage: mkespfsimage/
htmlflash: webpages.espfs htmlflash: webpages.espfs
if [ $$(stat -c '%s' webpages.espfs) -gt $$(( 0x2E000 )) ]; then echo "webpages.espfs too big!"; false; fi if [ $$(stat -c '%s' webpages.espfs) -gt $$(( 0x2E000 )) ]; then echo "webpages.espfs too big!"; false; fi
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x12000 webpages.espfs $(ESPTOOL) -cp $(ESPPORT) -cb $(ESPBAUD) -ca 0x12000 -cf webpages.espfs -v
clean: clean:
$(Q) rm -f $(APP_AR) $(Q) rm -f $(APP_AR)

Loading…
Cancel
Save