Skip to content

Instantly share code, notes, and snippets.

@ckuethe
Created August 30, 2018 16:09
Show Gist options
  • Save ckuethe/373c5f4e27987281c02e869775f35834 to your computer and use it in GitHub Desktop.
Save ckuethe/373c5f4e27987281c02e869775f35834 to your computer and use it in GitHub Desktop.
OpenOCD configuration for an Adafruit Trinket M0 (probably others too) connected via generic ST-Link v2 programmer
# OpenOCD configuration for the Adafruit Trinket M0
# https://www.adafruit.com/product/3500
# connected via a generic ST-Link/v2 compatible programmer
# https://amazon.com/s/?keywords=stlink%20v2
# Consult the pinout for the location of the SWCLK and SWDIO pins
# and connect the 3.3v line on the programmer to VBAT
# https://learn.adafruit.com/assets/49778
# It's not necessary to set the adapter speed, since OpenOCD
# figures it out, explicitly setting these speeds silences a
# few slightly annoying notices about clock rates
source [find interface/stlink-v2.cfg]
adapter_khz 950
# Magic incantation scraped off a bunch of forums
set CPUTAPID 0x0bc11477
# Trinket M0 is an ATSAMD21E18
source [find target/at91samdXX.cfg]
adapter_khz 240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment