From dc75c3d295fc7c27a03cc86c2f2d0018eebde02f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 30 Nov 2017 18:48:36 +0200 Subject: [PATCH 1/7] Use new toolchain for Arduino Core (fixed order with user libs and IDF) --- platform.json | 2 +- platform.py | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 platform.py diff --git a/platform.json b/platform.json index 23eb20de6..b99f9e304 100644 --- a/platform.json +++ b/platform.json @@ -45,7 +45,7 @@ "framework-arduinoespressif32": { "type": "framework", "optional": true, - "version": "~1.3.1" + "version": "~1.3.2" }, "framework-espidf": { "type": "framework", diff --git a/platform.py b/platform.py new file mode 100644 index 000000000..25c631a92 --- /dev/null +++ b/platform.py @@ -0,0 +1,24 @@ +# Copyright 2014-present PlatformIO +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from platformio.managers.platform import PlatformBase + + +class Espressif32Platform(PlatformBase): + + def configure_default_packages(self, variables, targets): + if "arduino" in variables.get("pioframework"): + self.packages['toolchain-xtensa32']['version'] = "~2.50200.0" + return PlatformBase.configure_default_packages( + self, variables, targets) From eea632192f06e23f13a37cec8f71d089f7132b20 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 3 Jan 2018 18:23:00 +0200 Subject: [PATCH 2/7] Allow to override PROGNAME --- builder/main.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/builder/main.py b/builder/main.py index 187ce01e4..0dee70ef3 100644 --- a/builder/main.py +++ b/builder/main.py @@ -15,7 +15,8 @@ import re from os.path import join -from SCons.Script import (AlwaysBuild, Builder, Default, DefaultEnvironment) +from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default, + DefaultEnvironment) def _get_board_f_flash(env): @@ -114,7 +115,6 @@ def _get_board_f_flash(env): SIZEPRINTCMD='$SIZETOOL -B -d $SOURCES', - PROGNAME="firmware", PROGSUFFIX=".elf" ) @@ -124,6 +124,10 @@ def _get_board_f_flash(env): ASFLAGS=env.get("CCFLAGS", [])[:] ) +# Allow user to override via pre:script +if env.get("PROGNAME", "program") == "program": + env.Replace(PROGNAME="firmware") + # # Framework and SDK specific configuration # @@ -161,9 +165,12 @@ def _get_board_f_flash(env): # target_elf = env.BuildProgram() -if "PIOFRAMEWORK" in env: - target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf) +if "nobuild" in COMMAND_LINE_TARGETS: + target_firm = join("$BUILD_DIR", "${PROGNAME}.bin") +else: + target_firm = env.ElfToBin(target_elf) +AlwaysBuild(env.Alias("nobuild", target_firm)) target_buildprog = env.Alias("buildprog", target_firm, target_firm) From 082fa6ce1c67ef8bb49203e9e1e47bcfdf75ccc8 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 10 Jan 2018 14:13:33 +0200 Subject: [PATCH 3/7] Update usage section in README --- README.md | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 559488f48..26d28d962 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,27 @@ Espressif Systems is a privately held fabless semiconductor company. They provid # Usage -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) -2. Install Espressif 32 development platform: -```bash -# install the latest stable version -> platformio platform install espressif32 - -# install development version -> platformio platform install https://github.com/platformio/platform-espressif32.git +1. [Install PlatformIO](http://platformio.org) +2. Create PlatformIO project and configure a platform option in [platformio.ini](http://docs.platformio.org/page/projectconf.html) file: + +## Stable version + +```ini +[env:stable] +platform = espressif32 +board = ... +... ``` + +## Development version + +```ini +[env:development] +platform = https://github.com/platformio/platform-espressif32.git +board = ... +... +``` + +# Configuration + +Please navigate to [documentation](http://docs.platformio.org/page/platforms/espressif32.html). From 0bcb23cfc1646b7448a185fd1c0ac124b64de4fa Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 25 Jan 2018 17:00:55 +0200 Subject: [PATCH 4/7] Fix flash size for esp32vn-iot-uno board --- boards/esp32vn-iot-uno.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/esp32vn-iot-uno.json b/boards/esp32vn-iot-uno.json index bd18d3355..90cecf6e5 100644 --- a/boards/esp32vn-iot-uno.json +++ b/boards/esp32vn-iot-uno.json @@ -23,7 +23,7 @@ "upload": { "flash_size": "4MB", "maximum_ram_size": 294912, - "maximum_size": 1044464, + "maximum_size": 1310720, "require_upload_port": true, "speed": 115200, "wait_for_upload_port": true From c56ceac6435881936ffbc9ca9855f790cba06c65 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 26 Jan 2018 21:05:38 +0200 Subject: [PATCH 5/7] Allow to override PROGNAME --- builder/frameworks/espidf.py | 2 -- builder/main.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/builder/frameworks/espidf.py b/builder/frameworks/espidf.py index 4eb5bc982..1c806a8c9 100644 --- a/builder/frameworks/espidf.py +++ b/builder/frameworks/espidf.py @@ -34,8 +34,6 @@ FRAMEWORK_DIR = platform.get_package_dir("framework-espidf") assert FRAMEWORK_DIR and isdir(FRAMEWORK_DIR) -FRAMEWORK_VERSION = platform.get_package_version( - "framework-espidf") def parse_mk(path): diff --git a/builder/main.py b/builder/main.py index 0dee70ef3..9043c571f 100644 --- a/builder/main.py +++ b/builder/main.py @@ -168,7 +168,7 @@ def _get_board_f_flash(env): if "nobuild" in COMMAND_LINE_TARGETS: target_firm = join("$BUILD_DIR", "${PROGNAME}.bin") else: - target_firm = env.ElfToBin(target_elf) + target_firm = env.ElfToBin(join("$BUILD_DIR", "${PROGNAME}"), target_elf) AlwaysBuild(env.Alias("nobuild", target_firm)) target_buildprog = env.Alias("buildprog", target_firm, target_firm) From c284aaeda184b9d13760d5b64ab5c8a20eb6fa65 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 8 Feb 2018 15:45:31 +0200 Subject: [PATCH 6/7] Update Arduino Core to the upstream version --- examples/arduino-wifiscan/platformio.ini | 5 +++++ platform.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/arduino-wifiscan/platformio.ini b/examples/arduino-wifiscan/platformio.ini index 2f796f607..0ab69049e 100644 --- a/examples/arduino-wifiscan/platformio.ini +++ b/examples/arduino-wifiscan/platformio.ini @@ -7,6 +7,11 @@ ; Please visit documentation for the other options and examples ; http://docs.platformio.org/page/projectconf.html +[env:esp32dev] +platform = espressif32 +framework = arduino +board = esp32dev + [env:nano32] platform = espressif32 framework = arduino diff --git a/platform.json b/platform.json index b99f9e304..15882e04e 100644 --- a/platform.json +++ b/platform.json @@ -45,7 +45,7 @@ "framework-arduinoespressif32": { "type": "framework", "optional": true, - "version": "~1.3.2" + "version": "~1.4.0" }, "framework-espidf": { "type": "framework", From 19ec4c0d76e376dc6cfbc85c408ab7fe96f0913b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 8 Feb 2018 16:15:30 +0200 Subject: [PATCH 7/7] Bump version to 0.12.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 15882e04e..a243423e6 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-espressif32.git" }, - "version": "0.11.1", + "version": "0.12.0", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json",