diff --git a/HISTORY.rst b/HISTORY.rst index 998b0e61..51981ccf 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,19 @@ Release Notes PlatformIO 2.0 -------------- +2.10.2 (2016-06-15) +~~~~~~~~~~~~~~~~~~~ + +* 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`` +* Fixed issue with ARM mbed framework and extra includes for the custom boards, + such as Seeeduino Arch Pro + 2.10.1 (2016-06-13) ~~~~~~~~~~~~~~~~~~~ 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 diff --git a/examples b/examples index a5498135..ed668f6e 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit a5498135baca2dd71e518406ee5cf19ac4be058b +Subproject commit ed668f6e31d2f99736b10cac209bd59318aa6ecb diff --git a/platformio/__init__.py b/platformio/__init__.py index ff8cfe32..2c38c6d8 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 10, 1) +VERSION = (2, 10, 2) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/boards/intel.json b/platformio/boards/intel.json index 33e35e3c..34950dc8 100644 --- a/platformio/boards/intel.json +++ b/platformio/boards/intel.json @@ -6,6 +6,7 @@ "f_cpu": "32000000L", "ldscript": "flash.ld", "mcu": "ARCv2EM", + "cpu": "quarkse_em", "usb_product": "Genuino 101", "variant": "arduino_101", "hwids": [ @@ -17,11 +18,13 @@ "platform": "intel_arc32", "upload": { "maximum_ram_size": 81920, - "maximum_size": 196608, + "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/frameworks/mbed.py b/platformio/builder/scripts/frameworks/mbed.py index 55b9fe14..2b1bd2ad 100644 --- a/platformio/builder/scripts/frameworks/mbed.py +++ b/platformio/builder/scripts/frameworks/mbed.py @@ -145,18 +145,23 @@ def add_mbedlib(libname, libar): "lwip-sys" ) + target_map = { + "nxplpc": "NXP", + "freescalekinetis": "Freescale", + "ststm32": "STM" + } + + target_includes = ( + "TARGET_%s" % target_map.get(env.subst("$PLATFORM"), ""), + "TARGET_%s" % variant, + "TARGET_CORTEX_M" + ) + for root, _, files in walk(lib_dir): if (not any(f.endswith(".h") for f in files) and basename(root) not in sysincdirs): continue - target_includes = ( - "TARGET_%s" % env.get( - "BOARD_OPTIONS", {}).get("vendor", "").upper(), - "TARGET_%s" % variant, - "TARGET_CORTEX_M" - ) - if "TARGET_" in root: if all([p not in root.upper() for p in target_includes]): continue @@ -195,6 +200,11 @@ def parse_eix_file(filename): result[key].append( node.get(_nkeys[0]) if len(_nkeys) == 1 else node.attrib) + if "LINKFLAGS" in result: + for i, flag in enumerate(result["LINKFLAGS"]): + if flag.startswith("-u "): + result["LINKFLAGS"][i] = result["LINKFLAGS"][i].split(" ") + return result @@ -211,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 = [] @@ -255,9 +265,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"): diff --git a/platformio/builder/scripts/intel_arc32.py b/platformio/builder/scripts/intel_arc32.py index fcb97512..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", @@ -42,9 +50,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 +89,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 +100,7 @@ env.Replace( "-Wl,--no-whole-archive" ], - LIBS=["c", "m", "gcc"], + LIBS=["nsim", "c", "m", "gcc"], SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES', @@ -179,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 874d4086..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) @@ -155,7 +157,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 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")