mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-20 00:27:19 +08:00
feat(esp8266): Simplify ld files
IMPORTANT: 1. remove 256 + 256, 512 + 512 map ld files; 2. only support 2MB spi flash, and 1024 + 1024 map;
This commit is contained in:
@ -11,8 +11,6 @@ LIBS += airkiss crypto espnow gcc hal core 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
|
||||
@ -20,41 +18,17 @@ 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.
|
||||
LINKER_SCRIPTS += $(ESP8266_LINKER_SCRIPTS) eagle.app.v6.common.ld eagle.rom.addr.v6.ld
|
||||
LINKER_SCRIPTS += esp8266.common.ld esp8266.rom.ld
|
||||
|
||||
COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/lib \
|
||||
$(addprefix -l,$(LIBS)) \
|
||||
-L $(COMPONENT_PATH)/ld \
|
||||
-T esp8266_out.ld \
|
||||
-Wl,--no-check-sections \
|
||||
-u call_user_start \
|
||||
-u call_user_start \
|
||||
$(addprefix -T ,$(LINKER_SCRIPTS))
|
||||
|
||||
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
|
||||
@ -62,3 +36,14 @@ ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
|
||||
# final linking of project ELF depends on all binary libraries, and
|
||||
# all linker scripts
|
||||
COMPONENT_ADD_LINKER_DEPS := $(ALL_LIB_FILES) $(addprefix ld/,$(LINKER_SCRIPTS))
|
||||
|
||||
# Preprocess esp8266.ld linker script into esp8266_out.ld
|
||||
#
|
||||
# The library doesn't really depend on esp8266_out.ld, but it
|
||||
# saves us from having to add the target to a Makefile.projbuild
|
||||
$(COMPONENT_LIBRARY): esp8266_out.ld
|
||||
|
||||
esp8266_out.ld: $(COMPONENT_PATH)/ld/esp8266.ld ../include/sdkconfig.h
|
||||
$(CC) -I ../include -C -P -x c -E $< -o $@
|
||||
|
||||
COMPONENT_EXTRA_CLEAN := esp8266_out.ld
|
@ -1,30 +0,0 @@
|
||||
/* eagle.flash.bin @ 0x00000 */
|
||||
/* eagle.irom0text.bin @ 0x20000 */
|
||||
|
||||
/* Flash Map, support 512KB/1MB/2MB/4MB SPI Flash */
|
||||
/* |......|..............................|..........................|.....|....| */
|
||||
/* ^ ^ ^ ^ ^ */
|
||||
/* |_flash.bin start(0x0000) |_irom0text.bin start(0x20000) | */
|
||||
/* |_flash.bin end |_irom0text.bin end */
|
||||
/* |_system param area(0x7b000) */
|
||||
|
||||
/* NOTICE: */
|
||||
/* 1. You can change irom0 org, but MUST make sure irom0text.bin start not overlap flash.bin end. */
|
||||
/* 2. You can change irom0 len, but MUST make sure irom0text.bin end not overlap system param area. */
|
||||
/* 3. Space between flash.bin end and irom0text.bin start can be used as user param area. */
|
||||
/* 4. Space between irom0text.bin end and system param area can be used as user param area. */
|
||||
/* 5. Make sure irom0text.bin end < 0x100000 */
|
||||
/* 6. system param area: */
|
||||
/* 1>. 512KB--->0x07b000 */
|
||||
/* 2>. 1MB----->0x0fb000 */
|
||||
/* 3>. 2MB----->0x1fb000 */
|
||||
/* 4>. 4MB----->0x3fb000 */
|
||||
/* 7. Don't change any other seg. */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x18000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40220000, len = 0x5C000
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/* user1.bin @ 0x1000 */
|
||||
|
||||
/* Flash Map (512KB + 512KB), support 1MB/2MB/4MB SPI Flash */
|
||||
/* |..|........................|.....|.....|..|........................|.....|....| */
|
||||
/* ^ ^ ^ ^ ^ ^ ^ ^ */
|
||||
/* |_boot start(0x0000) | | |_pad start(0x80000) | | */
|
||||
/* |_user1 start(0x1000) |_user1 end |_user2 start(0x81000) |_user2 end */
|
||||
/* |_system param symmetric area(0x7b000) |_system param area(0xfb000) */
|
||||
|
||||
/* NOTICE: */
|
||||
/* 1. You can change irom0 len, but MUST make sure user1 end not overlap system param symmetric area. */
|
||||
/* 2. Space between user1 end and pad start can be used as user param area. */
|
||||
/* 3. Don't change any other seg. */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x18000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40201010, len = 0x6B000
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/* user2.bin @ 0x81000 */
|
||||
|
||||
/* Flash Map (512KB + 512KB), support 1MB/2MB/4MB SPI Flash */
|
||||
/* |..|........................|.....|.....|..|........................|.....|....| */
|
||||
/* ^ ^ ^ ^ ^ ^ ^ ^ */
|
||||
/* |_boot start(0x0000) | | |_pad start(0x80000) | | */
|
||||
/* |_user1 start(0x1000) |_user1 end |_user2 start(0x81000) |_user2 end */
|
||||
/* |_system param symmetric area(0x7b000) |_system param area(0xfb000) */
|
||||
|
||||
/* NOTICE: */
|
||||
/* 1. You can change irom0 len, but MUST make sure user2 end not overlap system param area. */
|
||||
/* 2. Space between user2 end and system param area can be used as user param area. */
|
||||
/* 3. Don't change any other seg. */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x18000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40281010, len = 0x6B000
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/* user1.bin @ 0x1000 */
|
||||
|
||||
/* Flash Map (256KB + 256KB), support 512KB SPI Flash */
|
||||
/* |..|........................|.....|.....|..|........................|.....|....| */
|
||||
/* ^ ^ ^ ^ ^ ^ ^ ^ */
|
||||
/* |_boot start(0x0000) | | |_pad start(0x40000) | | */
|
||||
/* |_user1 start(0x1000) |_user1 end |_user2 start(0x41000) |_user2 end */
|
||||
/* |_system param symmetric area(0x3b000) |_system param area(0x7b000) */
|
||||
|
||||
/* NOTICE: */
|
||||
/* 1. You can change irom0 len, but MUST make sure user1 end not overlap system param symmetric area. */
|
||||
/* 2. Space between user1 end and pad start can be used as user param area. */
|
||||
/* 3. Don't change any other seg. */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x18000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40201010, len = 0x2B000
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/* user2.bin @ 0x41000 */
|
||||
|
||||
/* Flash Map (256KB + 256KB), support 512KB SPI Flash */
|
||||
/* |..|........................|.....|.....|..|........................|.....|....| */
|
||||
/* ^ ^ ^ ^ ^ ^ ^ ^ */
|
||||
/* |_boot start(0x0000) | | |_pad start(0x40000) | | */
|
||||
/* |_user1 start(0x1000) |_user1 end |_user2 start(0x41000) |_user2 end */
|
||||
/* |_system param symmetric area(0x3b000) |_system param area(0x7b000) */
|
||||
|
||||
/* NOTICE: */
|
||||
/* 1. You can change irom0 len, but MUST make sure user2 end not overlap system param area. */
|
||||
/* 2. Space between user2 end and system param area can be used as user param area. */
|
||||
/* 3. Don't change any other seg. */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x18000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40241010, len = 0x2B000
|
||||
}
|
@ -14,6 +14,8 @@
|
||||
/* 4. Don't change any other seg. */
|
||||
/* 5. user1.bin and user2.bin are same in this mode, so upgrade only need one of them. */
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
Reference in New Issue
Block a user