aboutsummaryrefslogtreecommitdiff
path: root/src/jtag
AgeCommit message (Collapse)Author
2015-03-09jtag/drivers/buspirate: add JTAG_STABLECLOCKS cmdMateusz Manowiecki
Solution found on the internet Change-Id: Ied6f7d9b28131a7ac83b203e4c64d4e9ffec0595 Signed-off-by: Mateusz Manowiecki <segmentation@fault.pl> Reviewed-on: http://openocd.zylin.com/2496 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-02-22Add SWD protocol support to sysfsgpioJean-Christian de Rivaz
Based on the initial work on bcm2835gpio.c by Paul Fertser with many additions. Modifications to the GPIO handling was minimal in this patch. A more big modification is required before cleanup the interface between bitbang and sysfsgpio. Change-Id: I54bf2a2aa2ca059368b0e0e105dff6084b73d624 Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch> Reviewed-on: http://openocd.zylin.com/2438 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-02-22Add SWD protocol support to bitbangJean-Christian de Rivaz
This is based on the initial work by Paul Fertser with addition of the switch sequences and new ACK handling. In case of WAIT response, the sticky bits are cleared and the last operation is repeated. The ACK handling is based on the interpretation of the 8 February 2006 ARM Debug Interface v5 Architecture Specification Change-Id: Id50855b1ffff310177ccf9883dc9eb0d1b4458c8 Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch> Reviewed-on: http://openocd.zylin.com/2437 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-02-11J-Link serial number config optionJoerg Fischer
Add serial option to jlink config commands, handy when there is more than one adapter connected. To select adapter 0123456 for OpenOCD, use jlink serial 0123456 Change-Id: Ib29ce3f0c4975e1169211721a4531bf4db61f1ee Signed-off-by: Joerg Fischer <turboj@gmx.de> Reviewed-on: http://openocd.zylin.com/2521 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-02-11jlink: Added hardware version number for JLink firmware on LPC-Link2Nemui Trinomius
JLink firmware on LPC-Link2 has unique hardware version number(0x12). Change-Id: I76b6e27c47d236da75c61dd6b83d6a823615968d Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp> Reviewed-on: http://openocd.zylin.com/2298 Tested-by: jenkins Reviewed-by: Anders Oleson <anders@openpuma.org> Reviewed-by: Xiaofan <xiaofanc@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-01-30drivers/stlink: clarify "init mode failed" messagePaul Fertser
The message as it was didn't let the user know that something was wrong with the target or wiring. Change-Id: Ib609c2d31959e77413e61c348d0e31d7269d5c58 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2365 Tested-by: jenkins Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-by: Jens Bauer <jens@gpio.dk>
2015-01-30jtag/drivers: remove useless checks causing build failure with clang 3.5.0Paul Fertser
Change-Id: Icafab6ac1e3e79c6da1bc163c30744eee4bde8d3 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2482 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
2015-01-30Use (uint8_t *) for buf_(set|get)_u(32|64) instead of (void *)Paul Fertser
This helps to uncover incorrect usage when a pointer to uint32_t is passed to those functions which leads to subtle bugs on BE systems. The reason is that it's normally assumed that any uint32_t variable holds its value in host byte order, but using but_set_u32 on it silently does implicit pointer conversion to (void *) and the assumption ends up broken without any indication. Change-Id: I48ffd190583d8aa32ec1fef8f1cdc0b4184e4546 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2467 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-01-28jtag: Rewrite TAP verification/auto-probe logicAndreas Fritiofson
Enable auto-creating additional discovered TAPs even if some TAPs are predefined, avoiding initialization failure when it's not necessary. Also, drop the arbitrary limit on the number of predefined TAPs. Still, don't auto-create any if there are more than 20 TAPs already, to stop a noisy connection from creating unlimited TAPs. Create auto-probed TAPs with less noise. Reduce code duplication between verification and auto-probing. Change-Id: I82a504d92dbcc0060206e71f10c5158256b5f561 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2236 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-01-26jtag/drivers/cmsis-dap-usb: fix cmsis_dap_serialJaakko Kukkohovi
Previously the serial wasn't actually used in hid_open() call, which meant that the first device with matching vid:pid was opened irrespective of the actual serial number. Change-Id: I45216ae5d9e0798e97be693c30e2f03c89b9a02b Signed-off-by: Jaakko Kukkohovi <jkukkohovi@gmail.com> Reviewed-on: http://openocd.zylin.com/2487 Tested-by: jenkins Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-01-26jtag/drivers/stlink: demote the output of available speeds to DEBUGPaul Fertser
Change-Id: If0afb6fb1cb2f39619e4e614573065c145255c3e Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2469 Reviewed-by: Jens Bauer <jens@gpio.dk> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-01-26jtag/hla_interface: avoid segfault with adapters that do not have ↵Paul Fertser
configurable speed Change-Id: I0386cbfc85ba8b28d3819530f9950b31545d6821 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2468 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-01-15stlink: add reconfigurable speed supportSpencer Oliver
The ability to change the speed has been added to firmware versions J22 and above. Any attempt to change on earlier versions will be ignored without error, as the existing code does. For supported firmware versions the driver will attempt to get as close as possible to supported speeds (never higher). The default stlink speed on power up is 1.8MHz. The driver will now also print supported clocl speeds during init. Change-Id: Iee9bd018bb8b6f94672a12538912d41c23d48a7e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2335 Tested-by: jenkins
2015-01-15hla: add ability to change adapter speed (if supported)Spencer Oliver
As a note we need to cache the requested speed setting, as the hla interface may not be ready when the first adapter_khz is called. Change-Id: I2fa6807d5f0bd3f0365cf178bd10a230c39415a7 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2334 Tested-by: jenkins
2015-01-15jtag/hla: output possible idcode candidates in case of mismatchPaul Fertser
Output a similar message to what we have on low-level JTAG adapters to avoid confusing users. Reported on IRC by chickensk. Change-Id: I96d58410ef715b966e32d79c0aacf38596c5eb3f Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2451 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-01-15jtag: Avoid extra SRSTn resets when connectingEvan Hunter
Previously the jtag_add_reset(1, 0) caused the processor to be released, and if SRSTn existed then it would then be reset again two lines later. Change-Id: I58b7a12607f46f83caa7ed3b3cebc4195eb51ef6 Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/2398 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-01-09swd: handle various failure conditionsPaul Fertser
When communication with target fails for whatever reason, it makes sense to do JTAG-to-SWD (in case the target got power-cycled or the DAP method was reset anyhow), SWD line reset sequence (part of JTAG-to-SWD already) and the mandatory IDCODE read. Schedule that to be performed on the next poll. Fix the return values for ftdi and jlink drivers to be consistent with OpenOCD error codes and remove ad-hoc calls to perform DAP method switching (as it's now done from the upper layer automatically). Change-Id: Ie18797d4ce7ac43d8249f8f81f1064a2424e02be Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2371 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Mateusz Manowiecki <segmentation@fault.pl>
2015-01-07jtag: Remove unnecessary global variableAndreas Fritiofson
Change-Id: I96e5f13b12da2970eafc5fca24b7952d427eeca9 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2235 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-01-07jtag: Fix memory leaks in jtag_tap_free()Andreas Fritiofson
Change-Id: I953fbb346fbf168fb50b349d245f2aa64dbfdcb3 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2234 Tested-by: jenkins
2014-11-24jtag/drivers/jlink: implement register command to fix SWDPaul Fertser
Some J-Link fw versions require registration to be performed before SWD operation is possible. It doesn't harm anyway, vendor's utilities do it unconditionally. Thanks go to Segger for providing the necessary information. Change-Id: Iabd76c743eca86e2c817a97cb93c969fec3f7ac6 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2331 Tested-by: jenkins
2014-10-16cmsis-dap: add serial number supportSpencer Oliver
Change-Id: I66926d1013e2b3a43ce0d18d3599771428706b6a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2329 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-10-16cmsis-dap: refactor HID PID/VID check loopSpencer Oliver
In preparation for adding serial number support. Change-Id: I3c9fb411b79d54a4d2de067039255436ba6708c7 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2328 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-10-06libusb: introduce jtag_libusb_choose_interface() and use it for JLinkPaul Fertser
This introduces a new common function that allows auto-discovery of a suitable USB interface based on class, subclass and protocol matching. It claims the interface and returns the corresponding endpoints number to the caller. The need for this arised due to nRF51822 USB dongle which comes with an "on-board Segger J-link debugger" having 3 interfaces, so the current code can't work at all with it (in this particular case the last interface needs to be choosen). This also removes special handling of JLink-OB endpoint numbers as it's now possible to autodetect them as well as the standard JLink endpoints. Change-Id: I4d990a7a3b373efdd2949a394b32d855a168e138 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2327 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-10-06hla: add a way to pass arbitrary commands from user to layout and use for ICDIPaul Fertser
TI's ICDI adapter supports some additional commands which a user might want to run for debugging or other purposes, the most useful of them being "debug unlock" that fully mass-erases the device and unprotects the flash. Change-Id: I26990e736094367f92106fa891e9bb8fb0382efb Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2263 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-10-06jtag/drivers/jlink.c: fix for LPC Link-2 running JLink firmware on LinuxAnders
Change 2288 fixed the extraneous reset caused by set_configuration that crashed the LPC Link-2 running JLink firmware and works on windows platforms. On Linux however, conditional code was still calling USB reset and caused the adapter to crash on any non-windows platforms. Change-Id: Ibf2a02d0dcdd91ccb71d86231cd8311dcadfee1e Signed-off-by: anders@openpuma.org Reviewed-on: http://openocd.zylin.com/2297 Tested-by: jenkins Reviewed-by: Xiaofan <xiaofanc@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-10-06jtag/drivers/libusb1_common: avoid device reset when reselecting configurationAnders
According to [1], we shouldn't reselect an already active configuration to avoid needless device reset. This is known to cause issues with e.g. LPC Link2 with JLink firmware. [1] http://libusb.sourceforge.net/api-1.0/caveats.html#configsel Change-Id: I3568ada77780a521548c450090db7173f8d0b2dd Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Anders Oleson <anders@openpuma.org> Reviewed-on: http://openocd.zylin.com/2288 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-10-06jtag: constify driver arraysSpencer Oliver
Change-Id: I81574fa8ca3cc748526dc61b75a2c75d6335ef04 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2294 Tested-by: jenkins
2014-09-29vsllink: improve the performance when using swdSimon Qian
Versaloon firmware has been updated for reporting errors if fail on swd transactions. Change-Id: I49ac0ad034cc9ad83cc4e43953579811d1243063 Signed-off-by: Simon Qian <openocd@versaloon.com> Reviewed-on: http://openocd.zylin.com/2302 Reviewed-by: Fatih Aşıcı <fatih.asici@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-09-22mpsse: Display libusb error names instead of numbersJoakim Gebart
Added calls to libusb_error_name() where applicable in order to easier understand the error messages. Change-Id: I3fe3d4b5624ae0de37c36e54a371eba5535ccaa1 Signed-off-by: Joakim Gebart <joakim.gebart@eistec.se> Reviewed-on: http://openocd.zylin.com/2289 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-09-22Support hla_serial command for ST-LINK adapters.Austin Phillips
The hla_serial command allows for a programming device serial number to be specified in addition to USB VID/PID. This allows for multiple ST-LINK/V2 programmers to be attached to a single machine and operated using openocd. Change-Id: I350654bf676eb26ba3a90450acfa55d2a5d2d791 Signed-off-by: Austin Phillips <austin_phillips@hotmail.com> Reviewed-on: http://openocd.zylin.com/2198 Tested-by: jenkins Reviewed-by: Martin Glunz <mg@wunderkis.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-09-15jtag: drivers: stlink: remove unnecessary '\n' in LOG_* entriesAndrey Skvortsov
Change-Id: Ia2dc3efc27b53334af4d85f9807abba0463c291b Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com> Reviewed-on: http://openocd.zylin.com/2220 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-09-08jtag/drivers/libusb0_common: fix FTBFS (libusb_device_descriptor error)Paul Fertser
This struct and libusb_get_device_descriptor() method are not present in libusb-0.1 API, so when libusb-1.0 is unavailable, this code breaks the build. Fix by using the appropriate struct (which is apparently filled automatically on device initialisation). While at it, change return values for consistency with the callers. Change-Id: I7d85ab9a70401a155a65122397008ae4d81382fe Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2252 Tested-by: jenkins Reviewed-by: Austin Phillips <austin_phillips@hotmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-08-22jtag: always configure enabled tap parameter appropriatelyPaul Fertser
Commit f701c0cb seems to have introduced a regression for non-JTAG transports as the newly created "tap" (DAP actually) ended up being disabled, thus resulting in total lack of functionality. This was exposed by a debug log demonstrating ftdi SWD transport connection to mdr32f9q2i, the target wasn't examined on init and couldn't be reset. Change-Id: If53cbe800d4adc177aa3ac3219860e7fa15b3e49 Reported-by: Хайруллин Эльдар <eldar.khayrullin@mail.ru> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2261 Tested-by: jenkins Reviewed-by: Angus Gratton <gus@projectgus.com> Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-08-19jtag/drivers/ftdi: Use adapter_khz value for initial clock speed (was ↵Angus Gratton
default 1kHz) nrf51822 doesn't like a 1kHz initial clock rate, puts the DAP into a bad state. Mailing list discussion thread: http://sourceforge.net/p/openocd/mailman/openocd-devel/thread/20140718081528.GA5554%40ex2.lan/#msg32621853 Change-Id: I71aa75505cc1b41ee80c7b9db415f6ac738c2916 Signed-off-by: Angus Gratton <gus@projectgus.com> Reviewed-on: http://openocd.zylin.com/2223 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-08-19jlink: Constantify string arraysSpencer Oliver
Change-Id: Ib63f4c32e6d5a7dad21567521d938142ea40b308 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2245 Tested-by: jenkins
2014-08-19jlink: add variant "J-Link Lite-ADI"Spencer Oliver
Fitted to various Analog Devices ADuCM36x dev boards. Change-Id: Ib3691704c0ecd2f8cba1abba284aee695d6bc135 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2244 Tested-by: jenkins
2014-08-19jlink: fix typoSpencer Oliver
Change-Id: If495b819c0532a97447ec7208c13d8a66a3ad47d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2243 Tested-by: jenkins
2014-08-19jtag: usb_blaster: fix initialization regressionRobert Jarzmik
As Daniel pointed out, since the rewrite of the USB Blaster driver, the initialization behaviour has change. The initial flush of the FIFOs is not longer done with a specific USB setup packet, but with a write filling up the blaster queues. The problem is, quoting Daniel : When the CPLD is in bit banging mode (as is usually the case), the first 0x00 byte sets all pins to low and disables the output driver. Disabling the output drivers is a few nanoseconds slower than changing a pin from high to low, so I see a spike towards GND on my reset line when that byte is sent over USB. The spike is too short to have an effect on the board. When the 4096 0x00 bytes are processed and the TMS=1 is to be generated, all I see is several microseconds of low level on all pins, resetting my board. This patch changes the way the initialization is done : - at driver init, nothing is sent towards the usb-blaster This gives time for init script to setup PIN6 and PIN8 (resets) - at the very first driver command, the initialization is done : - the output is in bit bigbang mode - the PIN6 and PIN8 are computed according to init script - the 4096 computed output is sent Change-Id: If7ceee957f6b59bcb27c8f912f1cfdd0f94f75ed Reported-by: Daniel Glöckner <daniel-gl@gmx.net> Cc: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-on: http://openocd.zylin.com/2229 Tested-by: jenkins Reviewed-by: Franck Jullien <franck.jullien@gmail.com> Reviewed-by: Daniel Glöckner <daniel-gl@gmx.net> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-08-11stlink_usb: Fix swallowed error on read/write operations, add retries on SWD ↵Angus Gratton
WAIT, clean up error debug output. - stlink_usb_get_rw_status() had a bug where FAULT or WAIT responses in read/write operations were ignored, leading to incomplete data. - Added wrapper stlink_cmd_allow_retry to handle SWD_AP_WAIT/SWD_DP_WAIT statuses in most commands. These statuses appear if an SWD read or write received a WAIT ACK response from the target more than 4 times in a row. The driver retries the operation (with exponential backoff) before failing outright (in testing 1 retry was always enough.) - As part of the implementation of stlink_cmd_allow_retry a large number of lines of boilerplate were refactored. - Fleshed out stlink_usb_error_check and added it to some more code paths so WAIT or FAULT responses are logged to debug. WAIT responses will be logged even if they are subsequently retried, which should help in case the retries have subtle side effects (none anticipated.) Tested with two targets: STLINK F0 Discovery, Nordic NRF51822. Only tested with STLINK V2 programmers. Change-Id: I9af24e8f0121b035356dbb9978d6bbf4feb2e4d3 Signed-off-by: Angus Gratton <gus@projectgus.com> Reviewed-on: http://openocd.zylin.com/2201 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-08-11Allow transports to override the selected target (hla configs unification)Paul Fertser
This should allow to share common configs for both regular access and high-level adapters. Use the newly-added functionality in stlink and icdi drivers, amend the configs accordingly. Runtime-tested with a TI tm4c123g board. Change-Id: Ibb88266a4ca25f06f6c073e916c963f017447bad Signed-off-by: Paul Fertser <fercerpav@gmail.com> [gus@projectgus.com: context-specific deprecation warnings] Signed-off-by: Angus Gratton <gus@projectgus.com> [andrew.smirnov@gmail.com: additional nrf51.cfg mods] Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Tested-by: Andrey Skvortsov <andrej.skvortzov@gmail.com> Reviewed-on: http://openocd.zylin.com/1664 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-08-11newdap: Ignore -irlen/-irmask/etc newdap params on SWD or CMSIS-DAPAngus Gratton
Previously the -irlen parameter was required even though it is not a part of the SWD or CMSIS-DAP transports. This may eventually need to be changed for CMSIS-DAP once that supports JTAG as well. Change-Id: Ia02b67840c19c7cf1c7a75063648c0174176a311 Signed-off-by: Angus Gratton <gus@projectgus.com> Reviewed-on: http://openocd.zylin.com/2226 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-08-02drivers/jlink: Revert old workaroundAndreas Fritiofson
This workaround broke usage with at least the I.MX6Q. The comment implies that talking to the J-Link dongle itself should fail if the target isn't reset, which sounds really strange. I'm guessing it just triggered another bug in OpenOCD or Segger FW which might have been fixed since. Revert and wait and see if there are any failure reports. Tested with Kwikstik (J-Link + Kinetis K40), not with the mentioned adapter. Change-Id: I97f555efe079bd99c098bf483491d9509b2363ad Signed-off-by: Roy Spliet <rspliet@mpi-sws.org> Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2147 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-08-02drivers/jlink: fix SWD speed config, and set it before sending anythingPaul Fertser
During the initialisation a driver might need to communicate with the target (e.g. sending jtag2swd sequence), so when doing so it should honour the user-specified speed. Change-Id: If84fea6057fda9edcf2c0a653edfbab2500e3cdd [andrew.smirnov@gmail.com: fix khz/hz confusion] Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2224 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-08-02drivers/jtag/jlink: support SWD modePaul Fertser
Quick attempt at SWD support, closely modelled after ftdi. Change-Id: I25140d80c5be7b2f8f0e2ef722a4ba4df0da4cf3 Signed-off-by: Brian Campbell <Brian.Campbell@ed.ac.uk> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2141 Tested-by: jenkins Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-07-10drivers/cmsis_dap_usb: Return with ERROR_FAIL if no CMSIS-DAP device is found.Masaki Muranaka
Even if it does not return, the initialization will be failed. But it is better to show why the error is caused. Change-Id: I399c7c94a7156be22723a9715e594061bb414a7e Signed-off-by: Masaki Muranaka <monaka@monami-ya.com> Reviewed-on: http://openocd.zylin.com/2189 Tested-by: jenkins Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-07-03vsllink: Port to libusb-1.0 APIFatih Aşıcı
Change-Id: I8a9a4dace8e7e8152947094b27b86f9a0d90fa61 Signed-off-by: Fatih Aşıcı <fatih.asici@gmail.com> Reviewed-on: http://openocd.zylin.com/1952 Tested-by: jenkins Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-07-03vsllink: Add SWD supportFatih Aşıcı
Tested with stm32f1x, stm32f4x and kl25 targets using SWD transport. Change-Id: I118d07371b53f402ea9ac73f874460a309c05100 Signed-off-by: Fatih Aşıcı <fatih.asici@gmail.com> Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1947 Tested-by: jenkins
2014-07-03jtag/drivers/opendous: remove ftime() callsPaul Fertser
ftime() is deprecated by POSIX.1-2008 and causes a warning on FreeBSD. The generic OpenOCD LOG_DEBUG implementation already outputs time of an event with a millisecond precision. Change-Id: Ic8e4ea27c268f07554ba519768b9bdfc4343f3e9 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2187 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-07-03drivers/cmsis_dap_usb: restructure init sequence a bitPaul Fertser
This fixes the issue of improper initialisation sequence and in particular makes "cmsis_dap_vid_pid" config specification functional. Not really elegant but it's in line with the ftdi driver and so can be reworked in a uniform way later when the internal API is changed. Change-Id: Ief9fc64ad0ac24e1c66727153f383e4f30a830c7 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2192 Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-07-03jtag/drivers/cmsis_dap: fix check for hardcoded vids/pidsPaul Fertser
This is intended to fix cmsis_dap_vid_pid command but it doesn't because cmsis-dap has only one transport and it's auto-selected from "interface" command handler (before any other commands are run) and as the result cmsis_dap_usb_open() is called too early. Change-Id: Idaade73797d8df67a6439d096f6abc9736495599 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2191 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>