diff --git a/HISTORY.rst b/HISTORY.rst index d1137dcc..3c4a5f7d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,18 @@ Release History PlatformIO 2.0 -------------- +2.3.3 (2015-10-02) +~~~~~~~~~~~~~~~~~~ + +* 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 `_) +* Fixed ESP8266 compile errors about RAM size when adding 1 library + (`issue #296 `_) + 2.3.2 (2015-09-10) ~~~~~~~~~~~~~~~~~~ @@ -16,6 +28,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) diff --git a/docs/faq.rst b/docs/faq.rst index d1d7550a..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 @@ -156,3 +164,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 `_. 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/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/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/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 diff --git a/platformio/__init__.py b/platformio/__init__.py index 90f39185..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, 2) +VERSION = (2, 3, 3) __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() 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/boards/punchthrough.json b/platformio/boards/punchthrough.json new file mode 100644 index 00000000..6e7d41ed --- /dev/null +++ b/platformio/boards/punchthrough.json @@ -0,0 +1,22 @@ +{ + "lightblue-bean": { + "name": "LightBlue Bean", + "vendor": "Punch Through", + "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 + } + } +} 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", 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) 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/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/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): 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])}} 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) 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(): 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: