Skip to content

Instantly share code, notes, and snippets.

@k0d
Last active December 29, 2020 05:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k0d/1592045dbe8b29927457067b686f1198 to your computer and use it in GitHub Desktop.
Save k0d/1592045dbe8b29927457067b686f1198 to your computer and use it in GitHub Desktop.
samd21 with openecd
```brew install openocd```
make a file called openocd.cfg in a folder containing...
# Atmel-ICE JTAG/SWD in-circuit debugger.
interface cmsis-dap
# Chip info
set CHIPNAME at91samd21g18
source [find target/at91samdXX.cfg]
copy your bootloader to the same folder and call it bootloader.bin
```openocd -f openocd.cfg -c "at91samd bootloader 0; program bootloader.bin; at91samd bootloader 1024; exit reset"```
NOTE: fix the bootloader size in bytes (1024...)
@UnexpectedMaker
Copy link

Finally got around to trying this!
I needed to add an init to get it to flash, but it works great, thanks!

openocd -f openocd.cfg -c "init; at91samd bootloader 0; program bootloader.bin; at91samd bootloader 1024; exit reset"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment