Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Check if files generated by boards.txt.py are up to date #4379

Merged
merged 7 commits into from
Feb 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boards.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# this file is script-generated and is likely to be overwritten by ./tools/boards.txt.py
# this file is script-generated and is likely to be overwritten by boards.txt.py
#

menu.BoardModel=Model
Expand Down
41 changes: 28 additions & 13 deletions package/package_esp8266com_index.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@
"name": "Generic ESP8266 Module"
},
{
"name": "Olimex MOD-WIFI-ESP8266(-DEV)"
},
{
"name": "NodeMCU 0.9 (ESP-12 Module)"
"name": "Generic ESP8285 Module"
},
{
"name": "NodeMCU 1.0 (ESP-12E Module)"
"name": "ESPDuino (ESP-13 Module)"
},
{
"name": "Adafruit HUZZAH ESP8266 (ESP-12)"
"name": "Adafruit Feather HUZZAH ESP8266"
},
{
"name": "ESPresso Lite 1.0"
Expand All @@ -46,36 +43,54 @@
},
{
"name": "Phoenix 2.0"
},
},
{
"name": "SparkFun Thing"
"name": "NodeMCU 0.9 (ESP-12 Module)"
},
{
"name": "NodeMCU 1.0 (ESP-12E Module)"
},
{
"name": "Olimex MOD-WIFI-ESP8266(-DEV)"
},
{
"name": "SparkFun ESP8266 Thing"
},
{
"name": "SparkFun ESP8266 Thing Dev"
},
{
"name": "SweetPea ESP-210"
},
{
"name": "WeMos D1"
"name": "WeMos D1 R2 & mini"
},
{
"name": "WeMos D1 mini Pro"
},
{
"name": "WeMos D1 mini Lite"
},
{
"name": "WeMos D1 mini"
"name": "WeMos D1 R1"
},
{
"name": "ESPino (ESP-12 Module)"
},
{
"name": "ESPino (WROOM-02 Module)"
"name": "ThaiEasyElec's ESPino"
},
{
"name": "WifInfo"
},
{
"name": "ESPDuino"
"name": "Arduino"
},
{
"name": "4D Systems gen4 IoD Range"
},
{
"name": "DigiStump Oak"
"name": "Digistump Oak"
}
],
"toolsDependencies": [
Expand Down
14 changes: 13 additions & 1 deletion tests/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ function build_package()
./build_boards_manager_package.sh
}

function build_boards()
{
echo -e "travis_fold:start:build_boards"
tools/boards.txt.py --boardsgen --ldgen --packagegen --docgen
git diff --exit-code -- boards.txt \
package/package_esp8266com_index.template.json \
doc/boards.rst \
tools/sdk/ld/
echo -e "travis_fold:end:build_boards"
}

