Last active
May 11, 2023 14:33
-
-
Save todbot/0f284c45c38e7418bf7edbb0d1302f2f to your computer and use it in GitHub Desktop.
Program a SAMD21 with OpenOCD and a JLINK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Program a SAMD21 part with a bootloader using a JLINK / J-LINK | |
# 0a. Wire up your device with SWD & SWC pins to JLINK | |
# 0b. Also wire up Gnd and Power to Gnd & VTref on JLINK | |
# 0c. And separately supply power to device | |
# 0d. Iif you don't have openocd installed, then "brew install openocd" | |
# | |
# 1. Put this file in a directory | |
# 2. Get a samd21 bootloader file.bin and put it in this directory renamed as "bootloader.bin" | |
# 3. Unplug and replug in the JLINK (to reset it) | |
# 4. Then do "openocd -f ./openocd-sams21.cfg" and stand back | |
source [find interface/jlink.cfg] | |
transport select swd | |
source [find target/at91samdXX.cfg] | |
init | |
reset | |
halt | |
program bootloader.bin verify reset | |
shutdown |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also, if you get the error:
then add this line after the
halt
line: