From c3f78d19779f3a4eb45ab6c3560bc5524487f2cf Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 3 Feb 2016 01:37:43 +0200 Subject: [PATCH 01/16] Temporary disabled "CPPDEFINES" which contain space and break PlatformIO IDE Linter --- HISTORY.rst | 7 +++ platformio/__init__.py | 2 +- platformio/builder/tools/piomisc.py | 53 +++++++++++-------- platformio/ide/tpls/atom/.clang_complete.tpl | 2 +- platformio/ide/tpls/atom/.gcc-flags.json.tpl | 4 +- platformio/ide/tpls/emacs/.clang_complete.tpl | 2 +- 6 files changed, 43 insertions(+), 27 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index f5c1f3b8..3fcd121a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,13 @@ Release Notes PlatformIO 2.0 -------------- +2.8.4 (2016-02-??) +~~~~~~~~~~~~~~~~~~ + +* Temporary disabled ``CPPDEFINES`` which contain space and break PlatformIO + IDE Linter + (`IDE issue #34 `_) + 2.8.3 (2016-02-02) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index 4f8be12c..bdb19b19 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 8, 3) +VERSION = (2, 8, "4.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index dc768ba1..83db55ec 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -141,27 +141,27 @@ def DumpIDEData(env): BOARD_CORE = env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") - def get_includes(): + def get_includes(env_): includes = [] # includes from used framework and libs - for item in env.get("VARIANT_DIRS", []): + for item in env_.get("VARIANT_DIRS", []): if "$BUILDSRC_DIR" in item[0]: continue - includes.append(env.subst(item[1])) + includes.append(env_.subst(item[1])) # custom includes - for item in env.get("CPPPATH", []): + for item in env_.get("CPPPATH", []): if item.startswith("$BUILD_DIR"): continue - includes.append(env.subst(item)) + includes.append(env_.subst(item)) # installed libs - for d in env.get("LIBSOURCE_DIRS", []): - lsd_dir = env.subst(d) - _append_lib_includes(lsd_dir, includes) + for d in env_.get("LIBSOURCE_DIRS", []): + lsd_dir = env_.subst(d) + _append_lib_includes(env_, lsd_dir, includes) # includes from toolchain - toolchain_dir = env.subst( + toolchain_dir = env_.subst( join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN")) toolchain_incglobs = [ join(toolchain_dir, "*", "include*"), @@ -172,19 +172,19 @@ def DumpIDEData(env): return includes - def _append_lib_includes(libs_dir, includes): + def _append_lib_includes(env_, libs_dir, includes): if not isdir(libs_dir): return - for name in env.get("LIB_USE", []) + sorted(listdir(libs_dir)): + for name in env_.get("LIB_USE", []) + sorted(listdir(libs_dir)): if not isdir(join(libs_dir, name)): continue # ignore user's specified libs - if name in env.get("LIB_IGNORE", []): + if name in env_.get("LIB_IGNORE", []): continue if name == "__cores__": if isdir(join(libs_dir, name, BOARD_CORE)): _append_lib_includes( - join(libs_dir, name, BOARD_CORE), includes) + env_, join(libs_dir, name, BOARD_CORE), includes) return include = ( @@ -195,16 +195,16 @@ def DumpIDEData(env): if include not in includes: includes.append(include) - def get_defines(): + def get_defines(env_): defines = [] # global symbols - for item in env.get("CPPDEFINES", []): + for item in env_.get("CPPDEFINES", []): if isinstance(item, list): item = "=".join(item) - defines.append(env.subst(item).replace('\\"', '"')) + defines.append(env_.subst(item).replace('\\"', '"')) # special symbol for Atmel AVR MCU - board = env.get("BOARD_OPTIONS", {}) + board = env_.get("BOARD_OPTIONS", {}) if board and board['platform'] == "atmelavr": defines.append( "__AVR_%s__" % board['build']['mcu'].upper() @@ -213,14 +213,23 @@ def DumpIDEData(env): ) return defines + env_ = env.Clone() + + # TODO tmp fix https://github.com/platformio/platformio-atom-ide/issues/34 + _new_defines = [] + for item in env_.get("CPPDEFINES", []): + if " " not in item: + _new_defines.append(item) + env_.Replace(CPPDEFINES=_new_defines) + return { - "defines": get_defines(), - "includes": get_includes(), - "cc_flags": env.subst("$SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"), - "cxx_flags": env.subst( + "defines": get_defines(env_), + "includes": get_includes(env_), + "cc_flags": env_.subst("$SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"), + "cxx_flags": env_.subst( "$SHCXXFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"), "cxx_path": where_is_program( - env.subst("$CXX"), env.subst("${ENV['PATH']}")) + env_.subst("$CXX"), env_.subst("${ENV['PATH']}")) } diff --git a/platformio/ide/tpls/atom/.clang_complete.tpl b/platformio/ide/tpls/atom/.clang_complete.tpl index 8b8555ef..bc09ec0d 100644 --- a/platformio/ide/tpls/atom/.clang_complete.tpl +++ b/platformio/ide/tpls/atom/.clang_complete.tpl @@ -2,5 +2,5 @@ -I{{include}} % end % for define in defines: --D{{define}} +-D{{!define}} % end \ No newline at end of file diff --git a/platformio/ide/tpls/atom/.gcc-flags.json.tpl b/platformio/ide/tpls/atom/.gcc-flags.json.tpl index 3fac39c7..1a6f5241 100644 --- a/platformio/ide/tpls/atom/.gcc-flags.json.tpl +++ b/platformio/ide/tpls/atom/.gcc-flags.json.tpl @@ -1,7 +1,7 @@ { "execPath": "{{ cxx_path.replace("\\", "/") }}", - "gccDefaultCFlags": "-fsyntax-only {{ cc_flags.replace(' -MMD ', ' ') }}", - "gccDefaultCppFlags": "-fsyntax-only {{ cxx_flags.replace(' -MMD ', ' ') }}", + "gccDefaultCFlags": "-fsyntax-only {{! cc_flags.replace(' -MMD ', ' ').replace('"', '\"') }}", + "gccDefaultCppFlags": "-fsyntax-only {{! cxx_flags.replace(' -MMD ', ' ').replace('"', '\"') }}", "gccErrorLimit": 15, "gccIncludePaths": "{{ ','.join(includes).replace("\\", "/") }}", "gccSuppressWarnings": false diff --git a/platformio/ide/tpls/emacs/.clang_complete.tpl b/platformio/ide/tpls/emacs/.clang_complete.tpl index 8b8555ef..bc09ec0d 100644 --- a/platformio/ide/tpls/emacs/.clang_complete.tpl +++ b/platformio/ide/tpls/emacs/.clang_complete.tpl @@ -2,5 +2,5 @@ -I{{include}} % end % for define in defines: --D{{define}} +-D{{!define}} % end \ No newline at end of file From 45096c31378a865240f20f2aacfdff38a89a3868 Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Tue, 9 Feb 2016 13:58:08 +0200 Subject: [PATCH 02/16] Change libs order. --- platformio/builder/scripts/frameworks/arduino.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/scripts/frameworks/arduino.py b/platformio/builder/scripts/frameworks/arduino.py index 66721d23..e8bf012a 100644 --- a/platformio/builder/scripts/frameworks/arduino.py +++ b/platformio/builder/scripts/frameworks/arduino.py @@ -281,4 +281,4 @@ if "due" in env.subst("$BOARD"): ) libs.append("sam_sam3x8e_gcc_rel") -env.Append(LIBS=libs) +env.Prepend(LIBS=libs) From b17acd7605c5b03050afb1474487e90e6295f51c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 10 Feb 2016 17:16:52 +0200 Subject: [PATCH 03/16] Fix issue with "CPPDEFINES" which contain space and break PlatformIO IDE Linter --- HISTORY.rst | 2 +- platformio/builder/tools/piomisc.py | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 3fcd121a..a63a32dd 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,7 +7,7 @@ PlatformIO 2.0 2.8.4 (2016-02-??) ~~~~~~~~~~~~~~~~~~ -* Temporary disabled ``CPPDEFINES`` which contain space and break PlatformIO +* Fixed issue with ``CPPDEFINES`` which contain space and break PlatformIO IDE Linter (`IDE issue #34 `_) diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index 83db55ec..e366b821 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -215,14 +215,7 @@ def DumpIDEData(env): env_ = env.Clone() - # TODO tmp fix https://github.com/platformio/platformio-atom-ide/issues/34 - _new_defines = [] - for item in env_.get("CPPDEFINES", []): - if " " not in item: - _new_defines.append(item) - env_.Replace(CPPDEFINES=_new_defines) - - return { + data = { "defines": get_defines(env_), "includes": get_includes(env_), "cc_flags": env_.subst("$SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"), @@ -232,6 +225,23 @@ def DumpIDEData(env): env_.subst("$CXX"), env_.subst("${ENV['PATH']}")) } + # https://github.com/platformio/platformio-atom-ide/issues/34 + _new_defines = [] + for item in env_.get("CPPDEFINES", []): + if " " in item: + _new_defines.append(item.replace(" ", "\\\\ ")) + else: + _new_defines.append(item) + env_.Replace(CPPDEFINES=_new_defines) + + data.update({ + "cc_flags": env_.subst("$SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"), + "cxx_flags": env_.subst( + "$SHCXXFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS") + }) + + return data + def GetCompilerType(env): try: From 1a4d1c7d4091c3f4261c638710936ed431cba504 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 10 Feb 2016 17:19:24 +0200 Subject: [PATCH 04/16] Fix unable to link C++ standard library to Espressif platform build // Resolve #503 --- HISTORY.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index a63a32dd..5ea55d36 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -10,6 +10,8 @@ PlatformIO 2.0 * Fixed issue with ``CPPDEFINES`` which contain space and break PlatformIO IDE Linter (`IDE issue #34 `_) +* Fixed unable to link C++ standard library to Espressif platform build + (`issue #503 `_) 2.8.3 (2016-02-02) ~~~~~~~~~~~~~~~~~~ From 6baf6568d2cb5e4f6b7fb7d414d0021f73c3478a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 10 Feb 2016 22:58:12 +0200 Subject: [PATCH 05/16] Add "board_f_flash" option to Project Configuration File // Resolve #501 --- HISTORY.rst | 6 +++- docs/platforms/espressif_extra.rst | 43 ++++++++++++++++++------- docs/projectconf.rst | 11 +++++++ platformio/__init__.py | 2 +- platformio/boards/espressif.json | 11 +++++++ platformio/builder/main.py | 1 + platformio/builder/scripts/espressif.py | 12 +++---- 7 files changed, 67 insertions(+), 19 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 5ea55d36..d2a35725 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,10 @@ PlatformIO 2.0 2.8.4 (2016-02-??) ~~~~~~~~~~~~~~~~~~ +* Added ``board_f_flash`` option to `Project Configuration File platformio.ini `__ + which allows to specify `custom flash frequency `_ + for Espressif development platform + (`issue #501 `_) * Fixed issue with ``CPPDEFINES`` which contain space and break PlatformIO IDE Linter (`IDE issue #34 `_) @@ -46,7 +50,7 @@ PlatformIO 2.0 * Added SPL-Framework support for Nucleo F401RE board (`issue #453 `_) * Added ``upload_resetmethod`` option to `Project Configuration File platformio.ini `__ - and allowed to `change default upload reset method `_ + which allows to specify `custom upload reset method `_ for Espressif development platform (`issue #444 `_) * Allowed to force output of color ANSI-codes or to disable progress bar even diff --git a/docs/platforms/espressif_extra.rst b/docs/platforms/espressif_extra.rst index 2b6d3c88..066ed842 100644 --- a/docs/platforms/espressif_extra.rst +++ b/docs/platforms/espressif_extra.rst @@ -9,19 +9,33 @@ See the License for the specific language governing permissions and limitations under the License. -Custom CPU Frequency or Upload Speed ------------------------------------- +Custom CPU Frequency +-------------------- -See :ref:`projectconf_board_f_cpu` and :ref:`projectconf_upload_speed` options -from :ref:`projectconf` +See :ref:`projectconf_board_f_cpu` option from :ref:`projectconf` .. code-block:: ini [env:myenv] - # set frequency to 40MHz - board_f_cpu = 40000000L + # set frequency to 160MHz + board_f_cpu = 160000000L - upload_speed = 9600 +Custom FLASH Frequency +---------------------- + +See :ref:`projectconf_board_f_flash` option from :ref:`projectconf`. Possible +values: + +* 20000000L +* 26000000L +* 40000000L +* 80000000L + +.. code-block:: ini + + [env:myenv] + # set frequency to 80MHz + board_f_flash = 80000000L Custom Reset Method ------------------- @@ -30,10 +44,7 @@ See :ref:`projectconf_upload_resetmethod` option from :ref:`projectconf` .. code-block:: ini - [env:esp12e] - platform = espressif - framework = arduino - board = esp12e + [env:myenv] upload_resetmethod = ck .. _platform_espressif_customflash: @@ -66,6 +77,16 @@ To override default LD script please use :ref:`projectconf_build_flags` from [env:myenv] build_flags = -Wl,-Tesp8266.flash.4m.ld +Custom Upload Speed +------------------- + +See :ref:`projectconf_upload_speed` option from :ref:`projectconf` + +.. code-block:: ini + + [env:myenv] + upload_speed = 9600 + .. _platform_espressif_uploadfs: Uploading files to file system SPIFFS diff --git a/docs/projectconf.rst b/docs/projectconf.rst index 93aeabc4..f6d92c3b 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -208,6 +208,17 @@ The full list of ``board_f_cpu`` for the popular embedded platforms you can find in *Boards* section of :ref:`platforms`. See "Frequency" column. You can overclock a board by specifying a ``board_f_cpu`` value other than the default. +.. _projectconf_board_f_flash: + +``board_f_flash`` +^^^^^^^^^^^^^^^^^ + +An option ``board_f_flash`` is used to define FLASH chip frequency (Hertz, Clock). A +format of this option is ``C-like long integer`` value with ``L`` suffix. The +1 Hertz is equal to ``1L``, then 40 Mhz (Mega Hertz) is equal to ``40000000L``. + +This option isn't available for the all development platforms. The only +:ref:`platform_espressif` supports it. Building options ~~~~~~~~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index bdb19b19..bf4a5d10 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 8, "4.dev0") +VERSION = (2, 8, "4.dev1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/boards/espressif.json b/platformio/boards/espressif.json index 63a250eb..8fb9617e 100644 --- a/platformio/boards/espressif.json +++ b/platformio/boards/espressif.json @@ -4,6 +4,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.512k64.ld", "mcu": "esp8266", "variant": "generic" @@ -27,6 +28,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.1m256.ld", "mcu": "esp8266", "variant": "generic" @@ -50,6 +52,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "nodemcu" @@ -73,6 +76,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "nodemcu" @@ -96,6 +100,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "adafruit" @@ -119,6 +124,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_MOD_WIFI_ESP8266", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.2m.ld", "mcu": "esp8266", "variant": "generic" @@ -142,6 +148,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_THING", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.512k64.ld", "mcu": "esp8266", "variant": "thing" @@ -165,6 +172,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP210", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "generic" @@ -188,6 +196,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "d1" @@ -211,6 +220,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "d1_mini" @@ -234,6 +244,7 @@ "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", + "f_flash": "40000000L", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "espino" diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 96428dbd..7b325287 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -51,6 +51,7 @@ commonvars.AddVariables( ("BOARD",), ("BOARD_MCU",), ("BOARD_F_CPU",), + ("BOARD_F_FLASH",), # upload options ("UPLOAD_PORT",), diff --git a/platformio/builder/scripts/espressif.py b/platformio/builder/scripts/espressif.py index 80f1574f..590f8d6a 100644 --- a/platformio/builder/scripts/espressif.py +++ b/platformio/builder/scripts/espressif.py @@ -42,17 +42,17 @@ def _get_flash_size(env): else "%dM" % (board_max_size / 1048576)) -def _get_board_f_cpu(env): - f_cpu = env.subst("$BOARD_F_CPU") - f_cpu = str(f_cpu).replace("L", "") - return int(int(f_cpu) / 1000000) +def _get_board_f_flash(env): + frequency = env.subst("$BOARD_F_FLASH") + frequency = str(frequency).replace("L", "") + return int(int(frequency) / 1000000) env = DefaultEnvironment() env.Replace( __get_flash_size=_get_flash_size, - __get_board_f_cpu=_get_board_f_cpu, + __get_board_f_flash=_get_board_f_flash, AR="xtensa-lx106-elf-ar", AS="xtensa-lx106-elf-as", @@ -150,7 +150,7 @@ env.Append( "eboot", "eboot.elf"), "-bo", "$TARGET", "-bm", "dio", - "-bf", "${__get_board_f_cpu(__env__)}", + "-bf", "${__get_board_f_flash(__env__)}", "-bz", "${__get_flash_size(__env__)}", "-bs", ".text", "-bp", "4096", From 45efc0e0d652061bda78a0169b7d278310edaeb9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 10 Feb 2016 23:16:25 +0200 Subject: [PATCH 06/16] Add "board_flash_mode" option to Project Configuration File --- HISTORY.rst | 5 ++++- platformio/boards/espressif.json | 11 +++++++++++ platformio/builder/main.py | 1 + platformio/builder/scripts/espressif.py | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index d2a35725..0a355928 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -8,9 +8,12 @@ PlatformIO 2.0 ~~~~~~~~~~~~~~~~~~ * Added ``board_f_flash`` option to `Project Configuration File platformio.ini `__ - which allows to specify `custom flash frequency `_ + which allows to specify `custom flash chip frequency `_ for Espressif development platform (`issue #501 `_) +* Added ``board_flash_mode`` option to `Project Configuration File platformio.ini `__ + which allows to specify `custom flash chip mode `_ + for Espressif development platform * Fixed issue with ``CPPDEFINES`` which contain space and break PlatformIO IDE Linter (`IDE issue #34 `_) diff --git a/platformio/boards/espressif.json b/platformio/boards/espressif.json index 8fb9617e..d922a3ec 100644 --- a/platformio/boards/espressif.json +++ b/platformio/boards/espressif.json @@ -5,6 +5,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.512k64.ld", "mcu": "esp8266", "variant": "generic" @@ -29,6 +30,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.1m256.ld", "mcu": "esp8266", "variant": "generic" @@ -53,6 +55,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "dio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "nodemcu" @@ -77,6 +80,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "dio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "nodemcu" @@ -101,6 +105,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "adafruit" @@ -125,6 +130,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_MOD_WIFI_ESP8266", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.2m.ld", "mcu": "esp8266", "variant": "generic" @@ -149,6 +155,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_THING", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.512k64.ld", "mcu": "esp8266", "variant": "thing" @@ -173,6 +180,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP210", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "generic" @@ -197,6 +205,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "dio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "d1" @@ -221,6 +230,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "dio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "d1_mini" @@ -245,6 +255,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "espino" diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 7b325287..6c7209bb 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -52,6 +52,7 @@ commonvars.AddVariables( ("BOARD_MCU",), ("BOARD_F_CPU",), ("BOARD_F_FLASH",), + ("BOARD_FLASH_MODE",), # upload options ("UPLOAD_PORT",), diff --git a/platformio/builder/scripts/espressif.py b/platformio/builder/scripts/espressif.py index 590f8d6a..0499c68a 100644 --- a/platformio/builder/scripts/espressif.py +++ b/platformio/builder/scripts/espressif.py @@ -149,7 +149,7 @@ env.Append( '"%s"' % join("$PLATFORMFW_DIR", "bootloaders", "eboot", "eboot.elf"), "-bo", "$TARGET", - "-bm", "dio", + "-bm", "$BOARD_FLASH_MODE", "-bf", "${__get_board_f_flash(__env__)}", "-bz", "${__get_flash_size(__env__)}", "-bs", ".text", From 7e5f6fe22aba1c66cdcc8fe82fee234d88b85594 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 11 Feb 2016 00:00:23 +0200 Subject: [PATCH 07/16] Update docs for board_flash_mode --- docs/platforms/espressif_extra.rst | 29 +++++++++++++++++++++++++---- docs/projectconf.rst | 8 ++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/docs/platforms/espressif_extra.rst b/docs/platforms/espressif_extra.rst index 066ed842..91e5f61c 100644 --- a/docs/platforms/espressif_extra.rst +++ b/docs/platforms/espressif_extra.rst @@ -26,10 +26,10 @@ Custom FLASH Frequency See :ref:`projectconf_board_f_flash` option from :ref:`projectconf`. Possible values: -* 20000000L -* 26000000L -* 40000000L -* 80000000L +* ``20000000L`` +* ``26000000L`` +* ``40000000L`` +* ``80000000L`` .. code-block:: ini @@ -37,6 +37,27 @@ values: # set frequency to 80MHz board_f_flash = 80000000L +Custom FLASH Mode +----------------- + +Flash chip interface mode. This parameter is stored in the binary image +header, along with the flash size and flash frequency. The ROM bootloader +in the ESP chip uses the value of these parameters in order to know how to +talk to the flash chip. + +See :ref:`projectconf_board_flash_mode` option from :ref:`projectconf`. Possible +values: + +* ``qio`` +* ``qout`` +* ``dio`` +* ``dout`` + +.. code-block:: ini + + [env:myenv] + board_flash_mode = qio + Custom Reset Method ------------------- diff --git a/docs/projectconf.rst b/docs/projectconf.rst index f6d92c3b..b1f4ea36 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -220,6 +220,14 @@ format of this option is ``C-like long integer`` value with ``L`` suffix. The This option isn't available for the all development platforms. The only :ref:`platform_espressif` supports it. +.. _projectconf_board_flash_mode: + +``board_flash_mode`` +^^^^^^^^^^^^^^^^^^^^ + +Flash chip interface mode. This option isn't available for the all development +platforms. The only :ref:`platform_espressif` supports it. + Building options ~~~~~~~~~~~~~~~~ From d0d292b80f8c786a7b5e0f181eb9b8e63e76641b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 11 Feb 2016 00:16:43 +0200 Subject: [PATCH 08/16] Add support for the new ESP8266-based boards (ESPDuino, ESP-WROOM-02, ESPresso Lite 1.0 & 2.0, SparkFun ESP8266 Thing Dev, ThaiEasyElec ESPino) to Espressif development platform --- HISTORY.rst | 4 + docs/frameworks/arduino.rst | 81 +++++++++++++- docs/frameworks/mbed.rst | 9 +- docs/platforms/atmelsam.rst | 16 ++- docs/platforms/espressif.rst | 81 +++++++++++++- docs/platforms/nxplpc.rst | 6 +- platformio/boards/espressif.json | 181 ++++++++++++++++++++++++++++++- 7 files changed, 358 insertions(+), 20 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 0a355928..90e25264 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,10 @@ PlatformIO 2.0 2.8.4 (2016-02-??) ~~~~~~~~~~~~~~~~~~ +* Added support for the new ESP8266-based boards (ESPDuino, ESP-WROOM-02, + ESPresso Lite 1.0 & 2.0, SparkFun ESP8266 Thing Dev, ThaiEasyElec ESPino) to + `Espressif `__ + development platform * Added ``board_f_flash`` option to `Project Configuration File platformio.ini `__ which allows to specify `custom flash chip frequency `_ for Espressif development platform diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index 5645ddd1..2ffb72e4 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -482,6 +482,26 @@ Digistump - 512 Kb - 28 Kb +Doit +~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``espduino`` + - `ESPDuino (ESP-13 Module) `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 80 Kb + ESPino ~~~~~~ @@ -570,6 +590,27 @@ Espressif - 4096 Kb - 80 Kb + * - ``esp_wroom_02`` + - `ESP-WROOM-02 `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 50 Kb + + * - ``espresso_lite_v1`` + - `ESPresso Lite 1.0 `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 80 Kb + + * - ``espresso_lite_v2`` + - `ESPresso Lite 2.0 `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 80 Kb + LightUp ~~~~~~~ @@ -707,7 +748,14 @@ NodeMCU - RAM * - ``nodemcu`` - - `NodeMCU 0.9 / 1.0 `_ + - `NodeMCU 0.9 (ESP-12 Module) `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 80 Kb + + * - ``nodemcuv2`` + - `NodeMCU 1.0 (ESP-12E Module) `_ - ESP8266 - 80 MHz - 4096 Kb @@ -1025,6 +1073,13 @@ SparkFun - 512 Kb - 80 Kb + * - ``thingdev`` + - `SparkFun ESP8266 Thing Dev `_ + - ESP8266 + - 80 MHz + - 512 Kb + - 80 Kb + * - ``uview`` - `SparkFun MicroView `_ - ATMEGA328P @@ -1100,6 +1155,26 @@ Teensy - 64 Kb - 8 Kb +ThaiEasyElec +~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``espinotee`` + - `ThaiEasyElec ESPino `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 80 Kb + TinyCircuits ~~~~~~~~~~~~ @@ -1141,14 +1216,14 @@ WeMos - RAM * - ``d1`` - - `WeMos D1 `_ + - `WeMos D1(Retired) `_ - ESP8266 - 80 MHz - 4096 Kb - 80 Kb * - ``d1_mini`` - - `WeMos D1 mini `_ + - `WeMos D1 R2 & mini `_ - ESP8266 - 80 MHz - 4096 Kb diff --git a/docs/frameworks/mbed.rst b/docs/frameworks/mbed.rst index 0419ad82..fc69243f 100644 --- a/docs/frameworks/mbed.rst +++ b/docs/frameworks/mbed.rst @@ -27,6 +27,9 @@ Platforms * - Name - Description + * - :ref:`platform_atmelsam` + - Atmel | SMART offers Flash- based ARM products based on the ARM Cortex-M0+, Cortex-M3 and Cortex-M4 architectures, ranging from 8KB to 2MB of Flash including a rich peripheral and feature mix. + * - :ref:`platform_freescalekinetis` - Freescale Kinetis Microcontrollers is family of multiple hardware- and software-compatible ARM Cortex-M0+, Cortex-M4 and Cortex-M7-based MCU series. Kinetis MCUs offer exceptional low-power performance, scalability and feature integration. @@ -295,7 +298,7 @@ NXP - LPC1768 - 96 MHz - 512 Kb - - 32 Kb + - 64 Kb Nordic ~~~~~~ @@ -605,7 +608,7 @@ SeeedStudio - LPC1768 - 96 MHz - 512 Kb - - 32 Kb + - 64 Kb Silicon Labs ~~~~~~~~~~~~ @@ -740,6 +743,6 @@ u-blox - LPC1768 - 96 MHz - 512 Kb - - 32 Kb + - 64 Kb .. include:: mbed_extra.rst diff --git a/docs/platforms/atmelsam.rst b/docs/platforms/atmelsam.rst index 053f2b67..3f1ce190 100644 --- a/docs/platforms/atmelsam.rst +++ b/docs/platforms/atmelsam.rst @@ -28,17 +28,20 @@ Packages * - Name - Contents + * - ``toolchain-gccarmnoneeabi`` + - `gcc-arm-embedded `_, `GDB `_ + * - ``framework-arduinosam`` - `Arduino Wiring-based Framework (SAM Core, 1.6) `_ - * - ``ldscripts`` - - `Linker Scripts `_ - * - ``tool-openocd`` - `OpenOCD `_ - * - ``toolchain-gccarmnoneeabi`` - - `gcc-arm-embedded `_, `GDB `_ + * - ``framework-mbed`` + - `mbed Framework `_ + + * - ``ldscripts`` + - `Linker Scripts `_ * - ``tool-bossac`` - `BOSSA CLI `_ @@ -63,6 +66,9 @@ Frameworks * - :ref:`framework_arduino` - Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences. + * - :ref:`framework_mbed` + - The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community. + Boards ------ diff --git a/docs/platforms/espressif.rst b/docs/platforms/espressif.rst index 200263f0..34d8662c 100644 --- a/docs/platforms/espressif.rst +++ b/docs/platforms/espressif.rst @@ -95,6 +95,26 @@ Adafruit - 4096 Kb - 80 Kb +Doit +~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``espduino`` + - `ESPDuino (ESP-13 Module) `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 80 Kb + ESPino ~~~~~~ @@ -149,6 +169,27 @@ Espressif - 4096 Kb - 80 Kb + * - ``esp_wroom_02`` + - `ESP-WROOM-02 `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 50 Kb + + * - ``espresso_lite_v1`` + - `ESPresso Lite 1.0 `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 80 Kb + + * - ``espresso_lite_v2`` + - `ESPresso Lite 2.0 `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 80 Kb + NodeMCU ~~~~~~~ @@ -163,7 +204,14 @@ NodeMCU - RAM * - ``nodemcu`` - - `NodeMCU 0.9 / 1.0 `_ + - `NodeMCU 0.9 (ESP-12 Module) `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 80 Kb + + * - ``nodemcuv2`` + - `NodeMCU 1.0 (ESP-12E Module) `_ - ESP8266 - 80 MHz - 4096 Kb @@ -209,6 +257,13 @@ SparkFun - 512 Kb - 80 Kb + * - ``thingdev`` + - `SparkFun ESP8266 Thing Dev `_ + - ESP8266 + - 80 MHz + - 512 Kb + - 80 Kb + SweetPea ~~~~~~~~ @@ -229,6 +284,26 @@ SweetPea - 4096 Kb - 80 Kb +ThaiEasyElec +~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``espinotee`` + - `ThaiEasyElec ESPino `_ + - ESP8266 + - 80 MHz + - 4096 Kb + - 80 Kb + WeMos ~~~~~ @@ -243,14 +318,14 @@ WeMos - RAM * - ``d1`` - - `WeMos D1 `_ + - `WeMos D1(Retired) `_ - ESP8266 - 80 MHz - 4096 Kb - 80 Kb * - ``d1_mini`` - - `WeMos D1 mini `_ + - `WeMos D1 R2 & mini `_ - ESP8266 - 80 MHz - 4096 Kb diff --git a/docs/platforms/nxplpc.rst b/docs/platforms/nxplpc.rst index c06c0934..9eeeb669 100644 --- a/docs/platforms/nxplpc.rst +++ b/docs/platforms/nxplpc.rst @@ -169,7 +169,7 @@ NXP - LPC1768 - 96 MHz - 512 Kb - - 32 Kb + - 64 Kb Outrageous Circuits ~~~~~~~~~~~~~~~~~~~ @@ -209,7 +209,7 @@ SeeedStudio - LPC1768 - 96 MHz - 512 Kb - - 32 Kb + - 64 Kb Solder Splash Labs ~~~~~~~~~~~~~~~~~~ @@ -269,4 +269,4 @@ u-blox - LPC1768 - 96 MHz - 512 Kb - - 32 Kb + - 64 Kb diff --git a/platformio/boards/espressif.json b/platformio/boards/espressif.json index d922a3ec..b3c9728e 100644 --- a/platformio/boards/espressif.json +++ b/platformio/boards/espressif.json @@ -74,7 +74,57 @@ "vendor": "Espressif" }, + "espduino": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP13", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp8266.flash.4m1m.ld", + "mcu": "esp8266", + "variant": "ESPDuino" + }, + "frameworks": ["arduino"], + "name": "ESPDuino (ESP-13 Module)", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 4194304, + "resetmethod": "nodemcu", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "https://www.tindie.com/products/doit/espduinowifi-uno-r3/", + "vendor": "Doit" + }, + "nodemcu": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "qio", + "ldscript": "esp8266.flash.4m1m.ld", + "mcu": "esp8266", + "variant": "nodemcu" + }, + "frameworks": ["arduino"], + "name": "NodeMCU 0.9 (ESP-12 Module)", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 4194304, + "resetmethod": "nodemcu", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "http://www.nodemcu.com/", + "vendor": "NodeMCU" + }, + + "nodemcuv2": { "build": { "core": "esp8266", "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", @@ -86,7 +136,7 @@ "variant": "nodemcu" }, "frameworks": ["arduino"], - "name": "NodeMCU 0.9 / 1.0", + "name": "NodeMCU 1.0 (ESP-12E Module)", "platform": "espressif", "upload": { "maximum_ram_size": 81920, @@ -124,6 +174,56 @@ "vendor": "Adafruit" }, + "espresso_lite_v1": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESPRESSO_LITE_V1", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp8266.flash.4m1m.ld", + "mcu": "esp8266", + "variant": "espresso_lite_v1" + }, + "frameworks": ["arduino"], + "name": "ESPresso Lite 1.0", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 4194304, + "resetmethod": "nodemcu", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family", + "vendor": "Espressif" + }, + + "espresso_lite_v2": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESPRESSO_LITE_V2", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp8266.flash.4m1m.ld", + "mcu": "esp8266", + "variant": "espresso_lite_v2" + }, + "frameworks": ["arduino"], + "name": "ESPresso Lite 2.0", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 4194304, + "resetmethod": "nodemcu", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family", + "vendor": "Espressif" + }, + "modwifi": { "build": { "core": "esp8266", @@ -163,6 +263,31 @@ "frameworks": ["arduino"], "name": "SparkFun ESP8266 Thing", "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 524288, + "resetmethod": "ck", + "require_upload_port" : true, + "speed": 921600 + }, + "url": "https://www.sparkfun.com/products/13231", + "vendor": "SparkFun" + }, + + "thingdev": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_THING", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp8266.flash.512k64.ld", + "mcu": "esp8266", + "variant": "thing" + }, + "frameworks": ["arduino"], + "name": "SparkFun ESP8266 Thing Dev", + "platform": "espressif", "upload": { "maximum_ram_size": 81920, "maximum_size": 524288, @@ -211,7 +336,7 @@ "variant": "d1" }, "frameworks": ["arduino"], - "name": "WeMos D1", + "name": "WeMos D1(Retired)", "platform": "espressif", "upload": { "maximum_ram_size": 81920, @@ -236,7 +361,7 @@ "variant": "d1_mini" }, "frameworks": ["arduino"], - "name": "WeMos D1 mini", + "name": "WeMos D1 R2 & mini", "platform": "espressif", "upload": { "maximum_ram_size": 81920, @@ -272,5 +397,55 @@ }, "url": "http://www.espino.io", "vendor": "ESPino" + }, + + "espinotee": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP13", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "qio", + "ldscript": "esp8266.flash.4m1m.ld", + "mcu": "esp8266", + "variant": "espinotee" + }, + "frameworks": ["arduino"], + "name": "ThaiEasyElec ESPino", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 4194304, + "resetmethod": "ck", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "http://www.thaieasyelec.com/products/wireless-modules/wifi-modules/espino-wifi-development-board-detail.html", + "vendor": "ThaiEasyElec" + }, + + "esp_wroom_02": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP_WROOM_02", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "qio", + "ldscript": "esp8266.flash.4m1m.ld", + "mcu": "esp8266", + "variant": "nodemcu" + }, + "frameworks": ["arduino"], + "name": "ESP-WROOM-02", + "platform": "espressif", + "upload": { + "maximum_ram_size": 51200, + "maximum_size": 4194304, + "resetmethod": "nodemcu", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family", + "vendor": "Espressif" } } From 3484c41b64dc7d83d2d84788b07b2ee0ce7c97f0 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 11 Feb 2016 00:27:41 +0200 Subject: [PATCH 09/16] Fix issue with quotes in CPPDEFINES when dumping data for IDE --- examples/wiring-blink/platformio.ini | 1 - platformio/builder/tools/piomisc.py | 1 + platformio/ide/tpls/atom/.gcc-flags.json.tpl | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/wiring-blink/platformio.ini b/examples/wiring-blink/platformio.ini index b079b0f6..87535386 100644 --- a/examples/wiring-blink/platformio.ini +++ b/examples/wiring-blink/platformio.ini @@ -10,7 +10,6 @@ board = uno platform = espressif framework = arduino board = nodemcu -build_flags = -D LED_BUILTIN=BUILTIN_LED [env:teensy31] platform = teensy diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index e366b821..018ad7f7 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -228,6 +228,7 @@ def DumpIDEData(env): # https://github.com/platformio/platformio-atom-ide/issues/34 _new_defines = [] for item in env_.get("CPPDEFINES", []): + item = item.replace('\\"', '"') if " " in item: _new_defines.append(item.replace(" ", "\\\\ ")) else: diff --git a/platformio/ide/tpls/atom/.gcc-flags.json.tpl b/platformio/ide/tpls/atom/.gcc-flags.json.tpl index 1a6f5241..5af2ea3a 100644 --- a/platformio/ide/tpls/atom/.gcc-flags.json.tpl +++ b/platformio/ide/tpls/atom/.gcc-flags.json.tpl @@ -1,7 +1,7 @@ { "execPath": "{{ cxx_path.replace("\\", "/") }}", - "gccDefaultCFlags": "-fsyntax-only {{! cc_flags.replace(' -MMD ', ' ').replace('"', '\"') }}", - "gccDefaultCppFlags": "-fsyntax-only {{! cxx_flags.replace(' -MMD ', ' ').replace('"', '\"') }}", + "gccDefaultCFlags": "-fsyntax-only {{! cc_flags.replace(' -MMD ', ' ').replace('"', '\\"') }}", + "gccDefaultCppFlags": "-fsyntax-only {{! cxx_flags.replace(' -MMD ', ' ').replace('"', '\\"') }}", "gccErrorLimit": 15, "gccIncludePaths": "{{ ','.join(includes).replace("\\", "/") }}", "gccSuppressWarnings": false From 851f7db825093c4e71465765a0be97fd9ad323c1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 11 Feb 2016 00:43:52 +0200 Subject: [PATCH 10/16] Fix issue with pointer (char* myfunc()) while converting from *.ino to *.cpp // Resolve #506 --- HISTORY.rst | 3 +++ platformio/builder/tools/piomisc.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 90e25264..c2e54e39 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -23,6 +23,9 @@ PlatformIO 2.0 (`IDE issue #34 `_) * Fixed unable to link C++ standard library to Espressif platform build (`issue #503 `_) +* Fixed issue with pointer (``char* myfunc()``) while converting from ``*.ino`` + to ``*.cpp`` + (`issue #506 `_) 2.8.3 (2016-02-02) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index 018ad7f7..f6c38555 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -27,7 +27,7 @@ class InoToCPPConverter(object): PROTOTYPE_RE = re.compile( r"""^( - (\s*[a-z_\d]+){1,2} # return type + (\s*[a-z_\d]+\*?){1,2} # return type (\s+[a-z_\d]+\s*) # name of prototype \([a-z_,\.\*\&\[\]\s\d]*\) # arguments )\s*\{ # must end with { From 69836be1ca0d0643e7178c3176b3f43e3d1891e1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 13 Feb 2016 17:22:17 +0200 Subject: [PATCH 11/16] Show different info about upgrading PlatformIO within CLI or IDE --- README.rst | 2 +- platformio/maintenance.py | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index d6dd9473..2117a686 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,7 @@ PlatformIO :target: https://gitter.im/platformio/platformio .. image:: https://img.shields.io/donate/PlatformIO.png?color=yellow :alt: Donate for PlatformIO.Org - :target: https://www.liqpay.com/api/3/checkout?data=eyJ2ZXJzaW9uIjozLCJhY3Rpb24iOiJwYXlkb25hdGUiLCJwdWJsaWNfa2V5IjoiaTc0NzkxMDA2NjIxIiwiYW1vdW50IjoiMSIsImN1cnJlbmN5IjoiVVNEIiwiZGVzY3JpcHRpb24iOiJEb25hdGlvbiBmb3IgUGxhdGZvcm1JTy5PcmciLCJ0eXBlIjoiZG9uYXRlIiwibGFuZ3VhZ2UiOiJlbiJ9&signature=XYvETjqlpoFhoFtxUJlF6hQyS7Y%3D + :target: http://platformio.org/donate/ `Home & Demo `_ | diff --git a/platformio/maintenance.py b/platformio/maintenance.py index c727e635..b281879c 100644 --- a/platformio/maintenance.py +++ b/platformio/maintenance.py @@ -146,12 +146,15 @@ def after_upgrade(ctx): click.style("star", fg="cyan"), click.style("https://github.com/platformio/platformio", fg="cyan") )) - if not getenv("PLATFORMIO_IDE"): click.echo("- %s PlatformIO IDE for IoT development > %s" % ( click.style("try", fg="cyan"), click.style("http://platformio.org/", fg="cyan") )) + click.echo("- %s to keep PlatformIO alive! > %s" % ( + click.style("donate", fg="cyan"), + click.style("http://platformio.org/donate/", fg="cyan") + )) click.echo("*" * terminal_width) click.echo("") @@ -200,10 +203,16 @@ def check_platformio_upgrade(): click.secho("There is a new version %s of PlatformIO available.\n" "Please upgrade it via `" % latest_version, fg="yellow", nl=False) - click.secho("platformio upgrade", fg="cyan", nl=False) - click.secho("` or `", fg="yellow", nl=False) - click.secho("pip install -U platformio", fg="cyan", nl=False) - click.secho("` command.\nChanges: ", fg="yellow", nl=False) + if getenv("PLATFORMIO_IDE"): + click.secho("PlatformIO IDE Menu: Upgrade PlatformIO", + fg="cyan", nl=False) + click.secho("`.", fg="yellow") + else: + click.secho("platformio upgrade", fg="cyan", nl=False) + click.secho("` or `", fg="yellow", nl=False) + click.secho("pip install -U platformio", fg="cyan", nl=False) + click.secho("` command.", fg="yellow") + click.secho("Changes: ", fg="yellow", nl=False) click.secho("http://docs.platformio.org/en/latest/history.html", fg="cyan") click.echo("*" * terminal_width) From 63902c82157516d0993cbcdd4bca3f52917b8143 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 13 Feb 2016 17:46:27 +0200 Subject: [PATCH 12/16] Add "pip" to title of installation method using Python Package Manager --- docs/installation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 1dfe407c..bcc296ef 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -55,8 +55,8 @@ Installation Methods Please *choose ONE of* the following methods: -a) Python Package Manager -~~~~~~~~~~~~~~~~~~~~~~~~~ +a) Python Package Manager ``pip`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The latest stable version of PlatformIO may be installed or upgraded via `pip `_ as follows: From 50294274c3bff09809fd4506e1273ced45883804 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 13 Feb 2016 17:51:08 +0200 Subject: [PATCH 13/16] Explain what does mean "pip" // Issue #517 --- docs/installation.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index bcc296ef..2343516d 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -55,11 +55,11 @@ Installation Methods Please *choose ONE of* the following methods: -a) Python Package Manager ``pip`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +a) Python Package Manager +~~~~~~~~~~~~~~~~~~~~~~~~~ The latest stable version of PlatformIO may be installed or upgraded via -`pip `_ as follows: +Python Package Manager (`pip `_) as follows: .. code-block:: bash From dc007dd136836b8beed185fb35fb03a33e1052d3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 17 Feb 2016 20:20:39 +0200 Subject: [PATCH 14/16] Handle new environment variables PLATFORMIO_UPLOAD_PORT and PLATFORMIO_UPLOAD_FLAGS --- HISTORY.rst | 4 ++++ docs/envvars.rst | 16 ++++++++++++++-- docs/projectconf.rst | 10 ++++++++++ platformio/builder/main.py | 12 +++++++++--- platformio/builder/scripts/frameworks/mbed.py | 5 ++--- platformio/builder/tools/platformio.py | 12 ++++-------- 6 files changed, 43 insertions(+), 16 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index c2e54e39..bb5eb8bb 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -18,6 +18,10 @@ PlatformIO 2.0 * Added ``board_flash_mode`` option to `Project Configuration File platformio.ini `__ which allows to specify `custom flash chip mode `_ for Espressif development platform +* Handle new environment variables + `PLATFORMIO_UPLOAD_PORT `_ + and `PLATFORMIO_UPLOAD_FLAGS `_ + (`IDE issue #518 `_) * Fixed issue with ``CPPDEFINES`` which contain space and break PlatformIO IDE Linter (`IDE issue #34 `_) diff --git a/docs/envvars.rst b/docs/envvars.rst index f46784bd..7085bcf7 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -70,8 +70,8 @@ Allows to override :ref:`projectconf` option :ref:`projectconf_pio_envs_dir`. Allows to override :ref:`projectconf` option :ref:`projectconf_pio_data_dir`. -Builder -------- +Building +-------- .. envvar:: PLATFORMIO_BUILD_FLAGS @@ -90,6 +90,18 @@ Allows to set :ref:`projectconf` option :ref:`projectconf_src_filter`. Allows to set :ref:`projectconf` option :ref:`projectconf_extra_script`. +Uploading +--------- + +.. envvar:: PLATFORMIO_UPLOAD_PORT + +Allows to set :ref:`projectconf` option :ref:`projectconf_upload_port`. + +.. envvar:: PLATFORMIO_UPLOAD_FLAGS + +Allows to set :ref:`projectconf` option :ref:`projectconf_upload_flags`. + + Settings -------- diff --git a/docs/projectconf.rst b/docs/projectconf.rst index b1f4ea36..09a49eb5 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -433,6 +433,8 @@ When no targets are defined, *PlatformIO* will build only sources by default. Uploading options ~~~~~~~~~~~~~~~~~ +.. _projectconf_upload_port: + ``upload_port`` ^^^^^^^^^^^^^^^ @@ -448,6 +450,9 @@ automatically. To print all available serial ports use :ref:`cmd_serialports` command. +This option can be set by global environment variable +:envvar:`PLATFORMIO_UPLOAD_PORT`. + ``upload_protocol`` ^^^^^^^^^^^^^^^^^^^ @@ -461,12 +466,17 @@ A protocol that "uploader" tool uses to talk to the board. A connection speed (`baud rate `_) which "uploader" tool uses when sending firmware to board. +.. _projectconf_upload_flags: + ``upload_flags`` ^^^^^^^^^^^^^^^^ Extra flags for uploader. Will be added to the end of uploader command. If you need to override uploader command or base flags please use :ref:`projectconf_extra_script`. +This option can be set by global environment variable +:envvar:`PLATFORMIO_UPLOAD_FLAGS`. + .. _projectconf_upload_resetmethod: ``upload_resetmethod`` diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 6c7209bb..ccb4a2d5 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -139,6 +139,13 @@ if env.subst("$PIOPACKAGE_TOOLCHAIN"): env.subst(join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN", "bin")) ) +# handle custom variable from system environment +for var in ("BUILD_FLAGS", "SRC_BUILD_FLAGS", "SRC_FILTER", "EXTRA_SCRIPT", + "UPLOAD_PORT", "UPLOAD_FLAGS"): + k = "PLATFORMIO_%s" % var + if environ.get(k): + env[var] = environ.get(k) + env.SConscriptChdir(0) env.SConsignFile(join("$PIOENVS_DIR", ".sconsign.dblite")) env.SConscript("$BUILD_SCRIPT") @@ -146,9 +153,8 @@ env.SConscript("$BUILD_SCRIPT") if "UPLOAD_FLAGS" in env: env.Append(UPLOADERFLAGS=["$UPLOAD_FLAGS"]) -if environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT")): - env.SConscript( - environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT"))) +if env.get("EXTRA_SCRIPT"): + env.SConscript(env.get("EXTRA_SCRIPT")) if "envdump" in COMMAND_LINE_TARGETS: print env.Dump() diff --git a/platformio/builder/scripts/frameworks/mbed.py b/platformio/builder/scripts/frameworks/mbed.py index 84465d4a..c76202b8 100644 --- a/platformio/builder/scripts/frameworks/mbed.py +++ b/platformio/builder/scripts/frameworks/mbed.py @@ -32,7 +32,7 @@ import re import sys import xml.etree.ElementTree as ElementTree from binascii import crc32 -from os import getenv, walk +from os import walk from os.path import basename, isfile, join, normpath from SCons.Script import DefaultEnvironment @@ -233,8 +233,7 @@ env.Replace( # restore external build flags env.ProcessFlags([ env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags"), - env.get("BUILD_FLAGS"), - getenv("PLATFORMIO_BUILD_FLAGS"), + env.get("BUILD_FLAGS") ]) # Hook for K64F and K22F diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 6a2eb3b5..6e080614 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -16,7 +16,7 @@ from __future__ import absolute_import import re from glob import glob -from os import getenv, listdir, sep, walk +from os import listdir, sep, walk from os.path import basename, dirname, isdir, isfile, join, normpath, realpath from SCons.Script import COMMAND_LINE_TARGETS, DefaultEnvironment, SConscript @@ -44,8 +44,7 @@ def BuildProgram(env): env.ProcessFlags([ env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags"), - env.get("BUILD_FLAGS"), - getenv("PLATFORMIO_BUILD_FLAGS"), + env.get("BUILD_FLAGS") ]) if env.get("FRAMEWORK"): @@ -72,10 +71,7 @@ def BuildProgram(env): ) # Handle SRC_BUILD_FLAGS - env.ProcessFlags([ - env.get("SRC_BUILD_FLAGS", None), - getenv("PLATFORMIO_SRC_BUILD_FLAGS"), - ]) + env.ProcessFlags([env.get("SRC_BUILD_FLAGS", None)]) env.Append( CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format( @@ -86,7 +82,7 @@ def BuildProgram(env): sources = env.LookupSources( "$BUILDSRC_DIR", "$PROJECTSRC_DIR", duplicate=False, - src_filter=getenv("PLATFORMIO_SRC_FILTER", env.get("SRC_FILTER"))) + src_filter=env.get("SRC_FILTER")) if not sources and not COMMAND_LINE_TARGETS: env.Exit( From 5107d767ee863946fa88d3c3921d2b69c798b06d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 17 Feb 2016 22:47:55 +0200 Subject: [PATCH 15/16] Update links to the new PlatformIO site --- README.rst | 20 +++++++++++++------- docs/ide/atom.rst | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 2117a686..91502830 100644 --- a/README.rst +++ b/README.rst @@ -30,18 +30,18 @@ PlatformIO :target: https://gitter.im/platformio/platformio .. image:: https://img.shields.io/donate/PlatformIO.png?color=yellow :alt: Donate for PlatformIO.Org - :target: http://platformio.org/donate/ + :target: http://platformio.org/#!/donate `Home & Demo `_ | +`PlatformIO IDE `_ | `Project Examples `_ | -`Source Code `_ | -`Documentation `_ | -`Blog `_ | +`Docs `_ | `Twitter `_ | -`Hackaday `_ | `Facebook `_ | -`Reddit `_ +`Hackaday `_ | +`Donate `_ | +`Contact Us `_ .. image:: https://raw.githubusercontent.com/platformio/platformio/develop/docs/_static/platformio-logo.png :target: http://platformio.org @@ -50,6 +50,11 @@ PlatformIO development. Cross-platform code builder and library manager. Continuous and IDE integration. Arduino and MBED compatible. Ready for Cloud compiling. +* **PlatformIO IDE** - The next generation integrated development environment for IoT. + C/C++ Intelligent Code Completion and Smart Code Linter for the super-fast coding. + Multi-projects workflow with Multiple Panes. Themes Support with dark and light colors. + Built-in Terminal with PlatformIO CLI tool and support for the powerful Serial Port Monitor. + All advanced instruments without leaving your favourite development environment. * **Development Platforms** - Embedded and Desktop development platforms with pre-built toolchains, debuggers, uploaders and frameworks which work under popular host OS: Mac, Windows, Linux (+ARM) @@ -59,7 +64,7 @@ IDE integration. Arduino and MBED compatible. Ready for Cloud compiling. * **Library Manager** - Hundreds Popular Libraries are organized into single Web 2.0 platform: list by categories, keywords, authors, compatible platforms and frameworks; learn via examples; be up-to-date with the latest - version + version. *Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed, @@ -68,6 +73,7 @@ libOpenCM3, etc.* .. image:: https://raw.githubusercontent.com/platformio/platformio/develop/docs/_static/platformio-demo-wiring.gif :target: http://platformio.org +* `PlatformIO IDE `_ * `Get Started `_ * `Web 2.0 Library Search `_ * `Development Platforms `_ diff --git a/docs/ide/atom.rst b/docs/ide/atom.rst index cbac0e2c..2bc3e327 100644 --- a/docs/ide/atom.rst +++ b/docs/ide/atom.rst @@ -43,7 +43,7 @@ config file. Installation ------------ -1. Download and install Atom source code editor +1. Download and install Atom text editor - `Download for Mac `_ - `Download for Windows `_ From 321640bd710d80fb86e5fc379897d226254365b7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 17 Feb 2016 22:52:52 +0200 Subject: [PATCH 16/16] Version bump to 2.8.4 (issues #494, #501, #503, #506, #518) --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index bb5eb8bb..7c17f26c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release Notes PlatformIO 2.0 -------------- -2.8.4 (2016-02-??) +2.8.4 (2016-02-17) ~~~~~~~~~~~~~~~~~~ * Added support for the new ESP8266-based boards (ESPDuino, ESP-WROOM-02, diff --git a/platformio/__init__.py b/platformio/__init__.py index bf4a5d10..352fa2fe 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 8, "4.dev1") +VERSION = (2, 8, 4) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio"