diff --git a/boards/wifi_slot.json b/boards/wifi_slot.json new file mode 100644 index 0000000..b5ab7a4 --- /dev/null +++ b/boards/wifi_slot.json @@ -0,0 +1,30 @@ +{ + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_AMPERKA_WIFI_SLOT", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "qio", + "ldscript": "eagle.flash.1m0.ld", + "mcu": "esp8266", + "variant": "wifi_slot" + }, + "connectivity": [ + "wifi" + ], + "frameworks": [ + "arduino", + "esp8266-rtos-sdk", + "esp8266-nonos-sdk" + ], + "name": "WiFi Slot", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 4194304, + "require_upload_port": true, + "resetmethod": "nodemcu", + "speed": 115200 + }, + "url": "http://wiki.amperka.ru/wifi-slot", + "vendor": "Amperka" +} diff --git a/boards/wifiduino.json b/boards/wifiduino.json new file mode 100644 index 0000000..cef3c51 --- /dev/null +++ b/boards/wifiduino.json @@ -0,0 +1,30 @@ +{ + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_WIFIDUINO_ESP8266", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "eagle.flash.4m1m.ld", + "mcu": "esp8266", + "variant": "wifiduino" + }, + "connectivity": [ + "wifi" + ], + "frameworks": [ + "arduino", + "esp8266-rtos-sdk", + "esp8266-nonos-sdk" + ], + "name": "WiFiduino", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 4194304, + "require_upload_port": true, + "resetmethod": "nodemcu", + "speed": 115200 + }, + "url": "https://www.facebook.com/WifiDuino/", + "vendor": "WifiDuino" +} diff --git a/boards/wio_link.json b/boards/wio_link.json new file mode 100644 index 0000000..9fe7140 --- /dev/null +++ b/boards/wio_link.json @@ -0,0 +1,30 @@ +{ + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_AMPERKA_WIFI_SLOT", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "qio", + "ldscript": "eagle.flash.4m1m.ld", + "mcu": "esp8266", + "variant": "wiolink" + }, + "connectivity": [ + "wifi" + ], + "frameworks": [ + "arduino", + "esp8266-rtos-sdk", + "esp8266-nonos-sdk" + ], + "name": "Wio Link", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 4194304, + "require_upload_port": true, + "resetmethod": "nodemcu", + "speed": 115200 + }, + "url": "https://www.seeedstudio.com/Wio-Link-p-2604.html", + "vendor": "SeeedStudio" +} diff --git a/boards/xinabox_cw01.json b/boards/xinabox_cw01.json new file mode 100644 index 0000000..ee5e145 --- /dev/null +++ b/boards/xinabox_cw01.json @@ -0,0 +1,30 @@ +{ + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_GENERIC", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "qio", + "ldscript": "eagle.flash.4m1m.ld", + "mcu": "esp8266", + "variant": "xinabox" + }, + "connectivity": [ + "wifi" + ], + "frameworks": [ + "arduino", + "esp8266-rtos-sdk", + "esp8266-nonos-sdk" + ], + "name": "XinaBox CW01", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 4194304, + "require_upload_port": true, + "resetmethod": "nodemcu", + "speed": 115200 + }, + "url": "https://xinabox.cc/products/cw01", + "vendor": "XinaBox" +} diff --git a/builder/frameworks/_bare.py b/builder/frameworks/_bare.py new file mode 100644 index 0000000..839548f --- /dev/null +++ b/builder/frameworks/_bare.py @@ -0,0 +1,91 @@ +# Copyright 2014-present PlatformIO +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# Default flags for bare-metal programming (without any framework layers) +# + +from os.path import join + +from SCons.Script import Import + +Import("env") + +env.Append( + ASFLAGS=["-x", "assembler-with-cpp"], + + CFLAGS=[ + "-std=gnu99", + "-Wpointer-arith", + "-Wno-implicit-function-declaration", + "-Wl,-EL", + "-fno-inline-functions", + "-nostdlib" + ], + + CCFLAGS=[ + "-Os", # optimize for size + "-mlongcalls", + "-mtext-section-literals", + "-falign-functions=4", + "-U__STRICT_ANSI__", + "-ffunction-sections", + "-fdata-sections" + ], + + CXXFLAGS=[ + "-fno-rtti", + "-fno-exceptions", + "-std=c++11" + ], + + CPPDEFINES=[ + ("F_CPU", "$BOARD_F_CPU"), + "__ets__", + "ICACHE_FLASH" + ], + + LINKFLAGS=[ + "-Os", + "-nostdlib", + "-Wl,--no-check-sections", + "-u", "call_user_start", + "-u", "_printf_float", + "-u", "_scanf_float", + "-Wl,-static", + "-Wl,--gc-sections" + ], + + CPPPATH=[ + join("$SDK_ESP8266_DIR", "include"), "$PROJECTSRC_DIR" + ], + + LIBPATH=[ + join("$SDK_ESP8266_DIR", "lib"), + join("$SDK_ESP8266_DIR", "ld") + ], + + LIBS=[ + "c", "gcc", "phy", "pp", "net80211", "lwip", "wpa", "wpa2", + "main", "wps", "crypto", "json", "ssl", "pwm", "upgrade", + "smartconfig", "airkiss", "at" + ] +) + +# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode) +env.Append(ASFLAGS=env.get("CCFLAGS", [])[:]) + +env.Replace( + UPLOAD_ADDRESS="0x40000" +) diff --git a/builder/frameworks/esp8266-nonos-sdk.py b/builder/frameworks/esp8266-nonos-sdk.py index 43969c1..4571fe3 100644 --- a/builder/frameworks/esp8266-nonos-sdk.py +++ b/builder/frameworks/esp8266-nonos-sdk.py @@ -30,7 +30,52 @@ FRAMEWORK_DIR = platform.get_package_dir("framework-esp8266-nonos-sdk") assert isdir(FRAMEWORK_DIR) -env.Prepend( +env.Append( + ASFLAGS=["-x", "assembler-with-cpp"], + + CFLAGS=[ + "-std=gnu99", + "-Wpointer-arith", + "-Wno-implicit-function-declaration", + "-Wl,-EL", + "-fno-inline-functions", + "-nostdlib" + ], + + CCFLAGS=[ + "-Os", # optimize for size + "-mlongcalls", + "-mtext-section-literals", + "-falign-functions=4", + "-U__STRICT_ANSI__", + "-ffunction-sections", + "-fdata-sections", + "-fno-builtin-printf" + ], + + CXXFLAGS=[ + "-fno-rtti", + "-fno-exceptions", + "-std=c++11" + ], + + LINKFLAGS=[ + "-Os", + "-nostdlib", + "-Wl,--no-check-sections", + "-Wl,-static", + "-Wl,--gc-sections", + "-u", "call_user_start", + "-u", "_printf_float", + "-u", "_scanf_float" + ], + + CPPDEFINES=[ + ("F_CPU", "$BOARD_F_CPU"), + "__ets__", + "ICACHE_FLASH" + ], + CPPPATH=[ join(FRAMEWORK_DIR, "include"), join(FRAMEWORK_DIR, "extra_include"), @@ -43,6 +88,7 @@ join(FRAMEWORK_DIR, "include", "ssl"), join(FRAMEWORK_DIR, "include", "json"), join(FRAMEWORK_DIR, "include", "openssl"), + join("$SDK_ESP8266_DIR", "include"), "$PROJECTSRC_DIR" ], LIBPATH=[ @@ -56,8 +102,12 @@ ] ) +# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode) +env.Append(ASFLAGS=env.get("CCFLAGS", [])[:]) + env.Replace( LDSCRIPT_PATH=[join(FRAMEWORK_DIR, "ld", "eagle.app.v6.ld")], + UPLOAD_ADDRESS="0x10000" ) # diff --git a/builder/frameworks/esp8266-rtos-sdk.py b/builder/frameworks/esp8266-rtos-sdk.py index 4b4ee63..4c8fc64 100644 --- a/builder/frameworks/esp8266-rtos-sdk.py +++ b/builder/frameworks/esp8266-rtos-sdk.py @@ -31,7 +31,51 @@ FRAMEWORK_DIR = platform.get_package_dir("framework-esp8266-rtos-sdk") assert isdir(FRAMEWORK_DIR) -env.Prepend( +env.Append( + ASFLAGS=["-x", "assembler-with-cpp"], + + CFLAGS=[ + "-std=gnu99", + "-Wpointer-arith", + "-Wno-implicit-function-declaration", + "-Wl,-EL", + "-fno-inline-functions", + "-nostdlib" + ], + + CCFLAGS=[ + "-Os", # optimize for size + "-mlongcalls", + "-mtext-section-literals", + "-falign-functions=4", + "-U__STRICT_ANSI__", + "-ffunction-sections", + "-fdata-sections" + ], + + CXXFLAGS=[ + "-fno-rtti", + "-fno-exceptions", + "-std=c++11" + ], + + LINKFLAGS=[ + "-Os", + "-nostdlib", + "-Wl,--no-check-sections", + "-Wl,-static", + "-Wl,--gc-sections", + "-u", "call_user_start", + "-u", "_printf_float", + "-u", "_scanf_float" + ], + + CPPDEFINES=[ + ("F_CPU", "$BOARD_F_CPU"), + "__ets__", + "ICACHE_FLASH" + ], + CPPPATH=[ join(FRAMEWORK_DIR, "include"), join(FRAMEWORK_DIR, "extra_include"), @@ -58,8 +102,12 @@ ] ) +# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode) +env.Append(ASFLAGS=env.get("CCFLAGS", [])[:]) + env.Replace( LDSCRIPT_PATH=[join(FRAMEWORK_DIR, "ld", "eagle.app.v6.ld")], + UPLOAD_ADDRESS="0x20000" ) # diff --git a/builder/frameworks/simba.py b/builder/frameworks/simba.py index 2478bd2..f402ec0 100755 --- a/builder/frameworks/simba.py +++ b/builder/frameworks/simba.py @@ -23,7 +23,7 @@ from os.path import join, sep -from SCons.Script import DefaultEnvironment, SConscript +from SCons.Script import DefaultEnvironment from platformio.builder.tools import platformio as platformio_tool @@ -50,9 +50,14 @@ def VariantDirWrap(env, variant_dir, src_dir, duplicate=False): env.AddMethod(LookupSources) env.AddMethod(VariantDirWrap) +env.Append( + CPPDEFINES=[ + ("F_CPU", "$BOARD_F_CPU") + ] +) env.Replace( PLATFORMFW_DIR=env.PioPlatform().get_package_dir("framework-simba") ) -SConscript( +env.SConscript( [env.subst(join("$PLATFORMFW_DIR", "make", "platformio.sconscript"))]) diff --git a/builder/main.py b/builder/main.py index 04dcef9..bec0788 100644 --- a/builder/main.py +++ b/builder/main.py @@ -141,50 +141,6 @@ def _update_max_upload_size(env): ARFLAGS=["rc"], - ASFLAGS=["-x", "assembler-with-cpp"], - - CFLAGS=[ - "-std=gnu99", - "-Wpointer-arith", - "-Wno-implicit-function-declaration", - "-Wl,-EL", - "-fno-inline-functions", - "-nostdlib" - ], - - CCFLAGS=[ - "-Os", # optimize for size - "-mlongcalls", - "-mtext-section-literals", - "-falign-functions=4", - "-U__STRICT_ANSI__", - "-ffunction-sections", - "-fdata-sections" - ], - - CXXFLAGS=[ - "-fno-rtti", - "-fno-exceptions", - "-std=c++11" - ], - - CPPDEFINES=[ - ("F_CPU", "$BOARD_F_CPU"), - "__ets__", - "ICACHE_FLASH" - ], - - LINKFLAGS=[ - "-Os", - "-nostdlib", - "-Wl,--no-check-sections", - "-u", "call_user_start", - "-u", "_printf_float", - "-u", "_scanf_float", - "-Wl,-static", - "-Wl,--gc-sections" - ], - # # Packages # @@ -230,10 +186,6 @@ def _update_max_upload_size(env): PROGSUFFIX=".elf" ) -env.Append( - ASFLAGS=env.get("CCFLAGS", [])[:] -) - if int(ARGUMENTS.get("PIOVERBOSE", 0)): env.Prepend(UPLOADERFLAGS=["-vv"]) @@ -316,47 +268,6 @@ def _update_max_upload_size(env): env.Replace(UPLOADCMD="$UPLOADOTACMD") else: - upload_address = None - if env.subst("$PIOFRAMEWORK") == "esp8266-rtos-sdk": - env.Replace( - UPLOAD_ADDRESS="0x20000", - ) - - # Configure NONOS SDK - elif env.subst("$PIOFRAMEWORK") == "esp8266-nonos-sdk": - env.Append( - CPPPATH=[ - join("$SDK_ESP8266_DIR", "include"), "$PROJECTSRC_DIR" - ], - CCFLAGS=[ - "-fno-builtin-printf", - ] - ) - env.Replace( - UPLOAD_ADDRESS="0x10000", - ) - - # Configure Native SDK - else: - env.Append( - CPPPATH=[ - join("$SDK_ESP8266_DIR", "include"), "$PROJECTSRC_DIR" - ], - - LIBPATH=[ - join("$SDK_ESP8266_DIR", "lib"), - join("$SDK_ESP8266_DIR", "ld") - ], - ) - env.Replace( - LIBS=[ - "c", "gcc", "phy", "pp", "net80211", "lwip", "wpa", "wpa2", - "main", "wps", "crypto", "json", "ssl", "pwm", "upgrade", - "smartconfig", "airkiss", "at" - ], - UPLOAD_ADDRESS="0X40000" - ) - # ESP8266 RTOS SDK and Native SDK common configuration env.Append( BUILDERS=dict( @@ -395,6 +306,9 @@ def _update_max_upload_size(env): UPLOADCMD='$UPLOADER $UPLOADERFLAGS', ) +if not env.get("PIOFRAMEWORK"): + env.SConscript("frameworks/_bare.py", exports="env") + # # Target: Build executable and linkable firmware or SPIFFS image # diff --git a/examples/esp8266-nonos-sdk-blink/platformio.ini b/examples/esp8266-nonos-sdk-blink/platformio.ini index c2ede74..5a8c975 100644 --- a/examples/esp8266-nonos-sdk-blink/platformio.ini +++ b/examples/esp8266-nonos-sdk-blink/platformio.ini @@ -12,4 +12,4 @@ platform = espressif8266 board = esp12e framework = esp8266-nonos-sdk -monitor_baud = 74880 +monitor_speed = 74880 diff --git a/platform.json b/platform.json index 991991c..1144bf0 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-espressif8266.git" }, - "version": "1.7.3", + "version": "1.8.0", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json", @@ -46,7 +46,7 @@ "framework-arduinoespressif8266": { "type": "framework", "optional": true, - "version": "~1.20401.1" + "version": "~2.20402.0" }, "framework-esp8266-rtos-sdk": { "type": "framework",