Skip to content

Commit c11d7d4

Browse files
ficetoficeto
ficeto
authored and
ficeto
committed
add flash splits depending on the flash size
1 parent 17bfb12 commit c11d7d4

File tree

9 files changed

+96
-11
lines changed

9 files changed

+96
-11
lines changed

hardware/esp8266com/esp8266/boards.txt

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ generic.build.variant=generic
2323
generic.build.flash_mode=qio
2424
generic.build.flash_size=512K
2525
generic.build.flash_freq=40
26+
generic.build.flash_ld=eagle.flash.512k.ld
2627

2728
generic.menu.CpuFrequency.80=80 MHz
2829
generic.menu.CpuFrequency.80.build.f_cpu=80000000L
@@ -50,14 +51,19 @@ generic.menu.UploadSpeed.921600.upload.speed=921600
5051

5152
generic.menu.FlashSize.512K=512K
5253
generic.menu.FlashSize.512K.build.flash_size=512K
54+
generic.menu.FlashSize.512K.build.flash_ld=eagle.flash.512k.ld
5355
generic.menu.FlashSize.256K=256K
5456
generic.menu.FlashSize.256K.build.flash_size=256K
57+
generic.menu.FlashSize.256K.build.flash_ld=eagle.flash.256k.ld
5558
generic.menu.FlashSize.1M=1M
5659
generic.menu.FlashSize.1M.build.flash_size=1M
60+
generic.menu.FlashSize.1M.build.flash_ld=eagle.flash.1m.ld
5761
generic.menu.FlashSize.2M=2M
5862
generic.menu.FlashSize.2M.build.flash_size=2M
63+
generic.menu.FlashSize.2M.build.flash_ld=eagle.flash.2m.ld
5964
generic.menu.FlashSize.4M=4M
6065
generic.menu.FlashSize.4M.build.flash_size=4M
66+
generic.menu.FlashSize.4M.build.flash_ld=eagle.flash.4m.ld
6167

6268
generic.menu.FlashFreq.40=40MHz
6369
generic.menu.FlashFreq.40.build.flash_freq=40
@@ -97,6 +103,7 @@ modwifi.build.variant=generic
97103
modwifi.build.flash_mode=qio
98104
modwifi.build.flash_size=2M
99105
modwifi.build.flash_freq=40
106+
modwifi.build.flash_ld=eagle.flash.2m.ld
100107

101108
modwifi.menu.CpuFrequency.80=80 MHz
102109
modwifi.menu.CpuFrequency.80.build.f_cpu=80000000L
@@ -142,6 +149,7 @@ nodemcu.build.variant=nodemcu
142149
nodemcu.build.flash_mode=qio
143150
nodemcu.build.flash_size=4M
144151
nodemcu.build.flash_freq=40
152+
nodemcu.build.flash_ld=eagle.flash.4m.ld
145153

146154
nodemcu.menu.CpuFrequency.80=80 MHz
147155
nodemcu.menu.CpuFrequency.80.build.f_cpu=80000000L
@@ -188,6 +196,7 @@ nodemcu.menu.FlashSize.4M.build.flash_size=4M
188196
# wifio.build.flash_mode=qio
189197
# wifio.build.flash_size=512K
190198
# wifio.build.flash_freq=40
199+
# wifio.build.flash_ld=eagle.flash.512k.ld
191200
#
192201
# wifio.menu.CpuFrequency.80=80MHz
193202
# wifio.menu.CpuFrequency.80.build.f_cpu=80000000L

hardware/esp8266com/esp8266/cores/esp8266/spiffs/spiffs_flashmem.c

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "flashmem.h"
2+
#include "esp8266_peri.h"
23

34
// Based on NodeMCU platform_flash
45
// https://github.com/nodemcu/nodemcu-firmware

hardware/esp8266com/esp8266/platform.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ compiler.c.flags=-c -Os -Wpointer-arith -Wno-implicit-function-declaration -Wl,-
2020
compiler.S.cmd=xtensa-lx106-elf-gcc
2121
compiler.S.flags=-c -g -x assembler-with-cpp -MMD
2222

23-
compiler.c.elf.ldscript=eagle.app.v6.ld
24-
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}"
23+
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}"
2524
compiler.c.elf.cmd=xtensa-lx106-elf-gcc
2625
compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig
2726

hardware/tools/esp8266/sdk/ld/eagle.app.v6.ld renamed to hardware/tools/esp8266/sdk/ld/eagle.app.v6.common.ld

-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
/* This linker script generated from xt-genldscripts.tpp for LSP . */
22
/* Linker Script for ld -N */
3-
MEMORY
4-
{
5-
dport0_0_seg : org = 0x3FF00000, len = 0x10
6-
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
7-
iram1_0_seg : org = 0x40100000, len = 0x8000
8-
irom0_0_seg : org = 0x40210000, len = 0x5B000
9-
}
103

114
PHDRS
125
{
@@ -20,8 +13,6 @@ PHDRS
2013

2114
/* Default entry point: */
2215
ENTRY(call_user_start)
23-
PROVIDE ( _SPIFFS_start = 0x4026B000 );
24-
PROVIDE ( _SPIFFS_end = 0x4027B000 );
2516
PROVIDE(_memmap_vecbase_reset = 0x40000000);
2617
/* Various memory-map dependent cache attribute settings: */
2718
_memmap_cacheattr_wb_base = 0x00000110;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Flash Split for 1M chips */
2+
/* irom0 428KB */
3+
/* spiffs 512KB */
4+
/* eeprom 20KB */
5+
6+
MEMORY
7+
{
8+
dport0_0_seg : org = 0x3FF00000, len = 0x10
9+
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
10+
iram1_0_seg : org = 0x40100000, len = 0x8000
11+
irom0_0_seg : org = 0x40210000, len = 0x6B000
12+
}
13+
14+
PROVIDE ( _SPIFFS_start = 0x4027B000 );
15+
PROVIDE ( _SPIFFS_end = 0x402FB000 );
16+
17+
INCLUDE "../ld/eagle.app.v6.common.ld"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Flash Split for 256K chips */
2+
/* irom0 108KB */
3+
/* spiffs 64KB */
4+
/* eeprom 20KB */
5+
6+
MEMORY
7+
{
8+
dport0_0_seg : org = 0x3FF00000, len = 0x10
9+
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
10+
iram1_0_seg : org = 0x40100000, len = 0x8000
11+
irom0_0_seg : org = 0x40210000, len = 0x1B000
12+
}
13+
14+
PROVIDE ( _SPIFFS_start = 0x4022B000 );
15+
PROVIDE ( _SPIFFS_end = 0x4023B000 );
16+
17+
INCLUDE "../ld/eagle.app.v6.common.ld"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Flash Split for 2M chips */
2+
/* irom0 960KB */
3+
/* spiffs 1004KB */
4+
/* eeprom 20KB */
5+
6+
MEMORY
7+
{
8+
dport0_0_seg : org = 0x3FF00000, len = 0x10
9+
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
10+
iram1_0_seg : org = 0x40100000, len = 0x8000
11+
irom0_0_seg : org = 0x40210000, len = 0xF0000
12+
}
13+
14+
PROVIDE ( _SPIFFS_start = 0x40300000 );
15+
PROVIDE ( _SPIFFS_end = 0x403FB000 );
16+
17+
INCLUDE "../ld/eagle.app.v6.common.ld"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Flash Split for 4M chips */
2+
/* irom0 960KB */
3+
/* spiffs 3052KB */
4+
/* eeprom 20KB */
5+
6+
MEMORY
7+
{
8+
dport0_0_seg : org = 0x3FF00000, len = 0x10
9+
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
10+
iram1_0_seg : org = 0x40100000, len = 0x8000
11+
irom0_0_seg : org = 0x40210000, len = 0xF0000
12+
}
13+
14+
PROVIDE ( _SPIFFS_start = 0x40300000 );
15+
PROVIDE ( _SPIFFS_end = 0x405FB000 );
16+
17+
INCLUDE "../ld/eagle.app.v6.common.ld"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Flash Split for 512K chips */
2+
/* irom0 364KB */
3+
/* spiffs 64KB */
4+
/* eeprom 20KB */
5+
6+
MEMORY
7+
{
8+
dport0_0_seg : org = 0x3FF00000, len = 0x10
9+
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
10+
iram1_0_seg : org = 0x40100000, len = 0x8000
11+
irom0_0_seg : org = 0x40210000, len = 0x5B000
12+
}
13+
14+
PROVIDE ( _SPIFFS_start = 0x4026B000 );
15+
PROVIDE ( _SPIFFS_end = 0x4027B000 );
16+
17+
INCLUDE "../ld/eagle.app.v6.common.ld"

0 commit comments

Comments
 (0)