Hello,
after getting a brand new "Atmel-ICE", I wanted to give it a try with
the CMSIS-DAP OpenOCD branch.
I had to apply a couple of minor patches in order to work with it (see
Trac bugs #67 and #68), but can now operate it.
However, I'm stumbling in getting the configuration entries to work
with a SAM3 device.
Using a Segger J-Link on an Atmel SAM3S-EK works using these entries:
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
adapter_khz 500
source [find interface/jlink.cfg]
source [find board/atmel_sam3s_ek.cfg]
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
If I now replace the interface entry by the CMSIS-DAP one:
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
adapter_khz 500
source [find interface/cmsis-dap.cfg]
source [find board/atmel_sam3s_ek.cfg]
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
it fails with:
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
Open On-Chip Debugger 0.8.0-dev-00381-gf91390f-dirty (2014-03-10-14:41)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
adapter speed: 500 kHz
Info : only one transport option; autoselect 'cmsis-dap'
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
adapter speed: 500 kHz
adapter_nsrst_delay: 100
Runtime Error: /usr/local/share/openocd/scripts/target/at91sam3XXX.cfg:49:
invalid command name "jtag_ntrst_delay"
in procedure 'script'
at file "embedded:startup.tcl", line 58
at file "openocd.cfg", line 22
at file "/usr/local/share/openocd/scripts/board/atmel_sam3s_ek.cfg", line 1
at file "/usr/local/share/openocd/scripts/target/at91sam3sXX.cfg", line 13
at file "/usr/local/share/openocd/scripts/target/at91sam3XXX.cfg", line 49
Info : CMSIS-DAP: FW Version = 01.00.0021
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 0 nTRST = 0 nRESET = 1
Info : DAP_SWJ Sequence (reset: 50+ '1' followed by 0)
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Error: BUG: current_target out of bounds
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
Running it in GDB tells me that there is apparently no "target" set,
but why is that required at this point?
However, if I pretend I were using a SAM4S-EK instead:
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
adapter_khz 500
source [find interface/cmsis-dap.cfg]
source [find board/atmel_sam4s_ek.cfg]
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
it at least pretends to work, too (the IDCODE is wrong though, Segger
tells it must be 0x4ba00477):
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
Open On-Chip Debugger 0.8.0-dev-00381-gf91390f-dirty (2014-03-10-14:41)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
adapter speed: 500 kHz
Info : only one transport option; autoselect 'cmsis-dap'
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: FW Version = 01.00.0021
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 0 nTRST = 0 nRESET = 1
Info : DAP_SWJ Sequence (reset: 50+ '1' followed by 0)
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : IDCODE 0x2ba01477
Info : sam4.cpu: hardware has 6 breakpoints, 4 watchpoints
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
Hmm, so what's the difference? Both, SAM3 and SAM4 should be similar
enough, both support JTAG as well as SWD, so I think I should be able
to use the CMSIS-DAP debugger for them.
Comparing the board description files, I eventually get to the
following differences in the SAM3/4 target description files:
+source [find target/swj-dp.tcl]
-jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id
$_CPUTAPID
+swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id
$_CPUTAPID
Any clues are welcome.
--
cheers, Joerg .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel