Skip to content

Commit

Permalink
Fix serial port issue in Bootloader.py script (#67)
Browse files Browse the repository at this point in the history
* Fix serial port issue when burning bootloader
  • Loading branch information
MCUdude authored Feb 20, 2024
1 parent aae69d4 commit 5002fb5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions builder/bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,15 @@ def get_bootloader_dxcore(framework_dir, board_config):
UPLOADBOOTCMD="$BOOTUPLOADER $BOOTUPLOADERFLAGS $UPLOAD_FLAGS $BOOTFLAGS",
)

if not env.BoardConfig().get("upload", {}).get("require_upload_port", False):
if env.subst("$UPLOAD_PROTOCOL") in (
"jtag2updi",
"serialupdi",
) or env.BoardConfig().get("upload", {}).get("require_upload_port", False):
env.AutodetectUploadPort()
env.Append(BOOTUPLOADERFLAGS=["-P", '"$UPLOAD_PORT"'])
else:
# upload methods via USB
env.Append(BOOTUPLOADERFLAGS=["-P", "usb"])
else:
env.AutodetectUploadPort()
env.Append(FUSESUPLOADERFLAGS=["-P", '"$UPLOAD_PORT"'])

if env.subst("$UPLOAD_PROTOCOL") != "custom":
env.Append(BOOTUPLOADERFLAGS=["-c", "$UPLOAD_PROTOCOL"])
Expand Down

0 comments on commit 5002fb5

Please sign in to comment.