function install_platformio()
{
Expand Down Expand Up @@ -217,7 +227,9 @@ elif [ "$BUILD_TYPE" = "docs" ]; then
cd $TRAVIS_BUILD_DIR/doc
build_docs
elif [ "$BUILD_TYPE" = "package" ]; then
# Build release package
# Check that boards.txt, ld scripts, package JSON template, and boards.rst are up to date
build_boards
# Build release package
cd $TRAVIS_BUILD_DIR/package
build_package
elif [ "$BUILD_TYPE" = "host_tests" ]; then
Expand Down
72 changes: 39 additions & 33 deletions tools/boards.txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ def flash_size (display, optname, ld, desc, max_upload_size, spiffs_start = 0, s
( menub + 'spiffs_pagesize', '256' ),
( menu + '.upload.maximum_size', "%i" % max_upload_size ),
])
if spiffs_start > 0:
if spiffs_size > 0:
d.update(collections.OrderedDict([
( menub + 'spiffs_start', "0x%05X" % spiffs_start ),
( menub + 'spiffs_end', "0x%05X" % (spiffs_start + spiffs_size) ),
Expand Down Expand Up @@ -1008,15 +1008,24 @@ def flash_size (display, optname, ld, desc, max_upload_size, spiffs_start = 0, s
else:
page = 0x100
block = 0x2000
print "/* file %s */" % ld
print "/* Flash Split for %s chips */" % optname

print "/* Flash Split for %s chips */" % display
print "/* sketch %dKB */" % (max_upload_size / 1024)
if spiffs_size > 0:
empty_size = spiffs_start - max_upload_size - 4096
if empty_size > 1024:
print "/* empty %dKB */" % (empty_size / 1024)
print "/* spiffs %dKB */" % (spiffs_size / 1024)
print "/* eeprom 20KB */"
print ""
print "MEMORY"
print "{"
print " dport0_0_seg : org = 0x3FF00000, len = 0x10"
print " dram0_0_seg : org = 0x3FFE8000, len = 0x14000"
print " iram1_0_seg : org = 0x40100000, len = 0x8000"
print " irom0_0_seg : org = 0x40201010, len = 0x%x" % max_upload_size
print "}"
print ""
print "PROVIDE ( _SPIFFS_start = 0x%08X );" % (0x40200000 + spiffs_start)
print "PROVIDE ( _SPIFFS_end = 0x%08X );" % (0x40200000 + spiffs_start + spiffs_size)
print "PROVIDE ( _SPIFFS_page = 0x%X );" % page
Expand All @@ -1031,10 +1040,10 @@ def flash_size (display, optname, ld, desc, max_upload_size, spiffs_start = 0, s
return d

def all_flash_size ():
f512 = flash_size('512K', '512K0', 'eagle.flash.512k0.ld', 'no SPIFFS', 499696)
f512 = flash_size('512K', '512K0', 'eagle.flash.512k0.ld', 'no SPIFFS', 499696, 0x7B000)
f512.update(flash_size('512K', '512K64', 'eagle.flash.512k64.ld', '64K SPIFFS', 434160, 0x6B000, 0x10000, 4096))
f512.update(flash_size('512K', '512K128', 'eagle.flash.512k128.ld', '128K SPIFFS', 368624, 0x5B000, 0x20000, 4096))
f1m = flash_size( '1M', '1M0', 'eagle.flash.1m0.ld', 'no SPIFFS', 1023984)
f1m = flash_size( '1M', '1M0', 'eagle.flash.1m0.ld', 'no SPIFFS', 1023984, 0xFB000)
f1m.update( flash_size( '1M', '1M64', 'eagle.flash.1m64.ld', '64K SPIFFS', 958448, 0xEB000, 0x10000, 4096))
f1m.update( flash_size( '1M', '1M128', 'eagle.flash.1m128.ld', '128K SPIFFS', 892912, 0xDB000, 0x20000, 4096))
f1m.update( flash_size( '1M', '1M144', 'eagle.flash.1m144.ld', '144K SPIFFS', 876528, 0xD7000, 0x24000, 4096))
Expand Down Expand Up @@ -1093,7 +1102,7 @@ def all_boards ():
macros.update(led(led_default, led_max))

print '#'
print '# this file is script-generated and is likely to be overwritten by ' + sys.argv[0]
print '# this file is script-generated and is likely to be overwritten by ' + os.path.basename(sys.argv[0])
print '#'
print ''
print 'menu.BoardModel=Model'
Expand Down Expand Up @@ -1173,21 +1182,18 @@ def package ():
filestr = package_file.read()

substitution = '"boards": [\n'
for id in boards:
substitution += ' {\n "name": "' + boards[id]['name'] + '"\n },\n'
substitution += ' ],'
board_items = [' {\n "name": "%s"\n }' % boards[id]['name']
for id in boards]
substitution += ',\n'.join(board_items)
substitution += '\n ],'

newfilestr = re.sub(r'"boards":[^\]]*\],', substitution, filestr, re.MULTILINE)

if packagegen:
realstdout = sys.stdout
sys.stdout = open(pkgfname, 'w')

print newfilestr

if packagegen:
sys.stdout.close()
sys.stdout = realstdout
with open(pkgfname, 'w') as package_file:
package_file.write(newfilestr)
else:
sys.stdout.write(newfilestr)

################################################################

Expand Down Expand Up @@ -1237,24 +1243,24 @@ def usage (name,ret):
print ""
print "usage: %s [options]" % name
print ""
print " -h, --help"
print " --lwip - preferred default lwIP version (default %d)" % lwip
print " --led - preferred default builtin led for generic boards (default %d)" % led_default
print " --board b - board to modify:"
print " --speed s - change default serial speed"
print " --customspeed s - new serial speed for all boards"
print " --nofloat - disable float support in printf/scanf"
print " -h, --help"
print " --lwip - preferred default lwIP version (default %d)" % lwip
print " --led - preferred default builtin led for generic boards (default %d)" % led_default
print " --board b - board to modify:"
print " --speed s - change default serial speed"
print " --customspeed s - new serial speed for all boards"
print " --nofloat - disable float support in printf/scanf"
print ""
print " mandatory option (at least one):"
print " mandatory option (at least one):"
print ""
print " --boards - show boards.txt"
print " --boardsgen - replace boards.txt"
print " --ld - show ldscripts"
print " --ldgen - replace ldscripts"
print " --package - show package"
print " --packagegen - replace board:[] in package"
print " --doc - shows doc/boards.rst"
print " --docgen - replace doc/boards.rst"
print " --boards - show boards.txt"
print " --boardsgen - replace boards.txt"
print " --ld - show ldscripts"
print " --ldgen - replace ldscripts"
print " --package - show package"
print " --packagegen - replace board:[] in package"
print " --doc - shows doc/boards.rst"
print " --docgen - replace doc/boards.rst"
print ""

out = ""
Expand Down
6 changes: 3 additions & 3 deletions tools/sdk/ld/eagle.flash.1m0.ld
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Flash Split for 1M chips, no SPIFFS */
/* Flash Split for 1M chips */
/* sketch 999KB */
/* eeprom 20KB */

Expand All @@ -12,7 +12,7 @@ MEMORY

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

INCLUDE "../ld/eagle.app.v6.common.ld"
6 changes: 3 additions & 3 deletions tools/sdk/ld/eagle.flash.512k0.ld
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Flash Split for 512K chips, no SPIFFS */
/* Flash Split for 512K chips */
/* sketch 487KB */
/* eeprom 20KB */

Expand All @@ -12,7 +12,7 @@ MEMORY

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

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