From 3d413743e43c41210e9c8078941b4283e1fb7fac Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 16 Dec 2015 00:35:24 +0200 Subject: [PATCH 01/17] Add ESP8266 quickstart --- docs/quickstart.rst | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index f66ba358d1..baa5e1faf7 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -30,9 +30,6 @@ Quickstart $ platformio init --board=TYPE_1 --board=TYPE_2 --board=TYPE_N - Would you like to enable firmware auto-uploading when project is successfully built using `platformio run` command? - Don't forget that you can upload firmware manually using `platformio run --target upload` command. [y/N]: y - The current working directory *** will be used for the new project. You can specify another project directory via `platformio init -d %PATH_TO_THE_PROJECT_DIR%` command. @@ -66,10 +63,9 @@ Change working directory to the project's root where is located # clean project $ platformio run --target clean -If you don't have installed required platforms, then *PlatformIO* will propose -you to install them automatically. -Further examples can be found in `PlatformIO Repository `_. +Useful links: -Also, for more detailed information as for commands please go to -:ref:`userguide` sections. +* `Project examples `_ +* :ref:`userguide` for PlatformIO commands +* `Quickstart for Espressif ESP8266 `_ From d3b7fc7ddb41e9fde3dce9adf22defd75fc931c8 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 16 Dec 2015 13:18:51 +0200 Subject: [PATCH 02/17] Add JetBrains post in CLion Blog --- docs/articles.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/articles.rst b/docs/articles.rst index 104462a830..b8d6db9d3c 100644 --- a/docs/articles.rst +++ b/docs/articles.rst @@ -23,6 +23,7 @@ Here are recent articles about PlatformIO: 2015 ^^^^ +* Dec 01, 2015 - **JetBrains CLion Blog** - `C++ Annotated: Fall 2015. Arduino Support in CLion using PlatformIO `_ * Dec 01, 2015 - **Tateno Yuichi** - `ESP8266 を CUI で開発する (Develop a ESP8266 in CUI, Japanese) `_ * Nov 29, 2015 - **Keith Hughes** - `Using PlatformIO for Embedded Projects `_ * Nov 22, 2015 - **Michał Seroczyński** - `Using PlatformIO to get started with Arduino in CLion IDE `_ From 34a5d366d5f4a967bd40191d7f5c6b4387a0e849 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Dec 2015 00:02:22 +0200 Subject: [PATCH 03/17] Fix reset method for Espressif NodeMCU (ESP-12E Module) // Resolve #380 --- HISTORY.rst | 7 +++++ docs/frameworks/arduino.rst | 13 ++------ docs/platforms/atmelavr.rst | 2 +- docs/platforms/espressif.rst | 11 ++----- .../esp8266-webserver/platformio.ini | 7 ++++- platformio/__init__.py | 2 +- platformio/boards/espressif.json | 31 +++---------------- platformio/boards/misc.json | 2 +- platformio/builder/scripts/espressif.py | 2 +- 9 files changed, 27 insertions(+), 50 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index f62c654e31..0e59a8f511 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,13 @@ Release History PlatformIO 2.0 -------------- +2.6.1 (2015-12-??) +~~~~~~~~~~~~~~~~~~ + +* Fixed reset method for Espressif NodeMCU (ESP-12E Module) + (`issue #380 `_) + + 2.6.0 (2015-12-15) ~~~~~~~~~~~~~~~~~~ diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index 78d2689523..ec5bb505e6 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -363,7 +363,7 @@ BQ - RAM * - ``zumbt328`` - - `BQ ZUM BT-328 board `_ + - `BQ ZUM BT-328 `_ - ATMEGA328P - 16 MHz - 32 Kb @@ -485,21 +485,14 @@ Espressif - RAM * - ``esp01`` - - `Espressif ESP8266 ESP-01 board `_ + - `Espressif Generic ESP8266 ESP-01 `_ - ESP8266 - 80 MHz - 512 Kb - 32 Kb - * - ``esp01_1m`` - - `Espressif ESP8266 ESP-01-1MB board `_ - - ESP8266 - - 80 MHz - - 1024 Kb - - 32 Kb - * - ``esp12e`` - - `Espressif ESP8266 ESP-12E board (NodeMCU) `_ + - `Espressif NodeMCU (ESP-12 Module) `_ - ESP8266 - 80 MHz - 4096 Kb diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index 72f0e34220..5e750445e9 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -368,7 +368,7 @@ BQ - RAM * - ``zumbt328`` - - `BQ ZUM BT-328 board `_ + - `BQ ZUM BT-328 `_ - ATMEGA328P - 16 MHz - 32 Kb diff --git a/docs/platforms/espressif.rst b/docs/platforms/espressif.rst index 0f1ee9aff1..e5917268c3 100644 --- a/docs/platforms/espressif.rst +++ b/docs/platforms/espressif.rst @@ -86,21 +86,14 @@ Espressif - RAM * - ``esp01`` - - `Espressif ESP8266 ESP-01 board `_ + - `Espressif Generic ESP8266 ESP-01 `_ - ESP8266 - 80 MHz - 512 Kb - 32 Kb - * - ``esp01_1m`` - - `Espressif ESP8266 ESP-01-1MB board `_ - - ESP8266 - - 80 MHz - - 1024 Kb - - 32 Kb - * - ``esp12e`` - - `Espressif ESP8266 ESP-12E board (NodeMCU) `_ + - `Espressif NodeMCU (ESP-12 Module) `_ - ESP8266 - 80 MHz - 4096 Kb diff --git a/examples/espressif/esp8266-webserver/platformio.ini b/examples/espressif/esp8266-webserver/platformio.ini index e79ce81ca3..a6f42f61ce 100644 --- a/examples/espressif/esp8266-webserver/platformio.ini +++ b/examples/espressif/esp8266-webserver/platformio.ini @@ -17,7 +17,12 @@ # Automatic targets - enable auto-uploading # targets = upload -[env:esp01_8266] +[env:esp01] platform = espressif framework = arduino board = esp01 + +[env:esp12e] +platform = espressif +framework = arduino +board = esp12e diff --git a/platformio/__init__.py b/platformio/__init__.py index 784f17154b..e656a7aec8 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 6, 0) +VERSION = (2, 6, "1.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/boards/espressif.json b/platformio/boards/espressif.json index ea97a27bf9..175f1da0ab 100644 --- a/platformio/boards/espressif.json +++ b/platformio/boards/espressif.json @@ -9,40 +9,19 @@ "variant": "generic" }, "frameworks": ["arduino"], - "name": "Espressif ESP8266 ESP-01 board", + "name": "Espressif Generic ESP8266 ESP-01", "platform": "espressif", "upload": { "maximum_ram_size": 32768, "maximum_size": 524288, - "protocol": "arduino", - "require_upload_port" : true, - "speed": 115200 - }, - "url": "https://nurdspace.nl/ESP8266", - "vendor": "Espressif" - }, - "esp01_1m": { - "build": { - "core": "esp8266", - "extra_flags": "-DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266", - "f_cpu": "80000000L", - "ldscript": "esp8266.flash.1m128.ld", - "mcu": "esp8266", - "variant": "generic" - }, - "frameworks": ["arduino"], - "name": "Espressif ESP8266 ESP-01-1MB board", - "platform": "espressif", - "upload": { - "maximum_ram_size": 32768, - "maximum_size": 1048576, - "protocol": "arduino", + "resetmethod": "ck", "require_upload_port" : true, "speed": 115200 }, "url": "https://nurdspace.nl/ESP8266", "vendor": "Espressif" }, + "esp12e": { "build": { "core": "esp8266", @@ -53,12 +32,12 @@ "variant": "nodemcu" }, "frameworks": ["arduino"], - "name": "Espressif ESP8266 ESP-12E board (NodeMCU)", + "name": "Espressif NodeMCU (ESP-12 Module)", "platform": "espressif", "upload": { "maximum_ram_size": 32768, "maximum_size": 4194304, - "protocol": "arduino", + "resetmethod": "nodemcu", "require_upload_port" : true, "speed": 115200 }, diff --git a/platformio/boards/misc.json b/platformio/boards/misc.json index a50800103e..fa028efca9 100644 --- a/platformio/boards/misc.json +++ b/platformio/boards/misc.json @@ -459,7 +459,7 @@ "variant": "eightanaloginputs" }, "frameworks": ["arduino"], - "name": "BQ ZUM BT-328 board", + "name": "BQ ZUM BT-328", "platform": "atmelavr", "upload": { "disable_flushing": true, diff --git a/platformio/builder/scripts/espressif.py b/platformio/builder/scripts/espressif.py index 0980c605c6..b4bd4e7350 100644 --- a/platformio/builder/scripts/espressif.py +++ b/platformio/builder/scripts/espressif.py @@ -87,7 +87,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 UPLOADER=join("$PIOPACKAGES_DIR", "tool-esptool", "esptool"), UPLOADERFLAGS=[ "-vv", - "-cd", "ck", + "-cd", "${BOARD_OPTIONS['upload']['resetmethod']}", "-cb", "$UPLOAD_SPEED", "-cp", "$UPLOAD_PORT", "-ca", "0x00000", From 84cbbe437d13c7faa7957015431d41f73d523bb6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Dec 2015 00:08:57 +0200 Subject: [PATCH 04/17] Remove default options --- platformio/builder/scripts/espressif.py | 1 - 1 file changed, 1 deletion(-) diff --git a/platformio/builder/scripts/espressif.py b/platformio/builder/scripts/espressif.py index b4bd4e7350..b1a298580a 100644 --- a/platformio/builder/scripts/espressif.py +++ b/platformio/builder/scripts/espressif.py @@ -90,7 +90,6 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 "-cd", "${BOARD_OPTIONS['upload']['resetmethod']}", "-cb", "$UPLOAD_SPEED", "-cp", "$UPLOAD_PORT", - "-ca", "0x00000", "-cf", "$SOURCE" ], UPLOADCMD='$UPLOADER $UPLOADERFLAGS', From f0abd353ae1745a85f033969e3be301595d10053 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Dec 2015 00:47:56 +0200 Subject: [PATCH 05/17] Extend link to FAQ with what is PlatformIO --- docs/index.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index b912dd5123..a255736f2e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -71,7 +71,8 @@ The Missing Library Manager. *It's here!* * Automatic library updating * It runs on Windows, Mac OS X, and Linux (+ARM). -For further details, please refer to :ref:`faq_what_is_platformio` +For further details, please refer to +:ref:`What is PlatformIO? How does it work? ` Contents -------- From 3cbbecb413fa3267bb36dba81e8f7427d0c20d97 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Dec 2015 18:17:54 +0200 Subject: [PATCH 06/17] Repository for LD scripts; common LD script for ESP8266 // Resolve #379 --- HISTORY.rst | 4 ++++ platformio/__init__.py | 2 +- platformio/builder/main.py | 1 + platformio/builder/tools/platformio.py | 8 ++++---- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 0e59a8f511..f8353cc72a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,10 @@ PlatformIO 2.0 2.6.1 (2015-12-??) ~~~~~~~~~~~~~~~~~~ +* Created public `platformio-pkg-ldscripts `_ + repository for LD scripts. Moved common configuration for ESP8266 MCU to + ``esp8266.flash.common.ld`` + (`issue #379 `_) * Fixed reset method for Espressif NodeMCU (ESP-12E Module) (`issue #380 `_) diff --git a/platformio/__init__.py b/platformio/__init__.py index e656a7aec8..c70391a757 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 6, "1.dev0") +VERSION = (2, 6, "1.dev1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 26bc853ffa..1f5debdd4c 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -114,6 +114,7 @@ ) env = DefaultEnvironment() +env.Prepend(LIBPATH=[join("$PIOPACKAGES_DIR", "ldscripts")]) if "BOARD" in env: try: diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 6db8acfec7..bd8c655842 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -78,7 +78,9 @@ def BuildProgram(env): env.Append( CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format( - *pioversion_to_intstr())] + *pioversion_to_intstr())], + LIBS=deplibs, + LIBPATH=["$BUILD_DIR"] ) return env.Program( @@ -86,9 +88,7 @@ def BuildProgram(env): env.LookupSources( "$BUILDSRC_DIR", "$PROJECTSRC_DIR", duplicate=False, src_filter=getenv("PLATFORMIO_SRC_FILTER", - env.get("SRC_FILTER"))), - LIBS=env.get("LIBS", []) + deplibs, - LIBPATH=env.get("LIBPATH", []) + ["$BUILD_DIR"] + env.get("SRC_FILTER"))) ) From 3830e98c1d6bf6cdcbab70be25657bfa55c28b08 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Dec 2015 20:16:17 +0200 Subject: [PATCH 07/17] Add support for the new ESP8266 based boards --- HISTORY.rst | 5 + docs/frameworks/arduino.rst | 64 +++++- docs/platforms/espressif.rst | 64 +++++- .../esp8266-webserver/platformio.ini | 14 +- platformio/__init__.py | 2 +- platformio/boards/espressif.json | 198 +++++++++++++++++- platformio/boards/raspberrypi.json | 1 - setup.py | 4 +- 8 files changed, 331 insertions(+), 21 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index f8353cc72a..8f972019d8 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,11 @@ PlatformIO 2.0 2.6.1 (2015-12-??) ~~~~~~~~~~~~~~~~~~ +* Added support for the new ESP8266-based boards (SparkFun ESP8266 Thing, + NodeMCU 0.9 & 1.0, Olimex MOD-WIFI-ESP8266(-DEV), Adafruit HUZZAH ESP8266, + ESPino, SweetPea ESP-210, WeMos D1, WeMos D1 mini) to + `Espressif `__ + development platform * Created public `platformio-pkg-ldscripts `_ repository for LD scripts. Moved common configuration for ESP8266 MCU to ``esp8266.flash.common.ld`` diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index ec5bb505e6..7835d4419a 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -484,19 +484,75 @@ Espressif - Flash - RAM + * - ``d1`` + - `WeMos D1 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``d1_mini`` + - `WeMos D1 mini `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + * - ``esp01`` - `Espressif Generic ESP8266 ESP-01 `_ - ESP8266 - 80 MHz - 512 Kb - - 32 Kb + - 80 Kb * - ``esp12e`` - - `Espressif NodeMCU (ESP-12 Module) `_ + - `Espressif ESP8266 ESP-12E `_ - ESP8266 - 80 MHz - - 4096 Kb - - 32 Kb + - 1024 Kb + - 80 Kb + + * - ``esp210`` + - `SweetPea ESP-210 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``espino`` + - `ESPino `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``huzzah`` + - `Adafruit HUZZAH ESP8266 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``modwifi`` + - `Olimex MOD-WIFI-ESP8266(-DEV) `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``nodemcu`` + - `NodeMCU 0.9 & 1.0 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``thing`` + - `SparkFun ESP8266 Thing `_ + - ESP8266 + - 80 MHz + - 512 Kb + - 80 Kb LightUp ~~~~~~~ diff --git a/docs/platforms/espressif.rst b/docs/platforms/espressif.rst index e5917268c3..48ca35b702 100644 --- a/docs/platforms/espressif.rst +++ b/docs/platforms/espressif.rst @@ -85,16 +85,72 @@ Espressif - Flash - RAM + * - ``d1`` + - `WeMos D1 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``d1_mini`` + - `WeMos D1 mini `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + * - ``esp01`` - `Espressif Generic ESP8266 ESP-01 `_ - ESP8266 - 80 MHz - 512 Kb - - 32 Kb + - 80 Kb * - ``esp12e`` - - `Espressif NodeMCU (ESP-12 Module) `_ + - `Espressif ESP8266 ESP-12E `_ - ESP8266 - 80 MHz - - 4096 Kb - - 32 Kb + - 1024 Kb + - 80 Kb + + * - ``esp210`` + - `SweetPea ESP-210 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``espino`` + - `ESPino `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``huzzah`` + - `Adafruit HUZZAH ESP8266 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``modwifi`` + - `Olimex MOD-WIFI-ESP8266(-DEV) `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``nodemcu`` + - `NodeMCU 0.9 & 1.0 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``thing`` + - `SparkFun ESP8266 Thing `_ + - ESP8266 + - 80 MHz + - 512 Kb + - 80 Kb diff --git a/examples/espressif/esp8266-webserver/platformio.ini b/examples/espressif/esp8266-webserver/platformio.ini index a6f42f61ce..e25bd94628 100644 --- a/examples/espressif/esp8266-webserver/platformio.ini +++ b/examples/espressif/esp8266-webserver/platformio.ini @@ -22,7 +22,17 @@ platform = espressif framework = arduino board = esp01 -[env:esp12e] +[env:nodemcu] platform = espressif framework = arduino -board = esp12e +board = nodemcu + +[env:huzzah] +platform = espressif +framework = arduino +board = huzzah + +[env:thing] +platform = espressif +framework = arduino +board = thing diff --git a/platformio/__init__.py b/platformio/__init__.py index c70391a757..fdcf1b1e48 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 6, "1.dev1") +VERSION = (2, 6, "1.dev2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/boards/espressif.json b/platformio/boards/espressif.json index 175f1da0ab..b11e7c3498 100644 --- a/platformio/boards/espressif.json +++ b/platformio/boards/espressif.json @@ -2,9 +2,9 @@ "esp01": { "build": { "core": "esp8266", - "extra_flags": "-DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01", "f_cpu": "80000000L", - "ldscript": "esp8266.flash.512k.ld", + "ldscript": "esp8266.flash.512k64.ld", "mcu": "esp8266", "variant": "generic" }, @@ -12,7 +12,7 @@ "name": "Espressif Generic ESP8266 ESP-01", "platform": "espressif", "upload": { - "maximum_ram_size": 32768, + "maximum_ram_size": 81920, "maximum_size": 524288, "resetmethod": "ck", "require_upload_port" : true, @@ -25,23 +25,207 @@ "esp12e": { "build": { "core": "esp8266", - "extra_flags": "-DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266 -DESP8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "ldscript": "esp8266.flash.4m.ld", "mcu": "esp8266", "variant": "nodemcu" }, "frameworks": ["arduino"], - "name": "Espressif NodeMCU (ESP-12 Module)", + "name": "Espressif ESP8266 ESP-12E", "platform": "espressif", "upload": { - "maximum_ram_size": 32768, - "maximum_size": 4194304, + "maximum_ram_size": 81920, + "maximum_size": 1048576, "resetmethod": "nodemcu", "require_upload_port" : true, "speed": 115200 }, "url": "https://nurdspace.nl/ESP8266", "vendor": "Espressif" + }, + + "nodemcu": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", + "f_cpu": "80000000L", + "ldscript": "esp8266.flash.4m.ld", + "mcu": "esp8266", + "variant": "nodemcu" + }, + "frameworks": ["arduino"], + "name": "NodeMCU 0.9 & 1.0", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 1048576, + "resetmethod": "nodemcu", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "http://www.nodemcu.com/", + "vendor": "Espressif" + }, + + "huzzah": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", + "f_cpu": "80000000L", + "ldscript": "esp8266.flash.4m.ld", + "mcu": "esp8266", + "variant": "adafruit" + }, + "frameworks": ["arduino"], + "name": "Adafruit HUZZAH ESP8266", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 1048576, + "resetmethod": "nodemcu", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "https://www.adafruit.com/products/2471", + "vendor": "Espressif" + }, + + "modwifi": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_MOD_WIFI_ESP8266", + "f_cpu": "80000000L", + "ldscript": "esp8266.flash.2m.ld", + "mcu": "esp8266", + "variant": "generic" + }, + "frameworks": ["arduino"], + "name": "Olimex MOD-WIFI-ESP8266(-DEV)", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 1048576, + "resetmethod": "ck", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "https://www.olimex.com/Products/IoT/MOD-WIFI-ESP8266-DEV/open-source-hardware", + "vendor": "Espressif" + }, + + "thing": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_THING", + "f_cpu": "80000000L", + "ldscript": "esp8266.flash.512k64.ld", + "mcu": "esp8266", + "variant": "thing" + }, + "frameworks": ["arduino"], + "name": "SparkFun ESP8266 Thing", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 524288, + "resetmethod": "nodemcu", + "require_upload_port" : true, + "speed": 921600 + }, + "url": "https://www.sparkfun.com/products/13231", + "vendor": "Espressif" + }, + + "esp210": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP210", + "f_cpu": "80000000L", + "ldscript": "esp8266.flash.4m.ld", + "mcu": "esp8266", + "variant": "generic" + }, + "frameworks": ["arduino"], + "name": "SweetPea ESP-210", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 1048576, + "resetmethod": "ck", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "http://wiki.sweetpeas.se/index.php?title=ESP-210", + "vendor": "Espressif" + }, + + "d1": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", + "f_cpu": "80000000L", + "ldscript": "esp8266.flash.4m.ld", + "mcu": "esp8266", + "variant": "d1" + }, + "frameworks": ["arduino"], + "name": "WeMos D1", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 1048576, + "resetmethod": "nodemcu", + "require_upload_port" : true, + "speed": 460800 + }, + "url": "http://www.wemos.cc/wiki/doku.php?id=en:d1", + "vendor": "Espressif" + }, + + "d1_mini": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", + "f_cpu": "80000000L", + "ldscript": "esp8266.flash.4m.ld", + "mcu": "esp8266", + "variant": "d1_mini" + }, + "frameworks": ["arduino"], + "name": "WeMos D1 mini", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 1048576, + "resetmethod": "nodemcu", + "require_upload_port" : true, + "speed": 460800 + }, + "url": "http://www.wemos.cc/wiki/doku.php?id=en:d1_mini", + "vendor": "Espressif" + }, + + "espino": { + "build": { + "core": "esp8266", + "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", + "f_cpu": "80000000L", + "ldscript": "esp8266.flash.4m1m.ld", + "mcu": "esp8266", + "variant": "espino" + }, + "frameworks": ["arduino"], + "name": "ESPino", + "platform": "espressif", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 1048576, + "resetmethod": "ck", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "http://www.espino.io", + "vendor": "Espressif" } } diff --git a/platformio/boards/raspberrypi.json b/platformio/boards/raspberrypi.json index ec4b7878b2..25c3485a27 100644 --- a/platformio/boards/raspberrypi.json +++ b/platformio/boards/raspberrypi.json @@ -18,7 +18,6 @@ "raspberrypi_2b": { "build": { - "core": "esp8266", "extra_flags": "-DRASPBERRYPI -DRASPBERRYPI2", "f_cpu": "900000000L", "mcu": "bcm2836" diff --git a/setup.py b/setup.py index 36231163fd..c7968fd51c 100644 --- a/setup.py +++ b/setup.py @@ -74,7 +74,7 @@ keywords=[ "iot", "build tool", "compiler", "builder", "library manager", "embedded", "ci", "continuous integration", "arduino", "mbed", - "framework", "ide", "ide integration", "library.json", "make", "cmake", - "makefile", "mk" + "esp8266", "framework", "ide", "ide integration", "library.json", + "make", "cmake", "makefile", "mk" ] ) From edc06f12b580a1b3e6b149aa3bac6474ac614e46 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Dec 2015 20:22:17 +0200 Subject: [PATCH 08/17] Add to FAQ "Monitoring a serial port breaks upload" // Resolve #384 --- docs/faq.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/faq.rst b/docs/faq.rst index d00f89c62f..dc3663a7d4 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -245,3 +245,8 @@ Archlinux: libncurses.so.5: cannot open shared object file '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Answered in `issue #291 `_. + +Monitoring a serial port breaks upload +'''''''''''''''''''''''''''''''''''''' + +Answered in `issue #384 `_. From 1a47cfc93847687611d424a6e22623f4d3b4567a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 18 Dec 2015 12:18:25 +0200 Subject: [PATCH 09/17] Show INT values for serial monitor hot keys --- docs/userguide/cmd_serialports.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/userguide/cmd_serialports.rst b/docs/userguide/cmd_serialports.rst index 8cea3be5d5..2c985ff359 100644 --- a/docs/userguide/cmd_serialports.rst +++ b/docs/userguide/cmd_serialports.rst @@ -191,13 +191,13 @@ Do not apply any encodings/transformations --exit-char ASCII code of special character that is used to exit the application, -default ``0x1d`` +default ``29`` (DEC) .. option:: --menu-char ASCII code of special character that is used to control miniterm (menu), -default ``0x14`` +default ``20`` (DEC) .. option:: ---quiet From 186580d794dfe12fb74fca885a5551b7e2087e22 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 18 Dec 2015 15:20:37 +0200 Subject: [PATCH 10/17] Fix issue with code builder when build path contains spaces // Resolve #387 --- HISTORY.rst | 2 ++ platformio/__init__.py | 2 +- platformio/builder/scripts/espressif.py | 13 +++++++------ platformio/builder/scripts/frameworks/cmsis.py | 2 +- platformio/builder/scripts/ststm32.py | 7 ++++--- platformio/builder/scripts/titiva.py | 2 +- platformio/builder/tools/pioar.py | 8 ++++++-- platformio/builder/tools/platformio.py | 2 +- 8 files changed, 23 insertions(+), 15 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 8f972019d8..e14be58310 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -18,6 +18,8 @@ PlatformIO 2.0 (`issue #379 `_) * Fixed reset method for Espressif NodeMCU (ESP-12E Module) (`issue #380 `_) +* Fixed issue with code builder when build path contains spaces + (`issue #387 `_) 2.6.0 (2015-12-15) diff --git a/platformio/__init__.py b/platformio/__init__.py index fdcf1b1e48..af4c57ac36 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 6, "1.dev2") +VERSION = (2, 6, "1.dev3") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/scripts/espressif.py b/platformio/builder/scripts/espressif.py index b1a298580a..6ffa0fb04e 100644 --- a/platformio/builder/scripts/espressif.py +++ b/platformio/builder/scripts/espressif.py @@ -92,7 +92,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 "-cp", "$UPLOAD_PORT", "-cf", "$SOURCE" ], - UPLOADCMD='$UPLOADER $UPLOADERFLAGS', + UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS', PROGNAME="firmware", PROGSUFFIX=".elf" @@ -104,9 +104,10 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 BUILDERS=dict( ElfToBin=Builder( action=" ".join([ - "$UPLOADER", - "-eo", join("$PLATFORMFW_DIR", "bootloaders", - "eboot", "eboot.elf"), + '"$UPLOADER"', + "-eo", + '"%s"' % join("$PLATFORMFW_DIR", "bootloaders", + "eboot", "eboot.elf"), "-bo", "$TARGET", "-bm", "dio", "-bf", "${BOARD_OPTIONS['build']['f_cpu'][:2]}", @@ -147,7 +148,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 "-i", "$UPLOAD_PORT", "-f", "$SOURCE" ], - UPLOADCMD='$UPLOADEROTA $UPLOADERFLAGS' + UPLOADCMD='"$UPLOADEROTA" $UPLOADERFLAGS' ) except socket.error: pass @@ -163,7 +164,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 BUILDERS=dict( ElfToBin=Builder( action=" ".join([ - "$UPLOADER", + '"$UPLOADER"', "-eo", "$SOURCES", "-bo", "${TARGETS[0]}", "-bm", "qio", diff --git a/platformio/builder/scripts/frameworks/cmsis.py b/platformio/builder/scripts/frameworks/cmsis.py index c83ab4780e..f3d7a7ff31 100644 --- a/platformio/builder/scripts/frameworks/cmsis.py +++ b/platformio/builder/scripts/frameworks/cmsis.py @@ -61,7 +61,7 @@ if "mbed" in env.get("BOARD_OPTIONS", {}).get("frameworks", {}): env.Append( LINKFLAGS=[ - "-Wl,-T", + '-Wl,-T"%s"' % join( "$PIOPACKAGES_DIR", "framework-mbed", "variant", env.subst("$BOARD").upper(), "mbed", diff --git a/platformio/builder/scripts/ststm32.py b/platformio/builder/scripts/ststm32.py index 276192bca7..1b35cb5d0b 100644 --- a/platformio/builder/scripts/ststm32.py +++ b/platformio/builder/scripts/ststm32.py @@ -41,10 +41,11 @@ UPLOADERFLAGS=[ join("$BUILD_DIR", "firmware.elf"), "-batch", - "-x", join("$PROJECT_DIR", "upload.gdb") + "-x", + '"%s"' % join("$PROJECT_DIR", "upload.gdb") ], - UPLOADCMD="$UPLOADER $UPLOADERFLAGS" + UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS' ) else: env.Replace( @@ -55,7 +56,7 @@ "0x08000000" # flash start adress ], - UPLOADCMD="$UPLOADER $UPLOADERFLAGS" + UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS' ) diff --git a/platformio/builder/scripts/titiva.py b/platformio/builder/scripts/titiva.py index 800f9a7607..8dbaaf3f4f 100644 --- a/platformio/builder/scripts/titiva.py +++ b/platformio/builder/scripts/titiva.py @@ -28,7 +28,7 @@ env.Replace( UPLOADER=join("$PIOPACKAGES_DIR", "tool-lm4flash", "lm4flash"), - UPLOADCMD="$UPLOADER $SOURCES" + UPLOADCMD='"$UPLOADER" $SOURCES' ) env.Append( diff --git a/platformio/builder/tools/pioar.py b/platformio/builder/tools/pioar.py index cd3b9be02d..624ff6fc1a 100644 --- a/platformio/builder/tools/pioar.py +++ b/platformio/builder/tools/pioar.py @@ -26,9 +26,13 @@ def _huge_sources_hook(sources): tmp_file = join(gettempdir(), "pioarargs-%s" % md5(_sources).hexdigest()) with open(tmp_file, "w") as f: - f.write(_sources) + # fix space in paths + for line in _sources.split(".o "): + if not line.endswith(".o"): + line += ".o" + f.write('"%s" ' % line) - return "@%s" % tmp_file + return '@"%s"' % tmp_file def exists(_): diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index bd8c655842..ad5dfb0bc6 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -58,7 +58,7 @@ def BuildProgram(env): if ("LDSCRIPT_PATH" in env and not any(["-Wl,-T" in f for f in env['LINKFLAGS']])): env.Append( - LINKFLAGS=["-Wl,-T", "$LDSCRIPT_PATH"] + LINKFLAGS=['-Wl,-T"$LDSCRIPT_PATH"'] ) # enable "cyclic reference" for linker From 0951d53f52643472d8fa9fbf5b92127d076d46f3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 18 Dec 2015 15:40:44 +0200 Subject: [PATCH 11/17] Fix issue with code builder when build path contains spaces // Resolve #387 --- platformio/builder/scripts/timsp430.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/scripts/timsp430.py b/platformio/builder/scripts/timsp430.py index 7fc10303ed..b4e2498e14 100644 --- a/platformio/builder/scripts/timsp430.py +++ b/platformio/builder/scripts/timsp430.py @@ -68,7 +68,7 @@ "$UPLOAD_PROTOCOL" if system() != "Windows" else "tilib", "--force-reset" ], - UPLOADCMD='$UPLOADER $UPLOADERFLAGS "prog $SOURCES"', + UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS "prog $SOURCES"', PROGNAME="firmware", PROGSUFFIX=".elf" From cfa3f1b520705f740f419a2d8e33b5fe40318868 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 18 Dec 2015 17:06:28 +0200 Subject: [PATCH 12/17] Extra documentation for development platform / frameworks // Resolve #381 --- docs/conf.py | 2 +- scripts/docspregen.py | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f73c94ea3c..ca57fece2d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -69,7 +69,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build'] +exclude_patterns = ['_build', '**/*_extra.rst'] # The reST default role (used for this markup: `text`) to use for all # documents. diff --git a/scripts/docspregen.py b/scripts/docspregen.py index 290c34fec8..eeac5aab7f 100644 --- a/scripts/docspregen.py +++ b/scripts/docspregen.py @@ -13,7 +13,7 @@ # limitations under the License. from math import ceil -from os.path import dirname, join, realpath +from os.path import dirname, isfile, join, realpath from sys import exit as sys_exit from sys import path @@ -215,11 +215,13 @@ def generate_platform(name): def update_platform_docs(): for name in PlatformFactory.get_platforms().keys(): - rst_path = join( - dirname(realpath(__file__)), "..", "docs", "platforms", - "%s.rst" % name) + platforms_dir = join(dirname(realpath(__file__)), + "..", "docs", "platforms") + rst_path = join(platforms_dir, "%s.rst" % name) with open(rst_path, "w") as f: f.write(generate_platform(name)) + if isfile(join(platforms_dir, "%s_extra.rst" % name)): + f.write("\n.. include:: %s_extra.rst\n" % name) def generate_framework(type_, data): @@ -302,10 +304,13 @@ def generate_framework(type_, data): def update_framework_docs(): for name, data in util.get_frameworks().items(): - rst_path = join(util.get_source_dir(), "..", "docs", "frameworks", - "%s.rst" % name) + frameworks_dir = join(dirname(realpath(__file__)), + "..", "docs", "frameworks") + rst_path = join(frameworks_dir, "%s.rst" % name) with open(rst_path, "w") as f: f.write(generate_framework(name, data)) + if isfile(join(frameworks_dir, "%s_extra.rst" % name)): + f.write("\n.. include:: %s_extra.rst\n" % name) def update_create_platform_doc(): From 62d5f66ae24b63f34c03bfb53f4e8a9dd2f99179 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 18 Dec 2015 18:06:20 +0200 Subject: [PATCH 13/17] Extra docs for Espressif platform --- docs/platforms/espressif.rst | 2 + docs/platforms/espressif_extra.rst | 90 ++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 docs/platforms/espressif_extra.rst diff --git a/docs/platforms/espressif.rst b/docs/platforms/espressif.rst index 48ca35b702..f03a49704c 100644 --- a/docs/platforms/espressif.rst +++ b/docs/platforms/espressif.rst @@ -154,3 +154,5 @@ Espressif - 80 MHz - 512 Kb - 80 Kb + +.. include:: espressif_extra.rst diff --git a/docs/platforms/espressif_extra.rst b/docs/platforms/espressif_extra.rst new file mode 100644 index 0000000000..af550bbf07 --- /dev/null +++ b/docs/platforms/espressif_extra.rst @@ -0,0 +1,90 @@ +.. Copyright 2014-2015 Ivan Kravets + 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. + +OTA firmware uploading +---------------------- + +There are 2 options: + +* Directly specify :option:`platformio run --upload-port` in command line + +.. code-block:: bash + + platformio run --target upload --upload-port IP_ADDRESS_HERE + +* Specify ``upload_port`` option in :ref:`projectconf` + +.. code-block:: ini + + [env:***] + ... + upload_port = IP_ADDRESS_HERE + +Authentication and upload options +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can pass additional options/flags to OTA uploader using +``upload_flags`` option in :ref:`projectconf` + +.. code-block:: ini + + [env:***] + upload_flags = --port=8266 + +Availalbe flags + +* ``--port=ESP_PORT`` ESP8266 ota Port. Default 8266 +* ``--auth=AUTH`` Set authentication password +* ``--spiffs`` Use this option to transmit a SPIFFS image and do not flash + the module + +For the full list with availalbe options please run + +.. code-block:: bash + + ~/.platformio/packages/framework-arduinoespressif/tools/espota.py -h + + Usage: espota.py [options] + + Transmit image over the air to the esp8266 module with OTA support. + + Options: + -h, --help show this help message and exit + + Destination: + -i ESP_IP, --ip=ESP_IP + ESP8266 IP Address. + -p ESP_PORT, --port=ESP_PORT + ESP8266 ota Port. Default 8266 + + Authentication: + -a AUTH, --auth=AUTH + Set authentication password. + + Image: + -f FILE, --file=FILE + Image file. + -s, --spiffs Use this option to transmit a SPIFFS image and do not + flash the module. + + Output: + -d, --debug Show debug output. And override loglevel with debug. + -r, --progress Show progress output. Does not work for ArduinoIDE + +Examples +-------- + +All project examples are located in PlatformIO repository +`Examples for Espressif platform `_. + +* `Native SDK `_ +* `WebServer `_ +* `WiFiScan `_ From e4dbcd50cc6462da50d22ecddbf0e809916b67bc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 18 Dec 2015 19:29:20 +0200 Subject: [PATCH 14/17] Improv documentation for Espressif platform --- HISTORY.rst | 3 ++ docs/index.rst | 2 +- docs/platforms/espressif_extra.rst | 53 ++++++++++++++++++++++++++---- docs/projectconf.rst | 2 ++ 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index e14be58310..85cbdfa8f3 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -16,6 +16,9 @@ PlatformIO 2.0 repository for LD scripts. Moved common configuration for ESP8266 MCU to ``esp8266.flash.common.ld`` (`issue #379 `_) +* Improved documentation for `Espressif `__ + development platform: OTA update, custom Flash Size, Upload Speed and CPU + frequency * Fixed reset method for Espressif NodeMCU (ESP-12E Module) (`issue #380 `_) * Fixed issue with code builder when build path contains spaces diff --git a/docs/index.rst b/docs/index.rst index a255736f2e..b8e05a5a13 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -95,7 +95,7 @@ Contents .. toctree:: :caption: Instruments - :maxdepth: 2 + :maxdepth: 3 Platforms & Boards frameworks/index diff --git a/docs/platforms/espressif_extra.rst b/docs/platforms/espressif_extra.rst index af550bbf07..d089886fa2 100644 --- a/docs/platforms/espressif_extra.rst +++ b/docs/platforms/espressif_extra.rst @@ -9,8 +9,8 @@ See the License for the specific language governing permissions and limitations under the License. -OTA firmware uploading ----------------------- +OTA update +---------- There are 2 options: @@ -24,7 +24,7 @@ There are 2 options: .. code-block:: ini - [env:***] + [env:myenv] ... upload_port = IP_ADDRESS_HERE @@ -36,17 +36,17 @@ You can pass additional options/flags to OTA uploader using .. code-block:: ini - [env:***] + [env:myenv] upload_flags = --port=8266 -Availalbe flags +Available flags * ``--port=ESP_PORT`` ESP8266 ota Port. Default 8266 * ``--auth=AUTH`` Set authentication password * ``--spiffs`` Use this option to transmit a SPIFFS image and do not flash the module -For the full list with availalbe options please run +For the full list with available options please run .. code-block:: bash @@ -79,6 +79,47 @@ For the full list with availalbe options please run -d, --debug Show debug output. And override loglevel with debug. -r, --progress Show progress output. Does not work for ArduinoIDE +Custom CPU Frequency and Upload Speed +------------------------------------- + +See :ref:`projectconf_board_f_cpu` and :ref:`projectconf_upload_speed` options +from :ref:`projectconf` + +.. code-block:: ini + + [env:myenv] + # set frequency to 40MHz + board_f_cpu = 40000000L + + upload_speed = 9600 + + +Custom Flash Size +----------------- + +The list with preconfigured LD scripts is located in public repository +`platformio-pkg-ldscripts `_. + +* ``esp8266.flash.512k0.ld`` 512K (no SPIFFS) +* ``esp8266.flash.512k64.ld`` 512K (64K SPIFFS) +* ``esp8266.flash.1m64.ld`` 1M (64K SPIFFS) +* ``esp8266.flash.1m128.ld`` 1M (128K SPIFFS) +* ``esp8266.flash.1m256.ld`` 1M (256K SPIFFS) +* ``esp8266.flash.1m512.ld`` 1M (512K SPIFFS) +* ``esp8266.flash.2m.ld`` 2M (1M SPIFFS) +* ``esp8266.flash.4m1.ld`` 4M (1M SPIFFS) +* ``esp8266.flash.4m.ld`` 4M (3M SPIFFS) +* ``esp8266.flash.8m.ld`` 8M (7M SPIFFS) +* ``esp8266.flash.16m.ld`` 16M (15M SPIFFS) + +To override default LD script please use :ref:`projectconf_build_flags` from +:ref:`projectconf`. + +.. code-block:: ini + + [env:myenv] + build_flags = -Wl,-Tesp8266.flash.4m.ld + Examples -------- diff --git a/docs/projectconf.rst b/docs/projectconf.rst index da086d0402..23571f79ae 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -176,6 +176,7 @@ is described `here `_. The full list of ``board_mcu`` for the popular embedded platforms you can find in *Boards* section of :ref:`platforms`. See "Microcontroller" column. +.. _projectconf_board_f_cpu: ``board_f_cpu`` ^^^^^^^^^^^^^^^ @@ -209,6 +210,7 @@ To print all available serial ports use :ref:`cmd_serialports` command. A protocol that "uploader" tool uses to talk to the board. +.. _projectconf_upload_speed: ``upload_speed`` ^^^^^^^^^^^^^^^^ From 132c7697668c0f4a4f1ca19e5229449aeedc8546 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 18 Dec 2015 19:58:09 +0200 Subject: [PATCH 15/17] Better error handling --- platformio/__main__.py | 6 +++++- platformio/telemetry.py | 10 ++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/platformio/__main__.py b/platformio/__main__.py index 813558bb5c..cafaec6c14 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -109,7 +109,11 @@ def main(): An unexpected error occurred. Further steps: * Verify that you have the latest version of PlatformIO using - `platformio upgrade` command + `pip install -U platformio` command + +* Try to find answer in FAQ Troubleshooting section + http://docs.platformio.org/en/latest/faq.html + * Report this problem to the developers https://github.com/platformio/platformio/issues diff --git a/platformio/telemetry.py b/platformio/telemetry.py index 43a501dd4f..6a4c163dd0 100644 --- a/platformio/telemetry.py +++ b/platformio/telemetry.py @@ -22,6 +22,7 @@ from collections import deque from os import getenv from time import sleep, time +from traceback import format_exc import click import requests @@ -289,12 +290,13 @@ def on_event(category, action, label=None, value=None, screen_name=None): def on_exception(e): if isinstance(e, exception.AbortedByUser): return - mp = MeasurementProtocol() - mp['exd'] = "%s: %s" % (type(e).__name__, e) - mp['exf'] = int(any([ + is_crash = any([ not isinstance(e, exception.PlatformioException), "Error" in e.__class__.__name__ - ])) + ]) + mp = MeasurementProtocol() + mp['exd'] = "%s: %s" % (type(e).__name__, format_exc() if is_crash else e) + mp['exf'] = 1 if is_crash else 0 mp.send("exception") From 7119bb90844c83164fe90704cf3ac93b14e9894a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 18 Dec 2015 20:18:19 +0200 Subject: [PATCH 16/17] Fix project generator for Eclipse IDE and "duplicate path entries found in project path" // Resolve #383 --- HISTORY.rst | 3 +++ platformio/ide/tpls/eclipse/.cproject.tpl | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 85cbdfa8f3..c56bd0574a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -23,6 +23,9 @@ PlatformIO 2.0 (`issue #380 `_) * Fixed issue with code builder when build path contains spaces (`issue #387 `_) +* Fixed project generator for Eclipse IDE and "duplicate path entries found + in project path" + (`issue #383 `_) 2.6.0 (2015-12-15) diff --git a/platformio/ide/tpls/eclipse/.cproject.tpl b/platformio/ide/tpls/eclipse/.cproject.tpl index 08b8a36978..28d12111a3 100644 --- a/platformio/ide/tpls/eclipse/.cproject.tpl +++ b/platformio/ide/tpls/eclipse/.cproject.tpl @@ -24,6 +24,9 @@