Skip to content

Commit

Permalink
Fix serial port issue when burning bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
MCUdude committed Feb 16, 2024
1 parent aae69d4 commit 628b333
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions builder/bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ 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):
# Add upload serial port to Avrdude flags list if a jtag2updi or serialupdi programmer
if env.subst("$UPLOAD_PROTOCOL") in ("jtag2updi", "serialupdi"):
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 628b333

Please sign in to comment.