Skip to content

Commit 51d17a3

Browse files
committed
Add a board level config upload.gpiostring
This config can be used to specify a custom reset method during serial upload. Example: ``` "upload": { "maximum_ram_size": 65536, "maximum_size": 262144, "protocol": "serial", "protocols": [ "dfu", "serial", "jlink", "stlink", "blackmagic" ], "gpiostring": "-dtr,-rts," ``` Fix #257 Also fix a small bug where 'False' would be inserted in case when tool-stm32duino package is not available. --amend
1 parent 76958b4 commit 51d17a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builder/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@ def __configure_upload_port(env):
267267
elif upload_protocol == "serial":
268268
def __configure_upload_port(env):
269269
return env.subst("$UPLOAD_PORT")
270-
271270
env.Replace(
272271
__configure_upload_port=__configure_upload_port,
273272
UPLOADER=join(
274-
'"%s"' % platform.get_package_dir("tool-stm32duino") or "",
273+
'"%s"' % (platform.get_package_dir("tool-stm32duino") or ""),
275274
"stm32flash", "stm32flash"),
276275
UPLOADERFLAGS=[
276+
"-i%s" % board.get("upload.gpiostring") if board.get("upload.gpiostring", False) else "",
277277
"-g", board.get("upload.offset_address", "0x08000000"),
278278
"-b", env.subst("$UPLOAD_SPEED") or "115200", "-w"
279279
],

0 commit comments

Comments
 (0)