Using Raspberry Pi OpenOCD to program ATSAMD21E18

Thread Starter

Brett Smith 1

Joined Jul 1, 2017
13
Hello All,
I am working on an application that uses the ATSAMD21E18 and the Arduino framework.
I am using a raspberry pi to program the chip that is soldered to a custom board. I am trying to get OpenOCD to connect to the chip so I can connect program it via GDB.

However, when I launch OpenOCD I get the following results:
Code:
$ sudo openocd
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
BCM2835 GPIO nums: swclk = 25, swdio = 24
BCM2835 GPIO config: srst = 18
srst_only separate srst_gates_jtag srst_push_pull connect_deassert_srst
srst_only separate srst_gates_jtag srst_push_pull connect_deassert_srst
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : SWD only mode enabled (specify tck, tms, tdi and tdo gpios to add JTAG mode)
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd21e18.cpu: hardware has 4 breakpoints, 2 watchpoints
Error: at91samd21e18.cpu -- clearing lockup after double fault
Polling target at91samd21e18.cpu failed, trying to reexamine
Info : at91samd21e18.cpu: hardware has 4 breakpoints, 2 watchpoints
    TargetName         Type       Endian TapName            State
--  ------------------ ---------- ------ ------------------ ------------
 0* at91samd21e18.cpu  cortex_m   little at91samd21e18.cpu  halted
Info : SWD DPIDR 0x0bc11477
Error: at91samd21e18.cpu -- clearing lockup after double fault
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0xe1000003 pc: 0xfffffffe msp: 0xffffffd8
My openocd.conf looks like this:

Code:
source [find interface/raspberrypi2-native.cfg]
transport select swd

set CHIPNAME at91samd21e18
source [find target/at91samdXX.cfg]

# did not yet manage to make a working setup using srst
#reset_config srst_only
#reset_config srst_nogate

#adapter_nsrst_delay 100
#adapter_nsrst_assert_width 100

init
targets
reset halt
If I try use no openocd.conf and point to the config files directly:
Code:
$ sudo openocd -f /usr/share/openocd/scripts/interface/raspberrypi2-native.cfg -f /usr/share/openocd/scripts/target/at91samdXX.cfg  
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
BCM2835 GPIO nums: swclk = 25, swdio = 24
BCM2835 GPIO config: srst = 18
srst_only separate srst_gates_jtag srst_push_pull connect_deassert_srst
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
srst_only separate srst_gates_jtag srst_push_pull connect_deassert_srst
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : SWD only mode enabled (specify tck, tms, tdi and tdo gpios to add JTAG mode)
Info : clock speed 400 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: at91samd.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Could not initialize the debug port
I am working remotely in the Seychelles, and with the pandemic it is very difficult to get new parts at the moment (i.e. a proper programmer).
But I do have an ST-LINK V2 programmer and an old ST-NUCLEO programming header that I was considering trying to upload the "black magic"programmer firmware to.

Any ideas guys? Is this a software or a hardware issue?
Thank you in advance!
 

Attachments

Top