From b60c761ccedbce89036b636ae7c8a4ea104b3dac Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 Sep 2015 12:53:04 +0300 Subject: [PATCH 01/20] Fix firmware uploading to Arduino Leonardo board using Mac OS // Resolve #287 --- HISTORY.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index d1137dcc..7ed06586 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -16,6 +16,8 @@ PlatformIO 2.0 * Found solution for "pip/scons error: option --single-version-externally-managed not recognized" when install PlatformIO using ``pip`` package manager (`issue #279 `_) +* Fixed firmware uploading to Arduino Leonardo board using Mac OS + (`issue #287 `_) * Fixed `SConsNotInstalled` error for Linux Debian-based distributives 2.3.1 (2015-09-06) From 605b5755bf6e79107dab5037de4159e4c14b21b1 Mon Sep 17 00:00:00 2001 From: Matthew Lewis Date: Tue, 22 Sep 2015 14:54:32 -0500 Subject: [PATCH 02/20] config: add LightBlue Bean board definition and docs --- docs/frameworks/arduino.rst | 20 ++++++++++++++++++++ docs/platforms/atmelavr.rst | 20 ++++++++++++++++++++ platformio/boards/punchthrough.json | 22 ++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 platformio/boards/punchthrough.json diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index ba909a08..df2ab830 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -630,6 +630,26 @@ PanStamp - 32 Kb - 4 Kb +Punch Through +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lightblue-bean`` + - `LightBlue Bean `_ + - ATMEGA32U4 + - 8 MHz + - 32 Kb + - 2 Kb + Quirkbot ~~~~~~~~ diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index 7a536133..e54f28f5 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -601,6 +601,26 @@ PanStamp - 32 Kb - 2 Kb +Punch Through +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lightblue-bean`` + - `LightBlue Bean `_ + - ATMEGA32U4 + - 8 MHz + - 32 Kb + - 2 Kb + Quirkbot ~~~~~~~~ diff --git a/platformio/boards/punchthrough.json b/platformio/boards/punchthrough.json new file mode 100644 index 00000000..bf6fc85f --- /dev/null +++ b/platformio/boards/punchthrough.json @@ -0,0 +1,22 @@ +{ + "lightblue-bean": { + "name": "LightBlue Bean", + "vendor": "Punch Through Design", + "url": "https://punchthrough.com/bean", + + "platform": "atmelavr", + "frameworks": ["arduino"], + + "build": { + "core": "bean", + "variant": "bean", + "extra_flags": "-DARDUINO_ARCH_AVR", + "mcu": "atmega328p", + "f_cpu": "8000000L" + }, + "upload": { + "maximum_size": 32256, + "maximum_ram_size": 2048 + } + } +} From c997495b5d7ab1889ca40f048f3e8e058bdb9821 Mon Sep 17 00:00:00 2001 From: Matthew Lewis Date: Tue, 22 Sep 2015 15:04:06 -0500 Subject: [PATCH 03/20] docs: fix underline length --- docs/frameworks/arduino.rst | 2 +- docs/platforms/atmelavr.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index df2ab830..290d1c90 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -631,7 +631,7 @@ PanStamp - 4 Kb Punch Through -~~~~~~~~ +~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index e54f28f5..b49b7456 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -602,7 +602,7 @@ PanStamp - 2 Kb Punch Through -~~~~~~~~ +~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 From ee7fe1fc10c3fd844ddd59f47e757d8415c3a475 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 23 Sep 2015 15:55:19 +0300 Subject: [PATCH 04/20] Add to FAQ info about Archlinux issue with libncurses.so.5 // Resolve #291 --- docs/faq.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/faq.rst b/docs/faq.rst index d1d7550a..59aedacf 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -156,3 +156,8 @@ ARM toolchain: cc1plus: error while loading shared libraries See related answers for `error while loading shared libraries `_. + +Archlinux: libncurses.so.5: cannot open shared object file +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Answered in `issue #291 `_. From 46d1c2c86cbb8683e29500b52dff48d4df596e84 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 23 Sep 2015 16:35:31 +0300 Subject: [PATCH 05/20] Fix broken lock file for "appstate" storage // Resolve #288 --- HISTORY.rst | 7 +++++++ platformio/__init__.py | 2 +- platformio/app.py | 18 +++++++++++++++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 7ed06586..d18ee318 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,13 @@ Release History PlatformIO 2.0 -------------- +2.3.3 (2015-09-??) +~~~~~~~~~~~~~~~~~~ + +* Fixed broken lock file for "appstate" storage + (`issue #288 `_) + + 2.3.2 (2015-09-10) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index 90f39185..5772010f 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, 2) +VERSION = (2, 3, "3.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/app.py b/platformio/app.py index 6a6f7ee8..8690ed21 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -3,7 +3,8 @@ import json from os import environ, getenv -from os.path import isfile, join +from os.path import getmtime, isfile, join +from time import time from lockfile import LockFile @@ -68,9 +69,8 @@ class State(object): def __enter__(self): try: + self._lock_state_file() if isfile(self.path): - self._lock = LockFile(self.path) - self._lock.acquire() with open(self.path, "r") as fp: self._state = json.load(fp) except ValueError: @@ -85,6 +85,18 @@ class State(object): json.dump(self._state, fp, indent=4) else: json.dump(self._state, fp) + self._unlock_state_file() + + def _lock_state_file(self): + self._lock = LockFile(self.path) + + if (self._lock.is_locked() and + (time() - getmtime(self._lock.lock_file)) > 10): + self._lock.break_lock() + + self._lock.acquire() + + def _unlock_state_file(self): if self._lock: self._lock.release() From 0668d6d2908fbcd9290dc090110a125e74cdf729 Mon Sep 17 00:00:00 2001 From: Matthew Lewis Date: Wed, 23 Sep 2015 11:54:00 -0500 Subject: [PATCH 06/20] docs: remove LightBlue Bean docs --- docs/frameworks/arduino.rst | 20 -------------------- docs/platforms/atmelavr.rst | 20 -------------------- 2 files changed, 40 deletions(-) diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index 290d1c90..ba909a08 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -630,26 +630,6 @@ PanStamp - 32 Kb - 4 Kb -Punch Through -~~~~~~~~~~~~~ - -.. list-table:: - :header-rows: 1 - - * - Type ``board`` - - Name - - Microcontroller - - Frequency - - Flash - - RAM - - * - ``lightblue-bean`` - - `LightBlue Bean `_ - - ATMEGA32U4 - - 8 MHz - - 32 Kb - - 2 Kb - Quirkbot ~~~~~~~~ diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index b49b7456..7a536133 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -601,26 +601,6 @@ PanStamp - 32 Kb - 2 Kb -Punch Through -~~~~~~~~~~~~~ - -.. list-table:: - :header-rows: 1 - - * - Type ``board`` - - Name - - Microcontroller - - Frequency - - Flash - - RAM - - * - ``lightblue-bean`` - - `LightBlue Bean `_ - - ATMEGA32U4 - - 8 MHz - - 32 Kb - - 2 Kb - Quirkbot ~~~~~~~~ From f812e74324799401fcc3388d6e676bbb363eae7c Mon Sep 17 00:00:00 2001 From: Matthew Lewis Date: Wed, 23 Sep 2015 11:57:54 -0500 Subject: [PATCH 07/20] config: fix Punch Through vendor name --- platformio/boards/punchthrough.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/boards/punchthrough.json b/platformio/boards/punchthrough.json index bf6fc85f..6e7d41ed 100644 --- a/platformio/boards/punchthrough.json +++ b/platformio/boards/punchthrough.json @@ -1,7 +1,7 @@ { "lightblue-bean": { "name": "LightBlue Bean", - "vendor": "Punch Through Design", + "vendor": "Punch Through", "url": "https://punchthrough.com/bean", "platform": "atmelavr", From 3cb41cf6b0386de6ab5b06b22c89f6453da5a272 Mon Sep 17 00:00:00 2001 From: Daniel Kuku Date: Sun, 27 Sep 2015 03:02:34 +0100 Subject: [PATCH 08/20] Update ststm32.json added nucleo_f446re --- platformio/boards/ststm32.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/platformio/boards/ststm32.json b/platformio/boards/ststm32.json index e57d9452..43913e6d 100644 --- a/platformio/boards/ststm32.json +++ b/platformio/boards/ststm32.json @@ -299,6 +299,22 @@ "url": "https://developer.mbed.org/platforms/ST-Nucleo-F411RE/", "vendor": "ST" }, + "nucleo_f446re": { + "build": { + "f_cpu": "180000000L", + "cpu": "cortex-m4", + "mcu": "stm32f446ret6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F446RE", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 131072, + "maximum_size": 524288 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F446RE/", + "vendor": "ST" + }, "nucleo_l053r8": { "build": { "f_cpu": "48000000L", From d99a57365f11b1cefefda4a4050db27115e6905c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 28 Sep 2015 12:09:03 +0100 Subject: [PATCH 09/20] Add support for LightBlue Bean board // Issue #292 --- HISTORY.rst | 5 +++-- docs/frameworks/arduino.rst | 20 ++++++++++++++++++++ docs/platforms/atmelavr.rst | 20 ++++++++++++++++++++ platformio/__init__.py | 2 +- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index d18ee318..066b55e2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,13 +4,14 @@ Release History PlatformIO 2.0 -------------- -2.3.3 (2015-09-??) +2.3.3 (2015-??-??) ~~~~~~~~~~~~~~~~~~ +* Added support for LightBlue Bean board + (`pull #292 `_) * Fixed broken lock file for "appstate" storage (`issue #288 `_) - 2.3.2 (2015-09-10) ~~~~~~~~~~~~~~~~~~ diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index ba909a08..2902cd6d 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -630,6 +630,26 @@ PanStamp - 32 Kb - 4 Kb +Punch Through +~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lightblue-bean`` + - `LightBlue Bean `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + Quirkbot ~~~~~~~~ diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index 7a536133..cfd264d0 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -601,6 +601,26 @@ PanStamp - 32 Kb - 2 Kb +Punch Through +~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lightblue-bean`` + - `LightBlue Bean `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + Quirkbot ~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index 5772010f..3ed50770 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, "3.dev0") +VERSION = (2, 3, "3.dev1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From a8dd5d85a5348b123ea5eadf83b875a9747d6ff6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 28 Sep 2015 13:19:07 +0100 Subject: [PATCH 10/20] Add support for ST Nucleo F446RE board // Pull #293 --- HISTORY.rst | 2 ++ docs/frameworks/mbed.rst | 7 +++++++ docs/platforms/ststm32.rst | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 066b55e2..36b0addf 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,6 +9,8 @@ PlatformIO 2.0 * Added support for LightBlue Bean board (`pull #292 `_) +* Added support for ST Nucleo F446RE board + (`pull #293 `_) * Fixed broken lock file for "appstate" storage (`issue #288 `_) diff --git a/docs/frameworks/mbed.rst b/docs/frameworks/mbed.rst index 4b2feb88..1d54bc9d 100644 --- a/docs/frameworks/mbed.rst +++ b/docs/frameworks/mbed.rst @@ -469,6 +469,13 @@ ST - 512 Kb - 128 Kb + * - ``nucleo_f446re`` + - `ST Nucleo F446RE `_ + - STM32F446RET6 + - 180 MHz + - 512 Kb + - 128 Kb + * - ``nucleo_l053r8`` - `ST Nucleo L053R8 `_ - STM32L053R8T6 diff --git a/docs/platforms/ststm32.rst b/docs/platforms/ststm32.rst index 05cb3f18..7e1d16b4 100644 --- a/docs/platforms/ststm32.rst +++ b/docs/platforms/ststm32.rst @@ -256,6 +256,13 @@ ST - 512 Kb - 128 Kb + * - ``nucleo_f446re`` + - `ST Nucleo F446RE `_ + - STM32F446RET6 + - 180 MHz + - 512 Kb + - 128 Kb + * - ``nucleo_l053r8`` - `ST Nucleo L053R8 `_ - STM32L053R8T6 From a714e6084ac3ee14871ec6c4ab0babfd5b2298f2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 28 Sep 2015 16:57:28 +0100 Subject: [PATCH 11/20] Add to FAQ "Unable to install PlatformIO: [Errno 1] Operation not permitted" // Resolve #295 --- docs/faq.rst | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index 59aedacf..8aa0bd0c 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -60,23 +60,11 @@ the project developed using PlatformIO is as follows: Troubleshooting --------------- -.. _faq_troubleshooting_pioblocksprompt: - -PlatformIO blocks command execution using user prompt -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you are going to run *PlatformIO* from **subprocess**, you **MUST -DISABLE** all prompts. It will allow you to avoid blocking. -There are a few options: - -- using :option:`platformio --force` option before each command -- using environment variable :envvar:`PLATFORMIO_SETTING_ENABLE_PROMPTS=No ` -- disable global setting ``enable_prompts`` via :ref:`cmd_settings` command -- masking under Continuous Integration system via environment variable - :envvar:`CI=true `. +Installation +~~~~~~~~~~~~ PlatformIO and ``scons`` aren't installed properly -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +'''''''''''''''''''''''''''''''''''''''''''''''''' Try these solutions: @@ -92,10 +80,30 @@ Try these solutions: .. _faq_troubleshooting_sconssingverextmanaged: PIP & SCons Error: option --single-version-externally-managed not recognized -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Answered in `issue #279 `_. +[Errno 1] Operation not permitted +''''''''''''''''''''''''''''''''' + +Answered in `issue #295 `_. + +.. _faq_troubleshooting_pioblocksprompt: + +PlatformIO blocks command execution using user prompt +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you are going to run *PlatformIO* from **subprocess**, you **MUST +DISABLE** all prompts. It will allow you to avoid blocking. +There are a few options: + +- using :option:`platformio --force` option before each command +- using environment variable :envvar:`PLATFORMIO_SETTING_ENABLE_PROMPTS=No ` +- disable global setting ``enable_prompts`` via :ref:`cmd_settings` command +- masking under Continuous Integration system via environment variable + :envvar:`CI=true `. + .. _faq_troubleshooting_pionotfoundinpath: Program ``platformio`` not found in PATH From 1b4d4f569586ea2d242feaa2e0336070f17df56a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 30 Sep 2015 14:54:07 +0100 Subject: [PATCH 12/20] Handle Atom & Vim as IDE --- platformio/telemetry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/telemetry.py b/platformio/telemetry.py index 9f1c3c89..0d88cc65 100644 --- a/platformio/telemetry.py +++ b/platformio/telemetry.py @@ -248,7 +248,7 @@ def measure_caller(calller_id): "action": "Misc", "label": calller_id } - if calller_id in ProjectGenerator.get_supported_ides(): + if calller_id in (["atom", "vim"] + ProjectGenerator.get_supported_ides()): event['action'] = "IDE" on_event(**event) From ad1666dd0aef3f9ac89175c75694d4fed2ec4dd6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 30 Sep 2015 16:54:12 +0100 Subject: [PATCH 13/20] Fix double quotes in defines for Project Generator // Issue #294 --- platformio/__init__.py | 2 +- platformio/builder/tools/piomisc.py | 2 +- platformio/ide/projectgenerator.py | 1 + platformio/ide/tpls/clion/CMakeLists.txt.tpl | 2 +- platformio/ide/tpls/visualstudio/platformio.vcxproj.tpl | 4 ++-- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 3ed50770..3547d272 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, "3.dev1") +VERSION = (2, 3, "3.dev2") __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 f54c317e..ae1e2323 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -147,7 +147,7 @@ def DumpIDEData(env): for item in env.get("CPPDEFINES", []): if isinstance(item, list): item = "=".join(item) - data['defines'].append(env.subst(item)) + data['defines'].append(env.subst(item).replace('\\"', '"')) # special symbol for Atmel AVR MCU board = env.get("BOARD_OPTIONS", {}) diff --git a/platformio/ide/projectgenerator.py b/platformio/ide/projectgenerator.py index 6597b41d..7e305092 100644 --- a/platformio/ide/projectgenerator.py +++ b/platformio/ide/projectgenerator.py @@ -125,6 +125,7 @@ class ProjectGenerator(object): "env_pathsep": os.pathsep, "env_path": self._fix_os_path(os.getenv("PATH")) }) + print self._tplvars @staticmethod def _fix_os_path(path): diff --git a/platformio/ide/tpls/clion/CMakeLists.txt.tpl b/platformio/ide/tpls/clion/CMakeLists.txt.tpl index fe6d5807..b8e7ed62 100644 --- a/platformio/ide/tpls/clion/CMakeLists.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeLists.txt.tpl @@ -13,7 +13,7 @@ include_directories("{{include}}") % end % for define in defines: -add_definitions(-D{{define}}) +add_definitions(-D{{!define}}) % end add_custom_target( diff --git a/platformio/ide/tpls/visualstudio/platformio.vcxproj.tpl b/platformio/ide/tpls/visualstudio/platformio.vcxproj.tpl index 75dc2f01..c0201b39 100644 --- a/platformio/ide/tpls/visualstudio/platformio.vcxproj.tpl +++ b/platformio/ide/tpls/visualstudio/platformio.vcxproj.tpl @@ -41,13 +41,13 @@ platformio -f -c visualstudio run platformio -f -c visualstudio run --target clean - {{";".join(defines)}} + {{!";".join(defines)}} {{";".join(["$(HOMEDRIVE)$(HOMEPATH)%s" % i.replace(user_home_dir, "") if i.startswith(user_home_dir) else i for i in includes])}} platformio run platformio run --target clean - {";".join(defines)}} + {{!";".join(defines)}} {{";".join(["$(HOMEDRIVE)$(HOMEPATH)%s" % i.replace(user_home_dir, "") if i.startswith(user_home_dir) else i for i in includes])}} From 43ca0e149f568ef19a4e44e9117e861d5d632541 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 30 Sep 2015 16:56:13 +0100 Subject: [PATCH 14/20] Remove debug info --- platformio/ide/projectgenerator.py | 1 - 1 file changed, 1 deletion(-) diff --git a/platformio/ide/projectgenerator.py b/platformio/ide/projectgenerator.py index 7e305092..6597b41d 100644 --- a/platformio/ide/projectgenerator.py +++ b/platformio/ide/projectgenerator.py @@ -125,7 +125,6 @@ class ProjectGenerator(object): "env_pathsep": os.pathsep, "env_path": self._fix_os_path(os.getenv("PATH")) }) - print self._tplvars @staticmethod def _fix_os_path(path): From 12b29a760a667b5cc884dd3f436fcdd9c943b9bb Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 1 Oct 2015 17:04:26 +0100 Subject: [PATCH 15/20] More explanations about NotPlatformProject --- platformio/exception.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platformio/exception.py b/platformio/exception.py index ce268018..84b6aca0 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -87,7 +87,9 @@ class FDSHASumMismatch(PlatformioException): class NotPlatformProject(PlatformioException): - MESSAGE = "Not a PlatformIO project (%s). Use `platformio init` command" + MESSAGE = "Not a PlatformIO project. `platformio.ini` file has not been "\ + "found in current working directory (%s). To initialize new project "\ + "please use `platformio init` command" class UndefinedEnvPlatform(PlatformioException): From 4dcef8930199f19f1bd0f36563e18c7c0c7df07a Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Fri, 2 Oct 2015 16:11:00 +0300 Subject: [PATCH 16/20] Update espressif platform // Resolve #296, #297 --- platformio/boards/espressif.json | 2 +- platformio/builder/scripts/espressif.py | 91 ++++++++++++++----- .../builder/scripts/frameworks/arduino.py | 2 +- 3 files changed, 69 insertions(+), 26 deletions(-) diff --git a/platformio/boards/espressif.json b/platformio/boards/espressif.json index 100517a1..e9017d2e 100644 --- a/platformio/boards/espressif.json +++ b/platformio/boards/espressif.json @@ -3,7 +3,7 @@ "build": { "core": "esp8266", "extra_flags": "-DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266", - "f_cpu": "80000000L", + "f_cpu": "40000000L", "ldscript": "esp8266.flash.512k.ld", "mcu": "esp8266", "variant": "generic" diff --git a/platformio/builder/scripts/espressif.py b/platformio/builder/scripts/espressif.py index 09c7196b..d713a897 100644 --- a/platformio/builder/scripts/espressif.py +++ b/platformio/builder/scripts/espressif.py @@ -31,7 +31,7 @@ env.Replace( ASPPFLAGS=["-x", "assembler-with-cpp"], CFLAGS=[ - "-std=c99", + "-std=gnu99", "-Wpointer-arith", "-Wno-implicit-function-declaration", "-Wl,-EL", @@ -76,9 +76,7 @@ env.Replace( "-cb", "$UPLOAD_SPEED", "-cp", "$UPLOAD_PORT", "-ca", "0x00000", - "-cf", "${SOURCES[0]}", - "-ca", "0x40000" if "FRAMEWORK" not in env else "0x10000", - "-cf", "${SOURCES[1]}" + "-cf", "$SOURCE" ], UPLOADCMD='$UPLOADER $UPLOADERFLAGS', @@ -86,23 +84,35 @@ env.Replace( PROGSUFFIX=".elf" ) +if "FRAMEWORK" in env: + env.Append( + LINKFLAGS=[ + "-Wl,-wrap,system_restart_local", + "-Wl,-wrap,register_chipv6_phy" + ] + ) + env.Append( BUILDERS=dict( ElfToBin=Builder( action=" ".join([ "$UPLOADER", + "-eo", join("$PLATFORMFW_DIR", "bootloaders", + "eboot", "eboot.elf"), + "-bo", "$TARGET", + "-bm", "dio", + "-bf", "${BOARD_OPTIONS['build']['f_cpu'][:2]}", + "-bz", str(int(env.get("BOARD_OPTIONS", {}).get( + "upload", {}).get("maximum_size") / 1024)) + "K", + "-bs", ".text", + "-bp", "4096", + "-ec", "-eo", "$SOURCES", - "-bo", "${TARGETS[0]}", - "-bm", "qio", - "-bf", "40", - "-bz", "512K", + "-bs", ".irom0.text", "-bs", ".text", "-bs", ".data", "-bs", ".rodata", - "-bc", "-ec", - "-eo", "$SOURCES", - "-es", ".irom0.text", "${TARGETS[1]}", - "-ec", "-v" + "-bc", "-ec" ]), suffix=".bin" ) @@ -119,13 +129,43 @@ if "FRAMEWORK" not in env: join("$PIOPACKAGES_DIR", "sdk-esp8266", "include"), "$PROJECTSRC_DIR" ], - LIBPATH=[join("$PIOPACKAGES_DIR", "sdk-esp8266", "lib")] + LIBPATH=[join("$PIOPACKAGES_DIR", "sdk-esp8266", "lib")], + BUILDERS=dict( + ElfToBin=Builder( + action=" ".join([ + "$UPLOADER", + "-eo", "$SOURCES", + "-bo", "${TARGETS[0]}", + "-bm", "qio", + "-bf", "40", + "-bz", "512K", + "-bs", ".text", + "-bs", ".data", + "-bs", ".rodata", + "-bc", "-ec", + "-eo", "$SOURCES", + "-es", ".irom0.text", "${TARGETS[1]}", + "-ec", "-v" + ]), + suffix=".bin" + ) + ) ) env.Replace( LDSCRIPT_PATH=join( "$PIOPACKAGES_DIR", "sdk-esp8266", "ld", "eagle.app.v6.ld"), LIBS=["c", "gcc", "phy", "pp", "net80211", "lwip", "wpa", "main", - "json", "upgrade", "smartconfig", "pwm", "at", "ssl"] + "json", "upgrade", "smartconfig", "pwm", "at", "ssl"], + UPLOADERFLAGS=[ + "-vv", + "-cd", "ck", + "-cb", "$UPLOAD_SPEED", + "-cp", "$UPLOAD_PORT", + "-ca", "0x00000", + "-cf", "${SOURCES[0]}", + "-ca", "0x40000", + "-cf", "${SOURCES[1]}" + ] ) # @@ -139,17 +179,20 @@ target_elf = env.BuildProgram() # if "uploadlazy" in COMMAND_LINE_TARGETS: - target_firm = [ - join("$BUILD_DIR", "firmware_00000.bin"), - join("$BUILD_DIR", "firmware_%s.bin" % - ("40000" if "FRAMEWORK" not in env else "10000")) - ] + if "FRAMEWORK" not in env: + target_firm = [ + join("$BUILD_DIR", "firmware_00000.bin"), + join("$BUILD_DIR", "firmware_40000.bin") + ] + else: + target_firm = join("$BUILD_DIR", "firmware.bin") else: - target_firm = env.ElfToBin( - [join("$BUILD_DIR", "firmware_00000"), - join("$BUILD_DIR", "firmware_%s" % - ("40000" if "FRAMEWORK" not in env else "10000"))], target_elf) - + if "FRAMEWORK" not in env: + target_firm = env.ElfToBin( + [join("$BUILD_DIR", "firmware_00000"), + join("$BUILD_DIR", "firmware_40000")], target_elf) + else: + target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf) # # Target: Print binary size diff --git a/platformio/builder/scripts/frameworks/arduino.py b/platformio/builder/scripts/frameworks/arduino.py index 8d321880..69e00df3 100644 --- a/platformio/builder/scripts/frameworks/arduino.py +++ b/platformio/builder/scripts/frameworks/arduino.py @@ -47,7 +47,7 @@ elif env.get("PLATFORM") == "espressif": CPPPATH=[join("$PLATFORMFW_DIR", "sdk", "include")], LIBPATH=[join("$PLATFORMFW_DIR", "sdk", "lib")], LIBS=["smartconfig", "pp", "main", "wpa", "lwip", - "net80211", "phy", "hal", "gcc", "m"] + "net80211", "wps", "crypto", "phy", "hal", "gcc", "m"] ) env.Replace(PLATFORMFW_DIR=PLATFORMFW_DIR) From e22ab787dd7aad3e8d368e85bfbd0169477f9561 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 2 Oct 2015 15:34:36 +0100 Subject: [PATCH 17/20] Fix ESP8266 compile errors about RAM size when adding 1 library // Resolve #297 --- HISTORY.rst | 2 ++ platformio/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 36b0addf..ff35a841 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -13,6 +13,8 @@ PlatformIO 2.0 (`pull #293 `_) * Fixed broken lock file for "appstate" storage (`issue #288 `_) +* Fixed ESP8266 compile errors about RAM size when adding 1 library + (`issue #296 `_) 2.3.2 (2015-09-10) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index 3547d272..abc7c932 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, "3.dev2") +VERSION = (2, 3, "3.dev3") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 3c36eafdfa90481e4861ef2a370b08bfe0f0d2e4 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 2 Oct 2015 16:14:04 +0100 Subject: [PATCH 18/20] Avoid pip cache when problem occurs for upgrade process // Issue #295 --- platformio/commands/upgrade.py | 5 +++++ scripts/get-platformio.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/platformio/commands/upgrade.py b/platformio/commands/upgrade.py index dbfbee86..c4c9011e 100644 --- a/platformio/commands/upgrade.py +++ b/platformio/commands/upgrade.py @@ -32,6 +32,11 @@ def cli(): for cmd in cmds: r = None r = util.exec_command(cmd) + + # try pip with disabled cache + if r['returncode'] != 0 and cmd[0] == "pip": + r = util.exec_command(["pip", "--no-cache-dir"] + cmd[1:]) + assert r['returncode'] == 0 assert last in r['out'].strip() click.secho( diff --git a/scripts/get-platformio.py b/scripts/get-platformio.py index 1fad5117..bcab3d14 100644 --- a/scripts/get-platformio.py +++ b/scripts/get-platformio.py @@ -97,7 +97,7 @@ def main(): ("Fixing Windows %PATH% Environment", fix_winpython_pathenv, []), ("Installing Python Package Manager", install_pip, []), ("Installing PlatformIO and dependencies", install_pypi_packages, - [["setuptools", "virtualenv", "platformio"]]) + [["setuptools", "platformio"]]) ] if not IS_WINDOWS: From 2c0d26e06dc31ef4c2ab5286bbcfca1ed9cf2df1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 2 Oct 2015 16:20:07 +0100 Subject: [PATCH 19/20] Skip empty serial ports // Issue #294 --- platformio/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio/util.py b/platformio/util.py index f9ba07f9..fa71848b 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -249,7 +249,8 @@ def get_serialports(): from serial.tools.list_ports_posix import comports else: raise exception.GetSerialPortsError(os.name) - return [{"port": p, "description": d, "hwid": h} for p, d, h in comports()] + return [{"port": p, "description": d, "hwid": h} + for p, d, h in comports() if p] def get_logicaldisks(): From e1c9cb2c0043b20e6bb8ebb7312b0b13cd5d1080 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 2 Oct 2015 16:23:46 +0100 Subject: [PATCH 20/20] Version bump to 2.3.3 (issues #263, #288, #292, #295, #296, #297) --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index ff35a841..3c4a5f7d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release History PlatformIO 2.0 -------------- -2.3.3 (2015-??-??) +2.3.3 (2015-10-02) ~~~~~~~~~~~~~~~~~~ * Added support for LightBlue Bean board diff --git a/platformio/__init__.py b/platformio/__init__.py index abc7c932..33f6ab52 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, "3.dev3") +VERSION = (2, 3, 3) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio"