From 179a9717707ebc5c7ab8f92b365e846e96d7e2c0 Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Thu, 4 Aug 2016 12:00:38 +0300 Subject: [PATCH 1/3] Fix OpenOCD upload command for atmelsam // Issue #732 --- platformio/builder/scripts/atmelsam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/scripts/atmelsam.py b/platformio/builder/scripts/atmelsam.py index d4b25a46..7b3b9412 100644 --- a/platformio/builder/scripts/atmelsam.py +++ b/platformio/builder/scripts/atmelsam.py @@ -146,7 +146,7 @@ if upload_protocol == "openocd": "-c", "\"telnet_port", "disabled;", "program", "{{$SOURCES}}", "verify", "reset", - "%s;" % user_code_section if user_code_section else "", + "%s;" % (user_code_section if user_code_section else ""), "shutdown\"" ] ) From b714fb1be005f49d12904560880a2208149538d2 Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Thu, 4 Aug 2016 18:37:52 +0300 Subject: [PATCH 2/3] Update OpenOCD uploading flags // Issue #732 --- platformio/builder/scripts/atmelsam.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/platformio/builder/scripts/atmelsam.py b/platformio/builder/scripts/atmelsam.py index 7b3b9412..0901364e 100644 --- a/platformio/builder/scripts/atmelsam.py +++ b/platformio/builder/scripts/atmelsam.py @@ -121,12 +121,11 @@ if upload_protocol == "openocd": env.Replace( UPLOADER=join("$PIOPACKAGES_DIR", "tool-openocd", "bin", "openocd"), UPLOADERFLAGS=[ - "-d2", "-f", join(BOARD_OPTIONS.get("debug", {}).get("openocdcfg", "")), - "-s", join("$PIOPACKAGES_DIR", "tool-openocd", - "share", "openocd", "scripts"), - "-s", join("$PIOPACKAGES_DIR", "tool-openocd", - "share", "openocd", "scripts", "board") + "-s", '"%s"' % join("$PIOPACKAGES_DIR", "tool-openocd", + "share", "openocd", "scripts"), + "-s", '"%s"' % join("$PIOPACKAGES_DIR", "tool-openocd", + "share", "openocd", "scripts", "board") ], UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS' @@ -135,19 +134,17 @@ if upload_protocol == "openocd": if "zero" in env.subst("$BOARD"): env.Append( UPLOADERFLAGS=[ - "-s", join("$PLATFORMFW_DIR", "variants", - "${BOARD_OPTIONS['build']['variant']}", - "openocd_scripts") + "-s", '"%s"' % join("$PLATFORMFW_DIR", "variants", + "${BOARD_OPTIONS['build']['variant']}", + "openocd_scripts") ] ) env.Append( UPLOADERFLAGS=[ - "-c", "\"telnet_port", "disabled;", - "program", "{{$SOURCES}}", - "verify", "reset", - "%s;" % (user_code_section if user_code_section else ""), - "shutdown\"" + "-c", ("telnet_port disabled; program {{$SOURCES}} " + "verify reset %s; shutdown" % ( + user_code_section if user_code_section else "")) ] ) From 795b8be3863996eebca2a03b67cca5cbd363b480 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 5 Aug 2016 13:57:13 +0300 Subject: [PATCH 3/3] Update examples --- examples | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples b/examples index a657ca42..dc677cf2 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit a657ca4225f55af7239b89486350c9f02bb3ee93 +Subproject commit dc677cf233990929fea1cf36338094837cc5d518