Open todbot opened 5 months ago
Image of the above setup:
And when using cheapie STLinkV2 clones:
Wiring
Create openocd_stlink_samd21.cfg
with contents:
source [find interface/stlink.cfg]
set CHIPNAME at91samd21g18a
set CPUTAPID 0x0bc11477
source [find target/at91samdXX.cfg]
(based on this blog post
Run it with:
openocde -f ./openocd_stlink_samd21.cfg
Telnet to it like before Notice that messages are slightly different
% telnet localhost 4444
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> reset halt
[at91samd21g18a.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x61000000 pc: 0x00000264 msp: 0x20002de0
> targets
TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* at91samd21g18a.cpu hla_target little at91samd21g18a.cpu halted
> flash erase_sector 0 1 last
SAMD MCU: SAMD21E18A (256KB Flash, 32KB RAM)
erased sectors 1 through 1023 on flash bank 0 in 5.069648s
> program /Users/tod/Downloads/bootloader-trinket_m0-v3.16.0.bin verify reset
[at91samd21g18a.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x61000000 pc: 0x00000264 msp: 0x20002de0
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
to do: add these to the readme.
Using Atmel ICE instead of Segger Jlink:
On MacOS, install the following:
brew install openocd telnet
Wiring up device
Using Atmel ICE Save the below as
openocd_atmel-ice_samd21.cfg
:Run
openocd
and connect to it withtelnet