From d04a7de26b2da76acd478874a591aaa20f1d9c7f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 14 Jun 2016 20:48:56 +0300 Subject: [PATCH 01/16] Restore PIO macros if it was deleted by framework --- platformio/builder/tools/platformio.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 863e0ef1..77d1f60e 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -35,10 +35,13 @@ SRC_DEFAULT_FILTER = " ".join([ def BuildProgram(env): - env.Append( - CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format( - *pioversion_to_intstr())], - ) + def _append_pio_macros(): + env.AppendUnique( + CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format( + *pioversion_to_intstr())], + ) + + _append_pio_macros() # fix ASM handling under non-casitive OS if not case_sensitive_suffixes(".s", ".S"): @@ -60,6 +63,9 @@ def BuildProgram(env): env.BuildFrameworks([ f.lower().strip() for f in env.get("FRAMEWORK", "").split(",")]) + # restore PIO macros if it was deleted by framework + _append_pio_macros() + # build dependent libs deplibs = env.BuildDependentLibraries("$PROJECTSRC_DIR") From 7422b99b42ae0798774ea1d96238b73951222c00 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 14 Jun 2016 20:53:30 +0300 Subject: [PATCH 02/16] Process "$BUILD_UNFLAGS" variable --- platformio/builder/scripts/frameworks/mbed.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platformio/builder/scripts/frameworks/mbed.py b/platformio/builder/scripts/frameworks/mbed.py index 7c04af31..4f8fd57e 100644 --- a/platformio/builder/scripts/frameworks/mbed.py +++ b/platformio/builder/scripts/frameworks/mbed.py @@ -266,9 +266,12 @@ env.Replace( # restore external build flags env.ProcessFlags([ - env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags"), - env.get("BUILD_FLAGS") + env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags") ]) +# remove base flags +env.ProcessUnFlags(env.get("BUILD_UNFLAGS")) +# apply user flags +env.ProcessFlags([env.get("BUILD_FLAGS")]) # Hook for K64F and K22F if board_type in ("frdm_k22f", "frdm_k64f"): From 29781338627005ece00aebec48c33a091a28025b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 00:59:44 +0300 Subject: [PATCH 03/16] Fix upload size checker --- platformio/builder/tools/pioupload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 874d4086..ede4ca74 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -155,7 +155,7 @@ def CheckUploadSize(_, target, source, env): # pylint: disable=W0613,W0621 print "Check program size..." sysenv = environ.copy() sysenv['PATH'] = str(env['ENV']['PATH']) - cmd = [env.subst("$SIZETOOL"), "-B", str(source[0])] + cmd = [env.subst("$SIZETOOL"), "-B", str(target[0])] result = util.exec_command(cmd, env=sysenv) if result['returncode'] != 0: return From b842a1d9b10bb46a94c3aed5a545718f6e9c0602 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 13:18:29 +0300 Subject: [PATCH 04/16] Update HISTORY.rst --- HISTORY.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index b73cb776..edd8c06a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -8,10 +8,12 @@ PlatformIO 2.0 ~~~~~~~~~~~~~~~~~~~ * Added support for ST Nucleo L031K6 board to ARM mbed framework +* Process ``build_unflags`` option for ARM mbed framework * Fixed issue with ARM mbed framework with ``-u _printf_float`` and ``-u _scanf_float`` when parsing ``$LINKFLAGS`` * Fixed issue with ARM mbed framework and extra includes for the custom boards, such as Seeeduino Arch Pro +* Improved a check of program size before uploading to the board 2.10.1 (2016-06-13) ~~~~~~~~~~~~~~~~~~~ From 9655ca229f6b6fa6170a2e3e4e753f42ec2e29d5 Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Wed, 15 Jun 2016 14:31:07 +0300 Subject: [PATCH 05/16] Update intel_arc32 platform --- platformio/boards/intel.json | 5 +++-- platformio/builder/scripts/intel_arc32.py | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platformio/boards/intel.json b/platformio/boards/intel.json index 33e35e3c..27e62b7f 100644 --- a/platformio/boards/intel.json +++ b/platformio/boards/intel.json @@ -5,7 +5,7 @@ "extra_flags": "-DARDUINO_ARCH_ARC32 -D__ARDUINO_ARC__", "f_cpu": "32000000L", "ldscript": "flash.ld", - "mcu": "ARCv2EM", + "cpu": "quarkse_em", "usb_product": "Genuino 101", "variant": "arduino_101", "hwids": [ @@ -17,7 +17,7 @@ "platform": "intel_arc32", "upload": { "maximum_ram_size": 81920, - "maximum_size": 196608, + "maximum_size": 155648, "protocol": "script", "require_upload_port" : true }, @@ -25,3 +25,4 @@ "vendor": "Intel" } } + diff --git a/platformio/builder/scripts/intel_arc32.py b/platformio/builder/scripts/intel_arc32.py index fcb97512..0a651cd2 100644 --- a/platformio/builder/scripts/intel_arc32.py +++ b/platformio/builder/scripts/intel_arc32.py @@ -42,9 +42,8 @@ env.Replace( "-ffunction-sections", "-fdata-sections", "-Wall", - "-mav2em", "-mlittle-endian", - "-m${BOARD_OPTIONS['build']['mcu']}", + "-mcpu=${BOARD_OPTIONS['build']['cpu']}", "-fno-reorder-functions", "-fno-asynchronous-unwind-tables", "-fno-omit-frame-pointer", @@ -82,7 +81,7 @@ env.Replace( "-Wl,--gc-sections", "-Wl,-X", "-Wl,-N", - "-Wl,-m${BOARD_OPTIONS['build']['mcu']}", + "-Wl,-mcpu=${BOARD_OPTIONS['build']['cpu']}", "-Wl,-marcelf", "-static", "-nostdlib", @@ -93,7 +92,7 @@ env.Replace( "-Wl,--no-whole-archive" ], - LIBS=["c", "m", "gcc"], + LIBS=["nsim", "c", "m", "gcc"], SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES', From 0ba315243ba97bd588d4971786fc6598908ea370 Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Wed, 15 Jun 2016 14:45:08 +0300 Subject: [PATCH 06/16] Revert mcu option for genuino101 --- platformio/boards/intel.json | 1 + 1 file changed, 1 insertion(+) diff --git a/platformio/boards/intel.json b/platformio/boards/intel.json index 27e62b7f..8d5f97be 100644 --- a/platformio/boards/intel.json +++ b/platformio/boards/intel.json @@ -5,6 +5,7 @@ "extra_flags": "-DARDUINO_ARCH_ARC32 -D__ARDUINO_ARC__", "f_cpu": "32000000L", "ldscript": "flash.ld", + "mcu": "ARCv2EM", "cpu": "quarkse_em", "usb_product": "Genuino 101", "variant": "arduino_101", From 13d43425e5e68337ed3cb37a78abb2b4cf5a0785 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 14:48:27 +0300 Subject: [PATCH 07/16] Add support for ST Nucleo L031K6 board to ARM mbed framework --- docs/frameworks/mbed.rst | 7 +++++++ docs/platforms/embedded_boards.rst | 7 +++++++ docs/platforms/ststm32.rst | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/docs/frameworks/mbed.rst b/docs/frameworks/mbed.rst index ca428b05..df5d4c00 100644 --- a/docs/frameworks/mbed.rst +++ b/docs/frameworks/mbed.rst @@ -629,6 +629,13 @@ ST - 512 Kb - 128 Kb + * - ``nucleo_l031k6`` + - `ST Nucleo L031K6 `_ + - STM32L031K6T6 + - 32 MHz + - 32 Kb + - 8 Kb + * - ``nucleo_l053r8`` - `ST Nucleo L053R8 `_ - STM32L053R8T6 diff --git a/docs/platforms/embedded_boards.rst b/docs/platforms/embedded_boards.rst index 7095dd76..23721690 100644 --- a/docs/platforms/embedded_boards.rst +++ b/docs/platforms/embedded_boards.rst @@ -2013,6 +2013,13 @@ ST - 512 Kb - 128 Kb + * - ``nucleo_l031k6`` + - `ST Nucleo L031K6 `_ + - STM32L031K6T6 + - 32 MHz + - 32 Kb + - 8 Kb + * - ``nucleo_l053r8`` - `ST Nucleo L053R8 `_ - STM32L053R8T6 diff --git a/docs/platforms/ststm32.rst b/docs/platforms/ststm32.rst index 789d0b6f..fb1acfa4 100644 --- a/docs/platforms/ststm32.rst +++ b/docs/platforms/ststm32.rst @@ -357,6 +357,13 @@ ST - 512 Kb - 128 Kb + * - ``nucleo_l031k6`` + - `ST Nucleo L031K6 `_ + - STM32L031K6T6 + - 32 MHz + - 32 Kb + - 8 Kb + * - ``nucleo_l053r8`` - `ST Nucleo L053R8 `_ - STM32L053R8T6 From 4abaa6758032a2204175a92ab05dad4058d14d53 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 14:48:46 +0300 Subject: [PATCH 08/16] Update Intel ARC32 Arduino framework to v1.0.6 --- HISTORY.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index edd8c06a..c7df4ac0 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,11 +9,12 @@ PlatformIO 2.0 * Added support for ST Nucleo L031K6 board to ARM mbed framework * Process ``build_unflags`` option for ARM mbed framework -* Fixed issue with ARM mbed framework with ``-u _printf_float`` and +* Updated Intel ARC32 Arduino framework to v1.0.6 +* Improved a check of program size before uploading to the board +* Fixed issue with ARM mbed framework ``-u _printf_float`` and ``-u _scanf_float`` when parsing ``$LINKFLAGS`` * Fixed issue with ARM mbed framework and extra includes for the custom boards, such as Seeeduino Arch Pro -* Improved a check of program size before uploading to the board 2.10.1 (2016-06-13) ~~~~~~~~~~~~~~~~~~~ From 7e027db02b9017a76ea82ad07b3e176601c9febe Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 14:52:11 +0300 Subject: [PATCH 09/16] Update Intel ARC32 Arduino framework to v1.0.6 // Issue #695 --- HISTORY.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.rst b/HISTORY.rst index c7df4ac0..d4804f06 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -10,6 +10,7 @@ PlatformIO 2.0 * Added support for ST Nucleo L031K6 board to ARM mbed framework * Process ``build_unflags`` option for ARM mbed framework * Updated Intel ARC32 Arduino framework to v1.0.6 + (`issue #695 `_) * Improved a check of program size before uploading to the board * Fixed issue with ARM mbed framework ``-u _printf_float`` and ``-u _scanf_float`` when parsing ``$LINKFLAGS`` From cdcf0756355ecccc5180d12c6e8bc3496420a498 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 14:56:31 +0300 Subject: [PATCH 10/16] Use $PLATFORM from build environment instead from the board config --- platformio/builder/scripts/frameworks/mbed.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platformio/builder/scripts/frameworks/mbed.py b/platformio/builder/scripts/frameworks/mbed.py index 4f8fd57e..2b1bd2ad 100644 --- a/platformio/builder/scripts/frameworks/mbed.py +++ b/platformio/builder/scripts/frameworks/mbed.py @@ -152,8 +152,7 @@ def add_mbedlib(libname, libar): } target_includes = ( - "TARGET_%s" % target_map.get( - env.get("BOARD_OPTIONS", {}).get("platform", ""), ""), + "TARGET_%s" % target_map.get(env.subst("$PLATFORM"), ""), "TARGET_%s" % variant, "TARGET_CORTEX_M" ) @@ -222,7 +221,7 @@ def get_build_flags(data): def _mbed_whole_archive_hook(libs_): if (not isinstance(libs_, list) or - env.get("BOARD_OPTIONS", {}).get("platform") == "nordicnrf51"): + env.subst("$PLATFORM") == "nordicnrf51"): return libs_ _dynlibs = [] From 682e435ded10a75f2ea46536a3d1defece040808 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 16:02:04 +0300 Subject: [PATCH 11/16] Fix firmware uploading to Arduino/Genuino 101 // Resolve #695 --- platformio/__init__.py | 2 +- platformio/boards/intel.json | 3 ++- platformio/builder/scripts/intel_arc32.py | 10 +++++++++- platformio/builder/tools/pioupload.py | 6 ++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 4f9d2e11..299738de 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 10, "2.dev0") +VERSION = (2, 10, "2.dev1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/boards/intel.json b/platformio/boards/intel.json index 8d5f97be..34950dc8 100644 --- a/platformio/boards/intel.json +++ b/platformio/boards/intel.json @@ -20,7 +20,8 @@ "maximum_ram_size": 81920, "maximum_size": 155648, "protocol": "script", - "require_upload_port" : true + "require_upload_port" : true, + "use_1200bps_touch": true }, "url": "https://www.arduino.cc/en/Main/ArduinoBoard101", "vendor": "Intel" diff --git a/platformio/builder/scripts/intel_arc32.py b/platformio/builder/scripts/intel_arc32.py index 0a651cd2..f654234f 100644 --- a/platformio/builder/scripts/intel_arc32.py +++ b/platformio/builder/scripts/intel_arc32.py @@ -23,6 +23,14 @@ from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default, env = DefaultEnvironment() + +def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 + + if env.get("BOARD_OPTIONS", {}).get("upload", {}).get( + "use_1200bps_touch", False): + env.TouchSerialPort("$UPLOAD_PORT", 1200) + + env.Replace( AR="arc-elf32-ar", AS="arc-elf32-as", @@ -178,7 +186,7 @@ AlwaysBuild(target_size) # upload = env.Alias(["upload", "uploadlazy"], target_firm, - [env.AutodetectUploadPort, "$UPLOADCMD"]) + [env.AutodetectUploadPort, BeforeUpload, "$UPLOADCMD"]) AlwaysBuild(upload) # diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index ede4ca74..37cd4826 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -37,13 +37,15 @@ def FlushSerialBuffer(env, port): def TouchSerialPort(env, port, baudrate): + port = env.subst(port) + print "Forcing reset using %dbps open/close on port %s" % (baudrate, port) if system() != "Windows": try: - s = Serial(env.subst(port)) + s = Serial(port) s.close() except: # pylint: disable=W0702 pass - s = Serial(port=env.subst(port), baudrate=baudrate) + s = Serial(port=port, baudrate=baudrate) s.setDTR(False) s.close() sleep(0.4) From c62a3f8ee66986440957f28d1a7d0c8f6e034a98 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 17:57:28 +0300 Subject: [PATCH 12/16] Version bump to 2.10.2 (issues #695) --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index d4804f06..51981ccf 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release Notes PlatformIO 2.0 -------------- -2.10.2 (2016-06-??) +2.10.2 (2016-06-15) ~~~~~~~~~~~~~~~~~~~ * Added support for ST Nucleo L031K6 board to ARM mbed framework diff --git a/platformio/__init__.py b/platformio/__init__.py index 299738de..2c38c6d8 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 10, "2.dev1") +VERSION = (2, 10, 2) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 5dac4e3af6fa39d6d729a7ee599c3da775fff7b7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 18:42:25 +0300 Subject: [PATCH 13/16] Add test for `init --ide eclipse` --- tests/commands/test_init.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/commands/test_init.py b/tests/commands/test_init.py index 93b47053..5e136f47 100644 --- a/tests/commands/test_init.py +++ b/tests/commands/test_init.py @@ -42,6 +42,14 @@ def test_init_ext_folder(platformio_setup, clirunner, validate_cliresult): validate_pioproject(join(getcwd(), ext_folder_name)) +def test_init_ide_eclipse(platformio_setup, clirunner, validate_cliresult): + with clirunner.isolated_filesystem(): + result = clirunner.invoke(cli, ["-b", "uno", "--ide", "eclipse"]) + validate_cliresult(result) + validate_pioproject(getcwd()) + assert all([isfile(f) for f in (".cproject", ".project")]) + + def test_init_special_board(platformio_setup, clirunner, validate_cliresult): with clirunner.isolated_filesystem(): result = clirunner.invoke(cli, ["-b", "uno"]) From 1cab0c168e57816a6391c77e86330c73e786aa92 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 18:42:56 +0300 Subject: [PATCH 14/16] Fix issue with appending PIO version to Build Defines --- platformio/builder/tools/platformio.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 77d1f60e..01b50f57 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -36,7 +36,9 @@ SRC_DEFAULT_FILTER = " ".join([ def BuildProgram(env): def _append_pio_macros(): - env.AppendUnique( + if any(["PLATFORMIO=" in str(d) for d in env.get("CPPDEFINES", [])]): + return + env.Append( CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format( *pioversion_to_intstr())], ) From 2cd22f725e6648b386e0464e27a16d0af07adc95 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 18:46:41 +0300 Subject: [PATCH 15/16] Version bump to 2.10.3 --- HISTORY.rst | 5 +++++ platformio/__init__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 51981ccf..ec59872a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,11 @@ Release Notes PlatformIO 2.0 -------------- +2.10.3 (2016-06-15) +~~~~~~~~~~~~~~~~~~~ + +* Fixed issue with ``platformio init --ide`` command + 2.10.2 (2016-06-15) ~~~~~~~~~~~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index 2c38c6d8..0f8db754 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 10, 2) +VERSION = (2, 10, 3) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 47c238b1ebd5bfd60c0bee169074a5aa67061103 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 15 Jun 2016 19:30:37 +0300 Subject: [PATCH 16/16] Fix issue with ``platformio init --ide`` command for Python 2.6 --- .gitignore | 1 + HISTORY.rst | 5 +++++ platformio/__init__.py | 2 +- platformio/commands/upgrade.py | 2 ++ platformio/ide/projectgenerator.py | 7 ++++++- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index dfcb0c78..89257136 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ docs/_build dist build +.cache diff --git a/HISTORY.rst b/HISTORY.rst index ec59872a..1bc72b89 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,11 @@ Release Notes PlatformIO 2.0 -------------- +2.10.4 (2016-06-??) +~~~~~~~~~~~~~~~~~~~ + +* Fixed issue with ``platformio init --ide`` command for Python 2.6 + 2.10.3 (2016-06-15) ~~~~~~~~~~~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index 0f8db754..8746c80d 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 10, 3) +VERSION = (2, 10, "4.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/commands/upgrade.py b/platformio/commands/upgrade.py index 894e8182..44e3b8ea 100644 --- a/platformio/commands/upgrade.py +++ b/platformio/commands/upgrade.py @@ -52,6 +52,8 @@ def cli(): r = None try: for cmd in cmds: + if sys.version_info < (2, 7, 0): + cmd[0] += ".__main__" cmd = [os.path.normpath(sys.executable), "-m"] + cmd r = None r = util.exec_command(cmd) diff --git a/platformio/ide/projectgenerator.py b/platformio/ide/projectgenerator.py index 2afd9d40..b4be53a3 100644 --- a/platformio/ide/projectgenerator.py +++ b/platformio/ide/projectgenerator.py @@ -66,7 +66,12 @@ class ProjectGenerator(object): envdata = self.get_project_env() if "env_name" not in envdata: return data - cmd = [normpath(sys.executable), "-m", "platformio", "-f"] + cmd = [ + normpath(sys.executable), "-m", + "platformio" + ( + ".__main__" if sys.version_info < (2, 7, 0) else ""), + "-f" + ] if app.get_session_var("caller_id"): cmd.extend(["-c", app.get_session_var("caller_id")]) cmd.extend(["run", "-t", "idedata", "-e", envdata['env_name']])