Skip to content

Commit ce90037

Browse files
committed
tools/boards.txt.py: make ldscript output same as the existing files
1 parent bc46db7 commit ce90037

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

tools/boards.txt.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ def flash_size (display, optname, ld, desc, max_upload_size, spiffs_start = 0, s
978978
( menub + 'spiffs_pagesize', '256' ),
979979
( menu + '.upload.maximum_size', "%i" % max_upload_size ),
980980
])
981-
if spiffs_start > 0:
981+
if spiffs_size > 0:
982982
d.update(collections.OrderedDict([
983983
( menub + 'spiffs_start', "0x%05X" % spiffs_start ),
984984
( menub + 'spiffs_end', "0x%05X" % (spiffs_start + spiffs_size) ),
@@ -1008,15 +1008,24 @@ def flash_size (display, optname, ld, desc, max_upload_size, spiffs_start = 0, s
10081008
else:
10091009
page = 0x100
10101010
block = 0x2000
1011-
print "/* file %s */" % ld
1012-
print "/* Flash Split for %s chips */" % optname
1011+
1012+
print "/* Flash Split for %s chips */" % display
1013+
print "/* sketch %dKB */" % (max_upload_size / 1024)
1014+
if spiffs_size > 0:
1015+
empty_size = spiffs_start - max_upload_size - 4096
1016+
if empty_size > 1024:
1017+
print "/* empty %dKB */" % (empty_size / 1024)
1018+
print "/* spiffs %dKB */" % (spiffs_size / 1024)
1019+
print "/* eeprom 20KB */"
1020+
print ""
10131021
print "MEMORY"
10141022
print "{"
10151023
print " dport0_0_seg : org = 0x3FF00000, len = 0x10"
10161024
print " dram0_0_seg : org = 0x3FFE8000, len = 0x14000"
10171025
print " iram1_0_seg : org = 0x40100000, len = 0x8000"
10181026
print " irom0_0_seg : org = 0x40201010, len = 0x%x" % max_upload_size
10191027
print "}"
1028+
print ""
10201029
print "PROVIDE ( _SPIFFS_start = 0x%08X );" % (0x40200000 + spiffs_start)
10211030
print "PROVIDE ( _SPIFFS_end = 0x%08X );" % (0x40200000 + spiffs_start + spiffs_size)
10221031
print "PROVIDE ( _SPIFFS_page = 0x%X );" % page
@@ -1031,10 +1040,10 @@ def flash_size (display, optname, ld, desc, max_upload_size, spiffs_start = 0, s
10311040
return d
10321041

10331042
def all_flash_size ():
1034-
f512 = flash_size('512K', '512K0', 'eagle.flash.512k0.ld', 'no SPIFFS', 499696)
1043+
f512 = flash_size('512K', '512K0', 'eagle.flash.512k0.ld', 'no SPIFFS', 499696, 0x7B000)
10351044
f512.update(flash_size('512K', '512K64', 'eagle.flash.512k64.ld', '64K SPIFFS', 434160, 0x6B000, 0x10000, 4096))
10361045
f512.update(flash_size('512K', '512K128', 'eagle.flash.512k128.ld', '128K SPIFFS', 368624, 0x5B000, 0x20000, 4096))
1037-
f1m = flash_size( '1M', '1M0', 'eagle.flash.1m0.ld', 'no SPIFFS', 1023984)
1046+
f1m = flash_size( '1M', '1M0', 'eagle.flash.1m0.ld', 'no SPIFFS', 1023984, 0xFB000)
10381047
f1m.update( flash_size( '1M', '1M64', 'eagle.flash.1m64.ld', '64K SPIFFS', 958448, 0xEB000, 0x10000, 4096))
10391048
f1m.update( flash_size( '1M', '1M128', 'eagle.flash.1m128.ld', '128K SPIFFS', 892912, 0xDB000, 0x20000, 4096))
10401049
f1m.update( flash_size( '1M', '1M144', 'eagle.flash.1m144.ld', '144K SPIFFS', 876528, 0xD7000, 0x24000, 4096))

tools/sdk/ld/eagle.flash.1m0.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Flash Split for 1M chips, no SPIFFS */
1+
/* Flash Split for 1M chips */
22
/* sketch 999KB */
33
/* eeprom 20KB */
44

@@ -12,7 +12,7 @@ MEMORY
1212

1313
PROVIDE ( _SPIFFS_start = 0x402FB000 );
1414
PROVIDE ( _SPIFFS_end = 0x402FB000 );
15-
PROVIDE ( _SPIFFS_page = 0 );
16-
PROVIDE ( _SPIFFS_block = 0 );
15+
PROVIDE ( _SPIFFS_page = 0x0 );
16+
PROVIDE ( _SPIFFS_block = 0x0 );
1717

1818
INCLUDE "../ld/eagle.app.v6.common.ld"

tools/sdk/ld/eagle.flash.512k0.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Flash Split for 512K chips, no SPIFFS */
1+
/* Flash Split for 512K chips */
22
/* sketch 487KB */
33
/* eeprom 20KB */
44

@@ -12,7 +12,7 @@ MEMORY
1212

1313
PROVIDE ( _SPIFFS_start = 0x4027B000 );
1414
PROVIDE ( _SPIFFS_end = 0x4027B000 );
15-
PROVIDE ( _SPIFFS_page = 0 );
16-
PROVIDE ( _SPIFFS_block = 0 );
15+
PROVIDE ( _SPIFFS_page = 0x0 );
16+
PROVIDE ( _SPIFFS_block = 0x0 );
1717

1818
INCLUDE "../ld/eagle.app.v6.common.ld"

0 commit comments

Comments
 (0)