Skip to content

Commit

Permalink
boards generator: updates (#5103)
Browse files Browse the repository at this point in the history
boards generator updates:
* simplified mapping description: only flash and spiffs sizes are needed
* some ldscripts are renamed due to autogenerated names
* +2M/0, +2M/512K spiffs, +4M0
* reduce length of hidden strings in boards.txt (#5100, arduino/arduino-builder#284)
* give more details in ldscripts (address, size,  +rf-cal, +sdk-wifi-settings)
  • Loading branch information
d-a-v authored Sep 3, 2018
1 parent c33ef89 commit cc0bfa0
Show file tree
Hide file tree
Showing 27 changed files with 4,713 additions and 4,301 deletions.
8,436 changes: 4,325 additions & 4,111 deletions boards.txt

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/device/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ UPLOAD_BAUD ?= 921600
UPLOAD_BOARD ?= nodemcu
BS_DIR ?= libraries/BSTest
DEBUG_LEVEL ?= DebugLevel=None____
FQBN ?= esp8266com:esp8266:generic:CpuFrequency=80,FlashFreq=40,FlashMode=dio,UploadSpeed=115200,FlashSize=4M1M,LwIPVariant=v2mss536,ResetMethod=none,Debug=Serial,$(DEBUG_LEVEL)
#FQBN ?= esp8266com:esp8266:generic:CpuFrequency=80,FlashFreq=40,FlashMode=dio,UploadSpeed=115200,FlashSize=4M1M,LwIPVariant=v2mss536,ResetMethod=none,Debug=Serial,$(DEBUG_LEVEL)
FQBN ?= esp8266com:esp8266:generic:xtal=80,FlashFreq=40,FlashMode=dio,baud=115200,eesz=4M1M,ip=lm2,ResetMethod=none,dbg=Serial,$(DEBUG_LEVEL)
BUILD_TOOL := $(ARDUINO_IDE_PATH)/arduino-builder
TEST_CONFIG := test_env.cfg
TEST_REPORT_XML := test_report.xml
Expand Down
287 changes: 172 additions & 115 deletions tools/boards.txt.py

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ def compile(tmp_dir, sketch, tools_dir, hardware_dir, ide_path, f, args):
cmd += '-hardware "' + hardware_dir + '" '
# Debug=Serial,DebugLevel=Core____
cmd += '-fqbn=esp8266com:esp8266:{board_name}:' \
'CpuFrequency={cpu_freq},' \
'xtal={cpu_freq},' \
'FlashFreq={flash_freq},' \
'FlashMode={flash_mode},' \
'UploadSpeed=921600,' \
'FlashSize={flash_size},' \
'baud=921600,' \
'eesz={flash_size},' \
'ResetMethod=nodemcu'.format(**vars(args))
if args.debug_port and args.debug_level:
cmd += 'Debug={debug_port},DebugLevel={debug_level}'.format(**vars(args))
cmd += 'dbg={debug_port},lvl={debug_level}'.format(**vars(args))
cmd += ' '
cmd += '-ide-version=10607 '
cmd += '-warnings={warnings} '.format(**vars(args))
Expand Down
22 changes: 22 additions & 0 deletions tools/sdk/ld/eagle.flash.16m14m.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Flash Split for 16M chips */
/* sketch @0x40200000 (~1019KB) (1044464B) */
/* empty @0x402FEFF0 (~1028KB) (1052688B) */
/* spiffs @0x40400000 (~14316KB) (14659584B) */
/* eeprom @0x411FB000 (=4KB) */
/* rfcal @0x411FC000 (=4KB) */
/* wifi @0x411FD000 (=12KB) */

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 = 0x40201010, len = 0xfeff0
}

PROVIDE ( _SPIFFS_start = 0x40400000 );
PROVIDE ( _SPIFFS_end = 0x411FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "eagle.app.v6.common.ld"
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 16M chips */
/* sketch 1019KB */
/* spiffs 15340KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~1019KB) (1044464B) */
/* empty @0x402FEFF0 (~4KB) (4112B) */
/* spiffs @0x40300000 (~15340KB) (15708160B) */
/* eeprom @0x411FB000 (=4KB) */
/* rfcal @0x411FC000 (=4KB) */
/* wifi @0x411FD000 (=12KB) */

MEMORY
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* Flash Split for 1M chips */
/* sketch 999KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~999KB) (1023984B) */
/* eeprom @0x402FB000 (=4KB) */
/* rfcal @0x402FC000 (=4KB) */
/* wifi @0x402FD000 (=12KB) */

MEMORY
{
Expand All @@ -10,9 +12,5 @@ MEMORY
irom0_0_seg : org = 0x40201010, len = 0xf9ff0
}

PROVIDE ( _SPIFFS_start = 0x402FB000 );
PROVIDE ( _SPIFFS_end = 0x402FB000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );

INCLUDE "eagle.app.v6.common.ld"
9 changes: 6 additions & 3 deletions tools/sdk/ld/eagle.flash.1m128.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 1M chips */
/* sketch 871KB */
/* spiffs 128KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~871KB) (892912B) */
/* empty @0x402D9FF0 (~4KB) (4112B) */
/* spiffs @0x402DB000 (~128KB) (131072B) */
/* eeprom @0x402FB000 (=4KB) */
/* rfcal @0x402FC000 (=4KB) */
/* wifi @0x402FD000 (=12KB) */

MEMORY
{
Expand Down
9 changes: 6 additions & 3 deletions tools/sdk/ld/eagle.flash.1m144.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 1M chips */
/* sketch 855KB */
/* spiffs 144KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~855KB) (876528B) */
/* empty @0x402D5FF0 (~4KB) (4112B) */
/* spiffs @0x402D7000 (~144KB) (147456B) */
/* eeprom @0x402FB000 (=4KB) */
/* rfcal @0x402FC000 (=4KB) */
/* wifi @0x402FD000 (=12KB) */

MEMORY
{
Expand Down
9 changes: 6 additions & 3 deletions tools/sdk/ld/eagle.flash.1m160.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 1M chips */
/* sketch 839KB */
/* spiffs 160KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~839KB) (860144B) */
/* empty @0x402D1FF0 (~4KB) (4112B) */
/* spiffs @0x402D3000 (~160KB) (163840B) */
/* eeprom @0x402FB000 (=4KB) */
/* rfcal @0x402FC000 (=4KB) */
/* wifi @0x402FD000 (=12KB) */

MEMORY
{
Expand Down
9 changes: 6 additions & 3 deletions tools/sdk/ld/eagle.flash.1m192.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 1M chips */
/* sketch 807KB */
/* spiffs 192KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~807KB) (827376B) */
/* empty @0x402C9FF0 (~4KB) (4112B) */
/* spiffs @0x402CB000 (~192KB) (196608B) */
/* eeprom @0x402FB000 (=4KB) */
/* rfcal @0x402FC000 (=4KB) */
/* wifi @0x402FD000 (=12KB) */

MEMORY
{
Expand Down
9 changes: 6 additions & 3 deletions tools/sdk/ld/eagle.flash.1m256.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 1M chips */
/* sketch 743KB */
/* spiffs 256KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~743KB) (761840B) */
/* empty @0x402B9FF0 (~4KB) (4112B) */
/* spiffs @0x402BB000 (~256KB) (262144B) */
/* eeprom @0x402FB000 (=4KB) */
/* rfcal @0x402FC000 (=4KB) */
/* wifi @0x402FD000 (=12KB) */

MEMORY
{
Expand Down
9 changes: 6 additions & 3 deletions tools/sdk/ld/eagle.flash.1m512.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 1M chips */
/* sketch 487KB */
/* spiffs 512KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~487KB) (499696B) */
/* empty @0x40279FF0 (~4KB) (4112B) */
/* spiffs @0x4027B000 (~512KB) (524288B) */
/* eeprom @0x402FB000 (=4KB) */
/* rfcal @0x402FC000 (=4KB) */
/* wifi @0x402FD000 (=12KB) */

MEMORY
{
Expand Down
9 changes: 6 additions & 3 deletions tools/sdk/ld/eagle.flash.1m64.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 1M chips */
/* sketch 935KB */
/* spiffs 64KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~935KB) (958448B) */
/* empty @0x402E9FF0 (~4KB) (4112B) */
/* spiffs @0x402EB000 (~64KB) (65536B) */
/* eeprom @0x402FB000 (=4KB) */
/* rfcal @0x402FC000 (=4KB) */
/* wifi @0x402FD000 (=12KB) */

MEMORY
{
Expand Down
11 changes: 4 additions & 7 deletions tools/sdk/ld/eagle.flash.2m.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* Flash Split for 2M chips */
/* sketch 1019KB */
/* spiffs 1004KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~1019KB) (1044464B) */
/* eeprom @0x403FB000 (=4KB) */
/* rfcal @0x403FC000 (=4KB) */
/* wifi @0x403FD000 (=12KB) */

MEMORY
{
Expand All @@ -11,9 +12,5 @@ MEMORY
irom0_0_seg : org = 0x40201010, len = 0xfeff0
}

PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x403FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "eagle.app.v6.common.ld"
22 changes: 22 additions & 0 deletions tools/sdk/ld/eagle.flash.2m1m.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Flash Split for 2M chips */
/* sketch @0x40200000 (~1019KB) (1044464B) */
/* empty @0x402FEFF0 (~4KB) (4112B) */
/* spiffs @0x40300000 (~1004KB) (1028096B) */
/* eeprom @0x403FB000 (=4KB) */
/* rfcal @0x403FC000 (=4KB) */
/* wifi @0x403FD000 (=12KB) */

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 = 0x40201010, len = 0xfeff0
}

PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x403FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "eagle.app.v6.common.ld"
22 changes: 22 additions & 0 deletions tools/sdk/ld/eagle.flash.2m512.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Flash Split for 2M chips */
/* sketch @0x40200000 (~1019KB) (1044464B) */
/* empty @0x402FEFF0 (~516KB) (528400B) */
/* spiffs @0x40380000 (~492KB) (503808B) */
/* eeprom @0x403FB000 (=4KB) */
/* rfcal @0x403FC000 (=4KB) */
/* wifi @0x403FD000 (=12KB) */

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 = 0x40201010, len = 0xfeff0
}

PROVIDE ( _SPIFFS_start = 0x40380000 );
PROVIDE ( _SPIFFS_end = 0x403FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "eagle.app.v6.common.ld"
11 changes: 4 additions & 7 deletions tools/sdk/ld/eagle.flash.4m.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* Flash Split for 4M chips */
/* sketch 1019KB */
/* spiffs 3052KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~1019KB) (1044464B) */
/* eeprom @0x405FB000 (=4KB) */
/* rfcal @0x405FC000 (=4KB) */
/* wifi @0x405FD000 (=12KB) */

MEMORY
{
Expand All @@ -11,9 +12,5 @@ MEMORY
irom0_0_seg : org = 0x40201010, len = 0xfeff0
}

PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x405FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "eagle.app.v6.common.ld"
10 changes: 6 additions & 4 deletions tools/sdk/ld/eagle.flash.4m1m.ld
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* Flash Split for 4M chips */
/* sketch 1019KB */
/* empty 2048KB */
/* spiffs 1004KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~1019KB) (1044464B) */
/* empty @0x402FEFF0 (~2052KB) (2101264B) */
/* spiffs @0x40500000 (~1004KB) (1028096B) */
/* eeprom @0x405FB000 (=4KB) */
/* rfcal @0x405FC000 (=4KB) */
/* wifi @0x405FD000 (=12KB) */

MEMORY
{
Expand Down
10 changes: 6 additions & 4 deletions tools/sdk/ld/eagle.flash.4m2m.ld
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* Flash Split for 4M chips */
/* sketch 1019KB */
/* empty 1024KB */
/* spiffs 2028KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~1019KB) (1044464B) */
/* empty @0x402FEFF0 (~1028KB) (1052688B) */
/* spiffs @0x40400000 (~2028KB) (2076672B) */
/* eeprom @0x405FB000 (=4KB) */
/* rfcal @0x405FC000 (=4KB) */
/* wifi @0x405FD000 (=12KB) */

MEMORY
{
Expand Down
22 changes: 22 additions & 0 deletions tools/sdk/ld/eagle.flash.4m3m.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Flash Split for 4M chips */
/* sketch @0x40200000 (~1019KB) (1044464B) */
/* empty @0x402FEFF0 (~4KB) (4112B) */
/* spiffs @0x40300000 (~3052KB) (3125248B) */
/* eeprom @0x405FB000 (=4KB) */
/* rfcal @0x405FC000 (=4KB) */
/* wifi @0x405FD000 (=12KB) */

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 = 0x40201010, len = 0xfeff0
}

PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x405FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "eagle.app.v6.common.ld"
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* Flash Split for 512K chips */
/* sketch 487KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~487KB) (499696B) */
/* eeprom @0x4027B000 (=4KB) */
/* rfcal @0x4027C000 (=4KB) */
/* wifi @0x4027D000 (=12KB) */

MEMORY
{
Expand All @@ -10,9 +12,5 @@ MEMORY
irom0_0_seg : org = 0x40201010, len = 0x79ff0
}

PROVIDE ( _SPIFFS_start = 0x4027B000 );
PROVIDE ( _SPIFFS_end = 0x4027B000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );

INCLUDE "eagle.app.v6.common.ld"
9 changes: 6 additions & 3 deletions tools/sdk/ld/eagle.flash.512k128.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 512K chips */
/* sketch 359KB */
/* spiffs 128KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~359KB) (368624B) */
/* empty @0x40259FF0 (~4KB) (4112B) */
/* spiffs @0x4025B000 (~128KB) (131072B) */
/* eeprom @0x4027B000 (=4KB) */
/* rfcal @0x4027C000 (=4KB) */
/* wifi @0x4027D000 (=12KB) */

MEMORY
{
Expand Down
9 changes: 6 additions & 3 deletions tools/sdk/ld/eagle.flash.512k32.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 512K chips */
/* sketch 455KB */
/* spiffs 32KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~455KB) (466928B) */
/* empty @0x40271FF0 (~4KB) (4112B) */
/* spiffs @0x40273000 (~32KB) (32768B) */
/* eeprom @0x4027B000 (=4KB) */
/* rfcal @0x4027C000 (=4KB) */
/* wifi @0x4027D000 (=12KB) */

MEMORY
{
Expand Down
9 changes: 6 additions & 3 deletions tools/sdk/ld/eagle.flash.512k64.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Flash Split for 512K chips */
/* sketch 423KB */
/* spiffs 64KB */
/* eeprom 20KB */
/* sketch @0x40200000 (~423KB) (434160B) */
/* empty @0x40269FF0 (~4KB) (4112B) */
/* spiffs @0x4026B000 (~64KB) (65536B) */
/* eeprom @0x4027B000 (=4KB) */
/* rfcal @0x4027C000 (=4KB) */
/* wifi @0x4027D000 (=12KB) */

MEMORY
{
Expand Down
Loading

4 comments on commit cc0bfa0

@reaper7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

complete removal definitions like _SPIFFS_start, _SPIFFS_end, _SPIFFS_page, _SPIFFS_block from ld scripts for nonSPIFFS options is a good solution? They should not be preserved?
I can't compile any sketch from examples that uses references to Updater.cpp (like BasicOTA, httpUpdate)
I got errors like this for board 1M0 or 4M0:

core\core.a(Updater.cpp.o):(.text._ZN12UpdaterClass5beginEji+0xc): undefined reference to `_SPIFFS_start'
collect2.exe: error: ld returned 1 exit status

As defined in https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#update-process-memory-view :
The new sketch will be stored in the space between the old sketch and the spiff
so... _SPIFFS_start should be specified even if spiffs size is 0

@d-a-v
Copy link
Collaborator Author

@d-a-v d-a-v commented on cc0bfa0 Sep 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix coming

@d-a-v
Copy link
Collaborator Author

@d-a-v d-a-v commented on cc0bfa0 Sep 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed by cee458a
Thanks

@reaper7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works now
tnx too!

Please sign in to comment.