-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial ldscripts refactoring * add missing menu options * board for 2.3.0 and 2.4.2 * test with core 2.5.0 * typo * ...same typo in other boards.local.txt * generate boards.local.txt from common template * Depend on file presence instead of platform version * sdk selection * Override only relevant entries * generate ldscripts * formatting * unused * fix section scope * fix linker script comment and build getting stuck * py2 compat platformio from pip still does not support py3 * add TODO for py3 * chmod +x, remove leading newline * comment with real spiffs size * fixup! chmod +x, remove leading newline * regenerate all ldscripts * Preventive fix of spiffs_end calculation * update arg parsing * generate only 2.3.0 and latest * readme for boards.local.txt * Update ldscript readme * unique flash sizes * fix sub * line break * correct way to get framework path * Alias for _FS_... symbols * unused 2m1m1s * bump? * show travis logs * ensure latest toolchain for travis * check platform packages when building
- Loading branch information
Showing
26 changed files
with
844 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ | |
|
||
Import("env", "projenv") | ||
|
||
PIO_PLATFORM = env.PioPlatform() | ||
FRAMEWORK_DIR = PIO_PLATFORM.get_package_dir("framework-arduinoespressif8266") | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Utils | ||
# ------------------------------------------------------------------------------ | ||
|
@@ -44,6 +47,31 @@ def print_filler(fill, color=Color.WHITE, err=False): | |
out = sys.stderr if err else sys.stdout | ||
print(clr(color, fill * width), file=out) | ||
|
||
def ldscript_inject_libpath(): | ||
|
||
# [email protected] did not append this directory into the LIBPATH | ||
libpath_sdk = os.path.join(FRAMEWORK_DIR, "tools", "sdk", "ld") | ||
env.Append(LIBPATH=[libpath_sdk]) | ||
|
||
libpath_base = os.path.join("$PROJECT_DIR", "..", "dist", "ld") | ||
env.Append(LIBPATH=[ | ||
os.path.join(libpath_base, "pre_2.5.0") | ||
]) | ||
|
||
# local.eagle.app.v6.common.ld exists only with Core >2.5.0 | ||
def check_local_ld(target ,source, env): | ||
local_ld = env.subst(os.path.join("$BUILD_DIR", "ld", "local.eagle.app.v6.common.ld")) | ||
if os.path.exists(local_ld): | ||
env.Prepend(LIBPATH=[ | ||
os.path.join(libpath_base, "latest") | ||
]) | ||
|
||
env.AddPreAction( | ||
os.path.join("$BUILD_DIR", "firmware.elf"), | ||
check_local_ld | ||
) | ||
|
||
|
||
# ------------------------------------------------------------------------------ | ||
# Callbacks | ||
# ------------------------------------------------------------------------------ | ||
|
@@ -97,18 +125,16 @@ def patch_lwip(): | |
if "lwip_gcc" not in env["LIBS"]: | ||
return | ||
|
||
platform = env.PioPlatform() | ||
framework_dir = platform.get_package_dir("framework-arduinoespressif8266") | ||
toolchain_prefix = os.path.join(platform.get_package_dir("toolchain-xtensa"), "bin", "xtensa-lx106-elf-") | ||
toolchain_prefix = os.path.join(PIO_PLATFORM.get_package_dir("toolchain-xtensa"), "bin", "xtensa-lx106-elf-") | ||
|
||
patch_action = env.VerboseAction(" ".join([ | ||
"-patch", "-u", "-N", "-d", | ||
os.path.join(framework_dir, "tools", "sdk", "lwip"), | ||
os.path.join(FRAMEWORK_DIR, "tools", "sdk", "lwip"), | ||
os.path.join("src", "core", "tcp_out.c"), | ||
env.subst(os.path.join("$PROJECT_DIR", "..", "dist", "patches", "lwip_mtu_issue_1610.patch")) | ||
]), "Patching lwip source") | ||
build_action = env.VerboseAction(" ".join([ | ||
"make", "-C", os.path.join(framework_dir, "tools", "sdk", "lwip", "src"), | ||
"make", "-C", os.path.join(FRAMEWORK_DIR, "tools", "sdk", "lwip", "src"), | ||
"install", | ||
"TOOLS_PATH={}".format(toolchain_prefix), | ||
"LWIP_LIB=liblwip_gcc.a" | ||
|
@@ -130,6 +156,7 @@ def patch_lwip(): | |
|
||
# 2.4.0 and up | ||
remove_float_support() | ||
ldscript_inject_libpath() | ||
|
||
# two-step update hint when using 1MB boards | ||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_size) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#version=2.3.0 | ||
|
||
menu.float_support=scanf and printf float support | ||
|
||
generic.menu.FlashSize.1M1S=1M (1 EEPROM Sector, no SPIFFS) | ||
generic.menu.FlashSize.1M1S.build.flash_size=1M | ||
generic.menu.FlashSize.1M1S.build.flash_size_bytes=0x100000 | ||
generic.menu.FlashSize.1M1S.build.flash_ld=eagle.flash.1m0m1s.ld | ||
generic.menu.FlashSize.1M1S.build.spiffs_pagesize=256 | ||
generic.menu.FlashSize.1M1S.upload.maximum_size=1023984 | ||
generic.menu.FlashSize.1M1S.build.rfcal_addr=0xFC000 | ||
generic.menu.FlashSize.2M4S=2M (4 EEPROM Sectors, 1M SPIFFS) | ||
generic.menu.FlashSize.2M4S.build.flash_size=2M | ||
generic.menu.FlashSize.2M4S.build.flash_size_bytes=0x200000 | ||
generic.menu.FlashSize.2M4S.build.flash_ld=eagle.flash.2m1m4s.ld | ||
generic.menu.FlashSize.2M4S.build.spiffs_pagesize=256 | ||
generic.menu.FlashSize.2M4S.upload.maximum_size=1044464 | ||
generic.menu.FlashSize.2M4S.build.rfcal_addr=0x1FC000 | ||
generic.menu.FlashSize.4M1M4S=4M (4 EEPROM Sectors, 1M SPIFFS) | ||
generic.menu.FlashSize.4M1M4S.build.flash_size=4M | ||
generic.menu.FlashSize.4M1M4S.build.flash_size_bytes=0x400000 | ||
generic.menu.FlashSize.4M1M4S.build.flash_ld=eagle.flash.4m1m4s.ld | ||
generic.menu.FlashSize.4M1M4S.build.spiffs_pagesize=256 | ||
generic.menu.FlashSize.4M1M4S.upload.maximum_size=1044464 | ||
generic.menu.FlashSize.4M1M4S.build.rfcal_addr=0x3FC000 | ||
generic.menu.FlashSize.4M3M4S=4M (4 EEPROM Sectors, 3M SPIFFS) | ||
generic.menu.FlashSize.4M3M4S.build.flash_size=4M | ||
generic.menu.FlashSize.4M3M4S.build.flash_size_bytes=0x400000 | ||
generic.menu.FlashSize.4M3M4S.build.flash_ld=eagle.flash.4m3m4s.ld | ||
generic.menu.FlashSize.4M3M4S.build.spiffs_pagesize=256 | ||
generic.menu.FlashSize.4M3M4S.upload.maximum_size=1044464 | ||
generic.menu.FlashSize.4M3M4S.build.rfcal_addr=0x3FC000 | ||
|
||
generic.menu.float_support.disabled=Disabled (Recommended) | ||
generic.menu.float_support.disabled.build.float= | ||
generic.menu.float_support.enabled=Enabled | ||
generic.menu.float_support.enabled.build.float=-u _printf_float -u _scanf_float | ||
|
||
generic.compiler.cpp.extra_flags=-DNO_GLOBAL_EEPROM -DMQTT_MAX_PACKET_SIZE=400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# boards.local.txt for ESPurna | ||
|
||
Additional flash layouts to support multiple EEPROM sectors | ||
|
||
### Installation | ||
|
||
Place boards.local.txt into Arduino hardware directory, in the same directory as the boards.txt file. Depending on platform and ESP8266 installation method, it is one of: | ||
|
||
- Linux (boards manager): `~/.arduino15/packages/esp8266/hardware/esp8266/<version>` | ||
- Linux (git): `~/Arduino/hardware/esp8266com/esp8266/` | ||
- Windows (boards manager): `%LOCALAPPDATA%\Arduino15\packages\esp8266\hardware\esp8266\<version>` | ||
- Windows (git): `~\Documents\Arduino\hardware\esp8266com\esp8266\` | ||
- macOS (boards manager): `~/Library/Arduino15/packages/esp2866/hardware/esp8266/<version>` | ||
- macOS (git): `<application-directory>/Arduino.app/Contents/Java/hardware/esp8266com/esp8266` | ||
|
||
Use `2.3.0/boards.local.txt` for Core version 2.3.0 | ||
Use `latest/boards.local.txt` for all the others | ||
|
||
|
||
### Arduino documentation | ||
|
||
https://arduino-esp8266.readthedocs.io/en/latest/installing.html | ||
https://www.arduino.cc/en/Hacking/Preferences | ||
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification#boardslocaltxt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#version=latest | ||
|
||
menu.float_support=scanf and printf float support | ||
|
||
generic.menu.eesz.1M1S=1M (1 EEPROM Sector, no SPIFFS) | ||
generic.menu.eesz.1M1S.build.flash_size=1M | ||
generic.menu.eesz.1M1S.build.flash_size_bytes=0x100000 | ||
generic.menu.eesz.1M1S.build.flash_ld=eagle.flash.1m0m1s.ld | ||
generic.menu.eesz.1M1S.build.spiffs_pagesize=256 | ||
generic.menu.eesz.1M1S.upload.maximum_size=1023984 | ||
generic.menu.eesz.1M1S.build.rfcal_addr=0xFC000 | ||
generic.menu.eesz.2M4S=2M (4 EEPROM Sectors, 1M SPIFFS) | ||
generic.menu.eesz.2M4S.build.flash_size=2M | ||
generic.menu.eesz.2M4S.build.flash_size_bytes=0x200000 | ||
generic.menu.eesz.2M4S.build.flash_ld=eagle.flash.2m1m4s.ld | ||
generic.menu.eesz.2M4S.build.spiffs_pagesize=256 | ||
generic.menu.eesz.2M4S.upload.maximum_size=1044464 | ||
generic.menu.eesz.2M4S.build.rfcal_addr=0x1FC000 | ||
generic.menu.eesz.4M1M4S=4M (4 EEPROM Sectors, 1M SPIFFS) | ||
generic.menu.eesz.4M1M4S.build.flash_size=4M | ||
generic.menu.eesz.4M1M4S.build.flash_size_bytes=0x400000 | ||
generic.menu.eesz.4M1M4S.build.flash_ld=eagle.flash.4m1m4s.ld | ||
generic.menu.eesz.4M1M4S.build.spiffs_pagesize=256 | ||
generic.menu.eesz.4M1M4S.upload.maximum_size=1044464 | ||
generic.menu.eesz.4M1M4S.build.rfcal_addr=0x3FC000 | ||
generic.menu.eesz.4M3M4S=4M (4 EEPROM Sectors, 3M SPIFFS) | ||
generic.menu.eesz.4M3M4S.build.flash_size=4M | ||
generic.menu.eesz.4M3M4S.build.flash_size_bytes=0x400000 | ||
generic.menu.eesz.4M3M4S.build.flash_ld=eagle.flash.4m3m4s.ld | ||
generic.menu.eesz.4M3M4S.build.spiffs_pagesize=256 | ||
generic.menu.eesz.4M3M4S.upload.maximum_size=1044464 | ||
generic.menu.eesz.4M3M4S.build.rfcal_addr=0x3FC000 | ||
|
||
generic.menu.float_support.disabled=Disabled (Recommended) | ||
generic.menu.float_support.disabled.build.float= | ||
generic.menu.float_support.enabled=Enabled | ||
generic.menu.float_support.enabled.build.float=-u _printf_float -u _scanf_float | ||
|
||
generic.compiler.cpp.extra_flags=-DNO_GLOBAL_EEPROM -DMQTT_MAX_PACKET_SIZE=400 |
Oops, something went wrong.