This is what I'm using locally for flashing samd21 parts
authorKeith Packard <keithp@keithp.com>
Sun, 6 Nov 2022 03:53:23 +0000 (20:53 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 6 Nov 2022 03:53:23 +0000 (20:53 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/ao-flash/ao-flash-samd21

index 1b3dc87bce342491eb0e3cfea66640bad4572f2a..f20d526db81e37bcfe7236cb935ab4d238d1480b 100755 (executable)
@@ -7,16 +7,13 @@ case "$#" in
     exit 1
     ;;
 esac
-
-openocd \
-    -f interface/stlink.cfg \
-    -c 'transport select hla_swd' \
-    -c 'set CPUTAPID 0x0bc11477' \
-    -f target/at91samdXX.cfg \
-    -c 'adapter speed 10' \
-    -c init \
-    -c 'reset init' \
-    -c 'at91samd bootloader 0' \
-    -c 'reset init' \
-    -c "program $1" \
-    -c "shutdown"
+openocd -f interface/stlink.cfg \
+        -c 'transport select hla_swd' \
+       -c 'set CHIPNAME at91samd21g18' \
+       -c 'set CPUTAPID 0x0bc11477' \
+       -f target/at91samdXX.cfg \
+       -c init \
+       -c 'reset halt' \
+       -c 'at91samd bootloader 0' \
+       -c "flash write_image erase unlock $1" \
+       -c "shutdown"