I'm attempting to flash a bootloader on to an atsamd11c14a using openocd on an rpi model 3b+ but encountering some trouble.
No issues on installing openocd (following adafruit's guide) and I believe my wiring is correct (was following some other guides). Reset pin is currently not connected.
Where I'm running in to issues is during the actual upload. The output I'm getting is:
Open On-Chip Debugger 0.10.0+dev-01151-gd9ffe75e-dirty (2020-03-26-09:28) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : BCM2835 GPIO JTAG/SWD bitbang driver Info : JTAG and SWD modes enabled Info : clock speed 400 kHz Info : SWD DPIDR 0x0bc11477 Info : at91samd11c14a.cpu: hardware has 4 breakpoints, 2 watchpoints Info : Listening on port 3333 for gdb connections Error: at91samd11c14a.cpu -- clearing lockup after double fault target halted due to debug-request, current mode: Handler HardFault xPSR: 0xd1000003 pc: 0xfffffffe msp: 0xffffffd8 target halted due to debug-request, current mode: Thread xPSR: 0xd1000000 pc: 0xfffffffe msp: 0xfffffffc target halted due to debug-request, current mode: Thread xPSR: 0xd1000000 pc: 0xfffffffe msp: 0xfffffffc ** Programming Started ** Info : SAMD MCU: SAMD11C14A (16KB Flash, 4KB RAM) Error: SAMD: NVM programming error Error: Failed to erase row containing 00000100 Error: SAMD: failed to erase sector 1 at 0x00000100 Error: failed erasing sectors 0 to 15 embedded:startup.tcl:522: Error: ** Programming Failed ** in procedure 'script' at file "embedded:startup.tcl", line 26 in procedure 'program' called at file "openocd.cfg", line 33 in procedure 'program_error' called at file "embedded:startup.tcl", line 587 at file "embedded:startup.tcl", line 522 Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections
I've attempted looking up the first few error lines but not having any luck. My openocd config file is as follows:
source [find interface/raspberrypi2-native.cfg] transport select swd set CHIPNAME at91samd11c14a source [find target/at91samdXX.cfg] # did not yet manage to make a working setup using srst #reset_config srst_only reset_config srst_nogate # says next two lines are deprecated #adapter_nsrst_delay 100 #adapter_nsrst_assert_width 100 adapter srst delay 100 adapter srst pulse_width 100 init targets reset halt at91samd bootloader program sam_ba_Generic_D11C14A_SAMD11C14A.bin verify at91samd bootloader 4096 reset shutdown
I've also tried adding
at91samd chip-erase just before programming (was suggested somewhere as a way to clear a lock if there was one), but didn't have any real effect aside from saying '''chip erase started''' before the programming attempt. The chips themselves are brand new, so I believe (not sure how to verify) that they should already be empty.