Skip to content

Commit

Permalink
Add a board level config upload.gpiostring
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Miceuz committed Dec 21, 2022
1 parent 76958b4 commit 51d17a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ def __configure_upload_port(env):
elif upload_protocol == "serial":
def __configure_upload_port(env):
return env.subst("$UPLOAD_PORT")

env.Replace(
__configure_upload_port=__configure_upload_port,
UPLOADER=join(
'"%s"' % platform.get_package_dir("tool-stm32duino") or "",
'"%s"' % (platform.get_package_dir("tool-stm32duino") or ""),
"stm32flash", "stm32flash"),
UPLOADERFLAGS=[
"-i%s" % board.get("upload.gpiostring") if board.get("upload.gpiostring", False) else "",
"-g", board.get("upload.offset_address", "0x08000000"),
"-b", env.subst("$UPLOAD_SPEED") or "115200", "-w"
],
Expand Down

0 comments on commit 51d17a3

Please sign in to comment.