Hi,
I state that I did a lot of research on the problem but I didn't find a solution so I try here.
I have a MKRZERO board (SAMD21G18A) and i want to flash my application using SWD interface.
I use a OLIMEX ARM USB OCD H (ARM-USB-OCD-H) as flasher with a JTAG to SWD adapter connected to the board using the following pins :
The Openocd version i use is 0.9.0-rc1 for Windows taken from the previous link of the Olimex website.
The command i use is the following:
openocd.exe -f interface/ftdi/olimex-arm-usb-ocd-h.cfg -f interface/ftdi/olimex-arm-jtag-swd.cfg -f target/at91samdXX.cfg -f openocd.cfg
The connections seems to work properly and the samd microcontroller target is detected.
Open On-Chip Debugger 0.9.0-rc1 (2015-04-24-22:09)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : FTDI SWD mode enabled
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Info : clock speed 500 kHz
Info : SWD IDCODE 0x0bc11477
Info : at91samd.cpu: hardware has 4 breakpoints, 2 watchpoints
Then i open a telnet connection to localhost:4444 to send line command to openocd
> halt
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x61000000 pc: 0x000002c6 msp: 0x20007fe0
> at91samd chip-erase
chip erased
> at91samd bootloader 0
> reset
at91samd.cpu -- clearing lockup after double fault
target state: halted
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x61000003 pc: 0xfffffffe msp: 0xffffffd8
Polling target at91samd.cpu failed, trying to reexamine
at91samd.cpu: hardware has 4 breakpoints, 2 watchpoints
> targets
TargetName Type Endian TapName State
0* at91samd.cpu cortex_m little at91samd.cpu halted
> program LED_NO_BOOT.bin verify reset
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x61000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
auto erase enabled
SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM)
wrote 16384 bytes from file LED_NO_BOOT.bin in 1.560009s (10.256 KiB/s)
** Programming Finished **
** Verify Started **
verified 11184 bytes in 0.920014s (11.871 KiB/s)
** Verified OK **
** Resetting Target **
> reset run
After the last command the microcontroller enter in a infinite reset loop.
The application flashed is a simple 1000 ms blink test
The linker script of this application was modified to never use the bootloader but starting directly with the application :
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}
I think i'm missing something stupid but i can't find a solution.
Any help?