Hi

does your firmware set a sleep mode?

You can try proposed changes
http://openocd.zylin.com/2778
http://openocd.zylin.com/2606

Check if SRST is connected to RESETN and configure
    reset_config srst_only
and you should be able regain debug control after
    reset halt

Tomas

On 16.10.2015 2:04, Dario Alcocer wrote:
Cannot connect via SWD when SAMD20 flash (ATSAMD20J18) is not blank (host is 
Xubuntu 14.10 Utopic on i686):

$ openocd -f 
/usr/local/share/openocd/scripts/board/atmel_samd20_xplained_pro.cfg -d 3
...
Debug: 211 17 cmsis_dap_usb.c:731 cmsis_dap_swd_switch_seq(): JTAG-to-SWD
Debug: 212 18 cmsis_dap_usb.c:522 cmsis_dap_swd_run_queue(): Executing 2 queued 
transactions
Debug: 213 18 cmsis_dap_usb.c:545 cmsis_dap_swd_run_queue(): DP read reg 0 0
Debug: 214 18 cmsis_dap_usb.c:545 cmsis_dap_swd_run_queue(): DP write reg 0 1e
Debug: 215 19 cmsis_dap_usb.c:583 cmsis_dap_swd_run_queue(): SWD ack not OK: 0 
JUNK
Debug: 216 19 command.c:628 run_command(): Command failed with error code -4
User : 217 19 command.c:689 command_run_line(): in procedure 'init'
in procedure 'ocd_bouncer'
Debug: 218 19 command.c:628 run_command(): Command failed with error code -4
User : 219 19 command.c:689 command_run_line():

The problem can be worked around by first erasing the device using Atmel Studio 
(Win7) before using openocd.

Corresponding output when SAMD20 flash is blank:
$ openocd -f 
/usr/local/share/openocd/scripts/board/atmel_samd20_xplained_pro.cfg -d 3
...
Debug: 211 19 cmsis_dap_usb.c:731 cmsis_dap_swd_switch_seq(): JTAG-to-SWD
Debug: 212 20 cmsis_dap_usb.c:522 cmsis_dap_swd_run_queue(): Executing 2 queued 
transactions
Debug: 213 20 cmsis_dap_usb.c:545 cmsis_dap_swd_run_queue(): DP read reg 0 0
Debug: 214 20 cmsis_dap_usb.c:545 cmsis_dap_swd_run_queue(): DP write reg 0 1e
Debug: 215 21 cmsis_dap_usb.c:600 cmsis_dap_swd_run_queue(): Read result: 
bc11477
Info : 216 21 adi_v5_swd.c:125 swd_connect(): SWD IDCODE 0x0bc11477

Complete debug logs are attached.

Used the following instructions to build and install from source
(taken from http://jjmilburn.github.io/2014/09/18/Atmel-SAMD20-EclipseCDT/):

$ sudo apt-get install libudev-dev
$ git clone git://github.com/signal11/hidapi.git
$ cd hidapi
$ ./bootstrap
$ ./configure
$ make
$ sudo make install
$ cd ..

$ git clone git://git.code.sf.net/p/openocd/code openocd
$ cd openocd
$ ./bootstrap
$ ./configure
$ make
$ sudo make install
$ sudo apt-get install libhidapi-hidraw0
$ sudo cp contrib/99-openocd.rules /etc/udev/rules.d/99-openocd.rules
$ sudo udevadm control --reload-rules
The information contained in this email message, including any attachments or 
links to documents, may include privileged, confidential and/or inside 
information and is intended only for use of the individual or entity named 
above. If the reader of this message is not the intended recipient, or the 
employee or agent responsible to deliver it to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender and destroy the original 
message. Thank you.


------------------------------------------------------------------------------


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to