Experimental BlackMagicProbe support

This commit is contained in:
maxgerhardt
2023-04-08 22:07:24 +02:00
parent d9e97a3364
commit 46ae0c828b
59 changed files with 80 additions and 1 deletions

View File

@ -381,6 +381,28 @@ if upload_protocol == "mbed":
env.VerboseAction(AutodetectPicoDisk, "Looking for upload disk..."),
env.VerboseAction(UploadUF2ToDisk, "Uploading $SOURCE")
]
elif upload_protocol.startswith("blackmagic"):
env.Replace(
UPLOADER="$GDB",
UPLOADERFLAGS=[
"-nx",
"--batch",
"-ex", "target extended-remote $UPLOAD_PORT",
"-ex", "monitor %s_scan" %
("jtag" if upload_protocol == "blackmagic-jtag" else "swdp"),
"-ex", "attach 1",
"-ex", "load",
"-ex", "compare-sections",
"-ex", "kill"
],
UPLOADCMD="$UPLOADER $UPLOADERFLAGS $SOURCE"
)
upload_source = target_elf
upload_actions = [
env.VerboseAction(env.AutodetectUploadPort, "Looking for BlackMagic port..."),
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")
]
elif upload_protocol == "espota":
if not env.subst("$UPLOAD_PORT"):
sys.stderr.write(