From ef0ba30297d57be25b8cbfc2604125b10118cd52 Mon Sep 17 00:00:00 2001 From: Dong Heng Date: Sun, 8 Apr 2018 17:07:31 +0800 Subject: [PATCH] fix(esptool): fix linking error --- components/esp8266/Makefile.projbuild | 10 -------- components/esp8266/component.mk | 34 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/components/esp8266/Makefile.projbuild b/components/esp8266/Makefile.projbuild index 2d313543..9fafe867 100644 --- a/components/esp8266/Makefile.projbuild +++ b/components/esp8266/Makefile.projbuild @@ -2,7 +2,6 @@ BOOTLOADER_FIRMWARE_DIR := $(abspath $(COMPONENT_PATH))/firmware #configurate downloading parameters -BIN_APP_NUM ?= ESPTOOLPY_APP_NUM ESPTOOLPY_FLASHSIZE ?= $(CONFIG_ESPTOOLPY_FLASHSIZE) ESPTOOLPY_FLASHMODE ?= $(CONFIG_ESPTOOLPY_FLASHMODE) ESPTOOLPY_FLASHFREQ ?= $(CONFIG_ESPTOOLPY_FLASHFREQ) @@ -11,59 +10,50 @@ ifeq ($(ESPTOOLPY_FLASHSIZE), "512KB") BLANK_BIN_OFFSET1 := 0x7B000 BLANK_BIN_OFFSET2 := 0x7E000 ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0x7C000 -ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.512.$(BIN_APP_NUM).ld ESP8266_SIZEMAP := 0 endif ifeq ($(ESPTOOLPY_FLASHSIZE), "1MB") BLANK_BIN_OFFSET1 := 0xFB000 BLANK_BIN_OFFSET2 := 0xFE000 ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0xFC000 -ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.1024.$(BIN_APP_NUM).ld ESP8266_SIZEMAP := 2 endif ifeq ($(ESPTOOLPY_FLASHSIZE), "2MB") BLANK_BIN_OFFSET1 := 0x1FB000 BLANK_BIN_OFFSET2 := 0x1FE000 ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0x1FC000 -ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.1024.$(BIN_APP_NUM).ld ESP8266_SIZEMAP := 3 endif ifeq ($(ESPTOOLPY_FLASHSIZE), "2MB-c1") BLANK_BIN_OFFSET1 := 0x1FB000 BLANK_BIN_OFFSET2 := 0x1FE000 ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0x1FC000 -ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.2048.ld ESP8266_SIZEMAP := 5 endif ifeq ($(ESPTOOLPY_FLASHSIZE), "4MB") BLANK_BIN_OFFSET1 := 0x3FB000 BLANK_BIN_OFFSET2 := 0x3FE000 ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0x3FC000 -ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.1024.$(BIN_APP_NUM).ld ESP8266_SIZEMAP := 4 endif ifeq ($(ESPTOOLPY_FLASHSIZE), "4MB-c1") BLANK_BIN_OFFSET1 := 0x3FB000 BLANK_BIN_OFFSET2 := 0x3FE000 ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0x3FC000 -ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.2048.ld ESP8266_SIZEMAP := 6 endif ifeq ($(ESPTOOLPY_FLASHSIZE), "8MB") BLANK_BIN_OFFSET1 := 0x7FB000 BLANK_BIN_OFFSET2 := 0x7FE000 ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0x7FC000 -ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.2048.ld ESP8266_SIZEMAP := 8 endif ifeq ($(ESPTOOLPY_FLASHSIZE), "16MB") BLANK_BIN_OFFSET1 := 0xFFB000 BLANK_BIN_OFFSET2 := 0xFFE000 ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0xFFC000 -ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.2048.ld ESP8266_SIZEMAP := 9 endif -export ESP8266_LINKER_SCRIPTS BOOTLOADER_BIN_OFFSET := 0 APP_OFFSET := 0x1000 diff --git a/components/esp8266/component.mk b/components/esp8266/component.mk index 980ccfe8..fe067684 100644 --- a/components/esp8266/component.mk +++ b/components/esp8266/component.mk @@ -9,6 +9,40 @@ LIBS += airkiss cirom crypto espnow gcc hal core minic mirom net80211 \ phy pp pwm smartconfig ssc wpa wps endif +ESPTOOLPY_FLASHSIZE ?= $(CONFIG_ESPTOOLPY_FLASHSIZE) + +ifeq ($(CONFIG_ESPTOOLPY_APP_NUM),"app1") +BIN_APP_NUM := app1 +endif +ifeq ($(CONFIG_ESPTOOLPY_APP_NUM),"app2") +BIN_APP_NUM := app2 +endif + +ifeq ($(ESPTOOLPY_FLASHSIZE), "512KB") +ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.512.$(BIN_APP_NUM).ld +endif +ifeq ($(ESPTOOLPY_FLASHSIZE), "1MB") +ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.1024.$(BIN_APP_NUM).ld +endif +ifeq ($(ESPTOOLPY_FLASHSIZE), "2MB") +ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.1024.$(BIN_APP_NUM).ld +endif +ifeq ($(ESPTOOLPY_FLASHSIZE), "2MB-c1") +ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.2048.ld +endif +ifeq ($(ESPTOOLPY_FLASHSIZE), "4MB") +ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.1024.$(BIN_APP_NUM).ld +endif +ifeq ($(ESPTOOLPY_FLASHSIZE), "4MB-c1") +ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.2048.ld +endif +ifeq ($(ESPTOOLPY_FLASHSIZE), "8MB") +ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.2048.ld +endif +ifeq ($(ESPTOOLPY_FLASHSIZE), "16MB") +ESP8266_LINKER_SCRIPTS := eagle.app.v6.new.2048.ld +endif + #Linker scripts used to link the final application. #Warning: These linker scripts are only used when the normal app is compiled; the bootloader #specifies its own scripts.