Upload on Arduino Zero does not work

Hi,

I have an Arduino Zero that used to work just fine, but now it reports a HardFault and the processor is halted after each upload. I there any way to resurrect the board?

Here is the upload protocol:

Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 02.01.0157
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Error: at91samd21g18.cpu -- clearing lockup after double fault
Polling target at91samd21g18.cpu failed, trying to reexamine
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread 
xPSR: 0x60000000 pc: 0x0073940c msp: 0x0061940c
** Programming Started **
auto erase enabled
Info : SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM)
wrote 11776 bytes from file /Users/nebel/Library/Caches/arduino/sketches/6D1CC39B6EE917587DCBE46EDEA4B648/Blink.ino.bin in 1.264096s (9.097 KiB/s)
** Programming Finished **
** Verify Started **
verified 11660 bytes in 0.979505s (11.625 KiB/s)
** Verified OK **
** Resetting Target **
Error: at91samd21g18.cpu -- clearing lockup after double fault
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x60000003 pc: 0xfffffffe msp: 0x006193e8
shutdown command invoked

Hi @fogg. Does the problem occur if you upload the minimal sketch you get from selecting File > Examples > 01.Basics > BareMinimum from the Arduino IDE menus?

I ask because maybe the problem you are encountering is specific to the program you are uploading to the board. If the fault still occurs even after uploading the "BareMinimum" sketch, that would disprove my hypothesis.

Hi @ptillisch,

It was the Blink sketch. However, is is exactly the same with the BareMinimum sketch.

Problem solved: After selecting Atmel EDBG as a programmer and then chosing Burn Bootloader, the board is alive again :grinning_face: