fix(esptool): fix linking error

This commit is contained in:
Dong Heng
2018-04-08 17:07:31 +08:00
parent 93a6ce37e5
commit ef0ba30297
2 changed files with 34 additions and 10 deletions

View File

@ -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

View File

@ -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.