diff --git a/hardware/esp8266com/esp8266/boards.txt b/hardware/esp8266com/esp8266/boards.txt index e598bb884..4d6c41515 100644 --- a/hardware/esp8266com/esp8266/boards.txt +++ b/hardware/esp8266com/esp8266/boards.txt @@ -23,6 +23,7 @@ generic.build.variant=generic generic.build.flash_mode=qio generic.build.flash_size=512K generic.build.flash_freq=40 +generic.build.flash_ld=eagle.flash.512k.ld generic.menu.CpuFrequency.80=80 MHz generic.menu.CpuFrequency.80.build.f_cpu=80000000L @@ -50,14 +51,19 @@ generic.menu.UploadSpeed.921600.upload.speed=921600 generic.menu.FlashSize.512K=512K generic.menu.FlashSize.512K.build.flash_size=512K +generic.menu.FlashSize.512K.build.flash_ld=eagle.flash.512k.ld generic.menu.FlashSize.256K=256K generic.menu.FlashSize.256K.build.flash_size=256K +generic.menu.FlashSize.256K.build.flash_ld=eagle.flash.256k.ld generic.menu.FlashSize.1M=1M generic.menu.FlashSize.1M.build.flash_size=1M +generic.menu.FlashSize.1M.build.flash_ld=eagle.flash.1m.ld generic.menu.FlashSize.2M=2M generic.menu.FlashSize.2M.build.flash_size=2M +generic.menu.FlashSize.2M.build.flash_ld=eagle.flash.2m.ld generic.menu.FlashSize.4M=4M generic.menu.FlashSize.4M.build.flash_size=4M +generic.menu.FlashSize.4M.build.flash_ld=eagle.flash.4m.ld generic.menu.FlashFreq.40=40MHz generic.menu.FlashFreq.40.build.flash_freq=40 @@ -97,6 +103,7 @@ modwifi.build.variant=generic modwifi.build.flash_mode=qio modwifi.build.flash_size=2M modwifi.build.flash_freq=40 +modwifi.build.flash_ld=eagle.flash.2m.ld modwifi.menu.CpuFrequency.80=80 MHz modwifi.menu.CpuFrequency.80.build.f_cpu=80000000L @@ -142,6 +149,7 @@ nodemcu.build.variant=nodemcu nodemcu.build.flash_mode=qio nodemcu.build.flash_size=4M nodemcu.build.flash_freq=40 +nodemcu.build.flash_ld=eagle.flash.4m.ld nodemcu.menu.CpuFrequency.80=80 MHz nodemcu.menu.CpuFrequency.80.build.f_cpu=80000000L @@ -188,6 +196,7 @@ nodemcu.menu.FlashSize.4M.build.flash_size=4M # wifio.build.flash_mode=qio # wifio.build.flash_size=512K # wifio.build.flash_freq=40 +# wifio.build.flash_ld=eagle.flash.512k.ld # # wifio.menu.CpuFrequency.80=80MHz # wifio.menu.CpuFrequency.80.build.f_cpu=80000000L diff --git a/hardware/esp8266com/esp8266/cores/esp8266/spiffs/spiffs_flashmem.c b/hardware/esp8266com/esp8266/cores/esp8266/spiffs/spiffs_flashmem.c index 3caaaa99e..156e2fac2 100755 --- a/hardware/esp8266com/esp8266/cores/esp8266/spiffs/spiffs_flashmem.c +++ b/hardware/esp8266com/esp8266/cores/esp8266/spiffs/spiffs_flashmem.c @@ -1,4 +1,5 @@ #include "flashmem.h" +#include "esp8266_peri.h" // Based on NodeMCU platform_flash // https://github.com/nodemcu/nodemcu-firmware diff --git a/hardware/esp8266com/esp8266/platform.txt b/hardware/esp8266com/esp8266/platform.txt index cd09aff98..bc4b20927 100644 --- a/hardware/esp8266com/esp8266/platform.txt +++ b/hardware/esp8266com/esp8266/platform.txt @@ -20,8 +20,7 @@ compiler.c.flags=-c -Os -Wpointer-arith -Wno-implicit-function-declaration -Wl,- compiler.S.cmd=xtensa-lx106-elf-gcc compiler.S.flags=-c -g -x assembler-with-cpp -MMD -compiler.c.elf.ldscript=eagle.app.v6.ld -compiler.c.elf.flags=-nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-T{compiler.c.elf.ldscript}" +compiler.c.elf.flags=-nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-T{build.flash_ld}" compiler.c.elf.cmd=xtensa-lx106-elf-gcc compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig diff --git a/hardware/tools/esp8266/sdk/ld/eagle.app.v6.ld b/hardware/tools/esp8266/sdk/ld/eagle.app.v6.common.ld similarity index 92% rename from hardware/tools/esp8266/sdk/ld/eagle.app.v6.ld rename to hardware/tools/esp8266/sdk/ld/eagle.app.v6.common.ld index bbfd7f03c..986b441ff 100644 --- a/hardware/tools/esp8266/sdk/ld/eagle.app.v6.ld +++ b/hardware/tools/esp8266/sdk/ld/eagle.app.v6.common.ld @@ -1,12 +1,5 @@ /* This linker script generated from xt-genldscripts.tpp for LSP . */ /* Linker Script for ld -N */ -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40210000, len = 0x5B000 -} PHDRS { @@ -20,8 +13,6 @@ PHDRS /* Default entry point: */ ENTRY(call_user_start) -PROVIDE ( _SPIFFS_start = 0x4026B000 ); -PROVIDE ( _SPIFFS_end = 0x4027B000 ); PROVIDE(_memmap_vecbase_reset = 0x40000000); /* Various memory-map dependent cache attribute settings: */ _memmap_cacheattr_wb_base = 0x00000110; diff --git a/hardware/tools/esp8266/sdk/ld/eagle.flash.1m.ld b/hardware/tools/esp8266/sdk/ld/eagle.flash.1m.ld new file mode 100644 index 000000000..1ffd7e678 --- /dev/null +++ b/hardware/tools/esp8266/sdk/ld/eagle.flash.1m.ld @@ -0,0 +1,17 @@ +/* Flash Split for 1M chips */ +/* irom0 428KB */ +/* spiffs 512KB */ +/* eeprom 20KB */ + +MEMORY +{ + dport0_0_seg : org = 0x3FF00000, len = 0x10 + dram0_0_seg : org = 0x3FFE8000, len = 0x14000 + iram1_0_seg : org = 0x40100000, len = 0x8000 + irom0_0_seg : org = 0x40210000, len = 0x6B000 +} + +PROVIDE ( _SPIFFS_start = 0x4027B000 ); +PROVIDE ( _SPIFFS_end = 0x402FB000 ); + +INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/hardware/tools/esp8266/sdk/ld/eagle.flash.256k.ld b/hardware/tools/esp8266/sdk/ld/eagle.flash.256k.ld new file mode 100644 index 000000000..8ecddb8b6 --- /dev/null +++ b/hardware/tools/esp8266/sdk/ld/eagle.flash.256k.ld @@ -0,0 +1,17 @@ +/* Flash Split for 256K chips */ +/* irom0 108KB */ +/* spiffs 64KB */ +/* eeprom 20KB */ + +MEMORY +{ + dport0_0_seg : org = 0x3FF00000, len = 0x10 + dram0_0_seg : org = 0x3FFE8000, len = 0x14000 + iram1_0_seg : org = 0x40100000, len = 0x8000 + irom0_0_seg : org = 0x40210000, len = 0x1B000 +} + +PROVIDE ( _SPIFFS_start = 0x4022B000 ); +PROVIDE ( _SPIFFS_end = 0x4023B000 ); + +INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/hardware/tools/esp8266/sdk/ld/eagle.flash.2m.ld b/hardware/tools/esp8266/sdk/ld/eagle.flash.2m.ld new file mode 100644 index 000000000..cd6af2770 --- /dev/null +++ b/hardware/tools/esp8266/sdk/ld/eagle.flash.2m.ld @@ -0,0 +1,17 @@ +/* Flash Split for 2M chips */ +/* irom0 960KB */ +/* spiffs 1004KB */ +/* eeprom 20KB */ + +MEMORY +{ + dport0_0_seg : org = 0x3FF00000, len = 0x10 + dram0_0_seg : org = 0x3FFE8000, len = 0x14000 + iram1_0_seg : org = 0x40100000, len = 0x8000 + irom0_0_seg : org = 0x40210000, len = 0xF0000 +} + +PROVIDE ( _SPIFFS_start = 0x40300000 ); +PROVIDE ( _SPIFFS_end = 0x403FB000 ); + +INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/hardware/tools/esp8266/sdk/ld/eagle.flash.4m.ld b/hardware/tools/esp8266/sdk/ld/eagle.flash.4m.ld new file mode 100644 index 000000000..7df2fa8ad --- /dev/null +++ b/hardware/tools/esp8266/sdk/ld/eagle.flash.4m.ld @@ -0,0 +1,17 @@ +/* Flash Split for 4M chips */ +/* irom0 960KB */ +/* spiffs 3052KB */ +/* eeprom 20KB */ + +MEMORY +{ + dport0_0_seg : org = 0x3FF00000, len = 0x10 + dram0_0_seg : org = 0x3FFE8000, len = 0x14000 + iram1_0_seg : org = 0x40100000, len = 0x8000 + irom0_0_seg : org = 0x40210000, len = 0xF0000 +} + +PROVIDE ( _SPIFFS_start = 0x40300000 ); +PROVIDE ( _SPIFFS_end = 0x405FB000 ); + +INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/hardware/tools/esp8266/sdk/ld/eagle.flash.512k.ld b/hardware/tools/esp8266/sdk/ld/eagle.flash.512k.ld new file mode 100644 index 000000000..05160fe95 --- /dev/null +++ b/hardware/tools/esp8266/sdk/ld/eagle.flash.512k.ld @@ -0,0 +1,17 @@ +/* Flash Split for 512K chips */ +/* irom0 364KB */ +/* spiffs 64KB */ +/* eeprom 20KB */ + +MEMORY +{ + dport0_0_seg : org = 0x3FF00000, len = 0x10 + dram0_0_seg : org = 0x3FFE8000, len = 0x14000 + iram1_0_seg : org = 0x40100000, len = 0x8000 + irom0_0_seg : org = 0x40210000, len = 0x5B000 +} + +PROVIDE ( _SPIFFS_start = 0x4026B000 ); +PROVIDE ( _SPIFFS_end = 0x4027B000 ); + +INCLUDE "../ld/eagle.app.v6.common.ld"