diff --git a/README.md b/README.md index 559488f..26d28d9 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 +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: -# install development version -> platformio platform install https://github.com/platformio/platform-espressif32.git +## 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). diff --git a/boards/esp32vn-iot-uno.json b/boards/esp32vn-iot-uno.json index bd18d33..90cecf6 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 diff --git a/builder/frameworks/espidf.py b/builder/frameworks/espidf.py index 4eb5bc9..1c806a8 100644 --- a/builder/frameworks/espidf.py +++ b/builder/frameworks/espidf.py @@ -34,8 +34,6 @@ platform = env.PioPlatform() 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 187ce01..9043c57 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 @@ env.Replace( SIZEPRINTCMD='$SIZETOOL -B -d $SOURCES', - PROGNAME="firmware", PROGSUFFIX=".elf" ) @@ -124,6 +124,10 @@ env.Append( 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 @@ if env.subst("$PIOFRAMEWORK") == "arduino": # 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(join("$BUILD_DIR", "${PROGNAME}"), target_elf) +AlwaysBuild(env.Alias("nobuild", target_firm)) target_buildprog = env.Alias("buildprog", target_firm, target_firm) diff --git a/examples/arduino-wifiscan/platformio.ini b/examples/arduino-wifiscan/platformio.ini index 2f796f6..0ab6904 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 23eb20d..a243423 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", @@ -45,7 +45,7 @@ "framework-arduinoespressif32": { "type": "framework", "optional": true, - "version": "~1.3.1" + "version": "~1.4.0" }, "framework-espidf": { "type": "framework", diff --git a/platform.py b/platform.py new file mode 100644 index 0000000..25c631a --- /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)