Make blankflash target automatically calculate pos to write to

pull/30/head
Jeroen Domburg 9 years ago
parent ae2edfdd6c
commit 1f51e6035b
  1. 4
      Makefile.combined
  2. 5
      Makefile.separate

@ -10,6 +10,8 @@ TARGET_OUT := $(addprefix $(BUILD_BASE)/,$(TARGET).out)
.PHONY: ldscript_memspecific.ld
BLANKPOS="$$(printf "0x%X" $$(($(ESP_SPI_FLASH_SIZE_K)*1024-0x2000)))"
INITDATAPOS="$$(printf "0x%X" $$(($(ESP_SPI_FLASH_SIZE_K)*1024-0x4000)))"
ldscript_memspecific.ld:
$(vecho) "GEN $@"
@ -30,5 +32,5 @@ flash: $(TARGET_OUT) $(FW_BASE)
$(Q) $(ESPTOOL) $(ESPTOOL_OPTS) write_flash $(ESPTOOL_FLASHDEF) 0x00000 $(FW_BASE)/0x00000.bin 0x40000 $(FW_BASE)/0x40000.bin
blankflash:
$(Q) $(ESPTOOL) $(ESPTOOL_OPTS) write_flash $(ESPTOOL_FLASHDEF) 0x7E000 $(SDK_BASE)/bin/blank.bin 0x7F000 $(SDK_BASE)/bin/esp_init_data_default.bin
$(Q) $(ESPTOOL) $(ESPTOOL_OPTS) write_flash $(ESPTOOL_FLASHDEF) $(BLANKPOS) $(SDK_BASE)/bin/blank.bin $(INITDATAPOS) $(SDK_BASE)/bin/esp_init_data_default.bin

@ -10,6 +10,9 @@ TARGET_OUT := $(addprefix $(BUILD_BASE)/,$(TARGET).out)
.PHONY: ldscript_memspecific.ld
BLANKPOS="$$(printf "0x%X" $$(($(ESP_SPI_FLASH_SIZE_K)*1024-0x2000)))"
INITDATAPOS="$$(printf "0x%X" $$(($(ESP_SPI_FLASH_SIZE_K)*1024-0x4000)))"
ldscript_memspecific.ld:
$(vecho) "GEN $@"
$(Q) echo "MEMORY { irom0_0_seg : org = 0x40240000, len = "$$(printf "0x%X" $$(($(ESP_SPI_FLASH_SIZE)-0x4000)))" }"> ldscript_memspecific.ld
@ -27,7 +30,7 @@ flash: $(TARGET_OUT) $(FW_BASE)
$(Q) $(ESPTOOL) $(ESPTOOL_OPTS) write_flash $(ESPTOOL_FLASHDEF) 0x00000 $(FW_BASE)/0x00000.bin 0x40000 $(FW_BASE)/0x40000.bin
blankflash:
$(Q) $(ESPTOOL) $(ESPTOOL_OPTS) write_flash $(ESPTOOL_FLASHDEF) 0x7E000 $(SDK_BASE)/bin/blank.bin 0x7C000 $(SDK_BASE)/bin/esp_init_data_default.bin
$(Q) $(ESPTOOL) $(ESPTOOL_OPTS) write_flash $(ESPTOOL_FLASHDEF) $(BLANKPOS) $(SDK_BASE)/bin/blank.bin $(INITDATAPOS) $(SDK_BASE)/bin/esp_init_data_default.bin
htmlflash: libesphttpd
$(Q) if [ $$(stat -c '%s' libesphttpd/webpages.espfs) -gt $$(( $(ESPFS_SIZE) )) ]; then echo "webpages.espfs too big!"; false; fi

Loading…
Cancel
Save