Initial commit

This commit is contained in:
2026-03-29 14:47:13 +02:00
commit b49984b9c0
32 changed files with 2394 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
Import("env")
import os
import subprocess
def upload_via_openocd(source, target, env):
pkg_dir = env.PioPlatform().get_package_dir("tool-openocd")
openocd = os.path.join(pkg_dir, "bin", "openocd.exe")
scripts = os.path.join(pkg_dir, "scripts")
firmware = str(source[0]) # .elf path
cmd = [
openocd,
"-s", scripts,
"-f", "interface/cmsis-dap.cfg",
"-f", "target/at91samdXX.cfg",
"-c", 'program "{}" verify reset; shutdown'.format(firmware.replace("\\", "/"))
]
print(" ".join(cmd))
result = subprocess.run(cmd)
if result.returncode != 0:
env.Exit(1)
env.Replace(UPLOADCMD=upload_via_openocd)