aboutsummaryrefslogtreecommitdiff
path: root/src/jtag
AgeCommit message (Collapse)Author
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>
2014-06-28jtag/drivers/ftdi: do not touch unavailable reset signalsPaul Fertser
If the current reset_config doesn't specify availability of nTRST or nSRST, just leave them alone, do not try to deassert them ever (asserting would be prevented by the upper layer). Change-Id: I90123c666e05a1c26f1e164625e82d766a3e3744 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2186 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-06-28jtag/drivers/ftdi: require defining SWD_EN signal for SWD modePaul Fertser
Use a special signal instead of a dedicated swd mask. Amend jtag-lock-pick_tiny_2 config accordingly. Change-Id: Ifb007a0b5434b590c52f936efd5f5458e913e2e4 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2183 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2014-06-28jtag/drivers/ftdi: declare standard JTAG signals on SWD initPaul Fertser
Unfortunately, this means they're available for config files only after selecting swd transport. Change-Id: Ia2afc1f3bfdba8d81efbb8ab964b174c0f7e2811 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2182 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-06-28jtag/drivers/ftdi: add option to declare signal aliasesPaul Fertser
This adds -alias|-nalias options to ftdi_layout_signal command that allow to declare a new signal based on an already defined one. Change-Id: I552578ebcd12ae21957a1c0d3b7e878adeff6df0 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2181 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-06-28Auto-select JTAG transport when appropriatePaul Fertser
I looked through all the target configs after stripping comments and such from them with sed to see what jtag-specific commands can appear first, and it looks like all the meaningful combinations should be covered. Change-Id: I8d543407b7f4ac8aca7354ecd50e841c8a04d5f3 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2179 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-06-28Relax polling check if not in JTAG modeAndreas Fritiofson
Polling was disabled based on global variables jtag_trst and jtag_srst which were never touched in non-JTAG mode. Modify the check and remove the ugly workaround to avoid calls to a possibly uninitialized JTAG subsystem. Change-Id: I3b18c81e0fba7aaf35afe6f08c3fe8fa6f8443fd Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2143 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28Add FTDI SWD driverAndreas Fritiofson
This is usable on most or all FTDI adapters using a small hardware tweak. TCK goes to SWCLK as expected. TDO should be wired to SWDIO. For TDI there are two options: Either add a 74HC126 or similar tri-state buffer between TDI and SWDIO, with OE controlled by a signal named SWDIO_OE. Or simply connect TDI and SWDIO together via a suitable resistor (220-470 ohms or so depending on the drive capability of the target and adapter). nSRST (and of course Vcc, GND) may be connected too but all other signals should be NC. Change-Id: Id36cf4577439be96bd4e5955c3026236e1cabced Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1958 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28transport: Constify the transports vectorAndreas Fritiofson
Change-Id: I0c874b5d4c97cf781d83bd381d701f770e069f72 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2135 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28swd: Add frequency setting and special/switching sequences to the APIAndreas Fritiofson
Change-Id: I6f3950374f2525a18bbcb9cbd340c447c20fb704 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2134 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28swd: Remove support for turnaround periods other than 1Andreas Fritiofson
ARM deprecated other trn periods in ADIv5.1 and one cycle is the only setting that is guaranteed to be implemented, as well as being the reset value in ADIv5.0. Thus it makes no sense supporting anything else. Change-Id: Iffa16bb0ce74788bca88fd3ace8a026148013d00 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2132 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28swd: Fix park bit polarity according to ADIv5.1 SupplementAndreas Fritiofson
Change-Id: I27293defd3f3c3bf37c9662f88689e85ba593d86 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2131 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28swd: Convert API to asynchronousAndreas Fritiofson
Change-Id: I859568dbb2ad4e92411980751c3f747bd70638b8 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1959 Tested-by: jenkins Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28drivers/cmsis_dap_usb: remove jtag reset hacksPaul Fertser
This should no longer be needed after tcl scripts are fixed to avoid calling jtag subcommands when jtag is not used. Barely tested with an frdm board. Change-Id: I75f02b088e6134562ae634417d97c48e377df6e9 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2130 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-06-28tcl: introduce using_(jtag|swd|hla) helpers and use them in reset handlerPaul Fertser
Barely tested with plain SWD transport. Change-Id: I48b59136bf4294ffed737dba01f1b30ef83aa86b Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2003 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-06-28swd: Improve parity calculation and move it to types.hAndreas Fritiofson
It could be reused by SWD drivers and in other places. Change-Id: Ieed0cf70c111a73d3a42ed59f46a0cdd177a73d5 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1957 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28adi_v5: Remove unused features of the DAP and SWD interfacesAndreas Fritiofson
These features are not currently used so remove or disable them before something starts to. Not having them around simplifies redesign of the APIs. Change-Id: Iad25cc71c48b68a1fa71558141bf14d5ab20d659 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1955 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28adi_v5_swd: Improve SWD supportFatih Aşıcı
Fix bug in parity calculation macro. Cache and update the selected DP bank when necessary. Add aborts when the Ack code signals a failure (we should really only clear the sticky bits, but this will do for now). Change-Id: I38a4da136ba1d9e989b33c1875a80c0b1b2be874 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/1950 Tested-by: jenkins
2014-06-22jtag/drivers/jlink: better diagnostics for RCLK problemsPaul Fertser
The JLink protocol description doesn't really specify it for JTAG-level commands but the real life evidence is that 0x01 error code means "Adaptive clocking timeout" as it does for e.g. WRITE_MEM_ARM79. Change-Id: I4e3b568742814271919f92d202713968c8fcccfb Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2169 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-06-01jtag/drivers/osbdm: downgrade init message severity, fix wordingPaul Fertser
Change-Id: Iacf874b0fe9fbf840e82e6b63f1c97031f4720de Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2156 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-06-01jtag/drivers/stlink: allow to reconnect seamlessly after polling failurePaul Fertser
If the communication with the target was failing (either because of an intermittent connection or the target was rebooted), this is needed to reestablish operational state. Reported-by: Tim Sander <tim@krieglstein.org> Tested-by: Tim Sander <tim@krieglstein.org> Change-Id: I91ea2e2b2b5ef8eb27dfe9bae95ef2a919f67e4e Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2152 Tested-by: jenkins Reviewed-by: Tim Sander <tim@krieglstein.org> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-05-09ftdi: Optimize GPIO togglingAndreas Fritiofson
Only send the new I/O state for the bytes that changed. Change-Id: I930edc9518e6019331e68e4756acc5e92dda25a4 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1999 Tested-by: jenkins Reviewed-by: Jens Bauer <jens@gpio.dk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-04-14usb_blaster: fix warning: array subscript has type ‘char’Spencer Oliver
caught by clang 3.4 running on cygwin. Change-Id: I59f652337334e557fb50374f5270ba9c30392b6e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2100 Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2014-04-14jtag/drivers/remote_bitbang: use sizeof to determine maximum unix socket ↵Paul Fertser
path length Different *nix systems use different constants, so sizeof should be used instead. This fixes the build on OS X (as sun_path length is hardcoded to 104 on Darwin). Change-Id: I1df611383dedcfc6d153ec59b453a895c7d84e94 Reported-by: Xiaofan Chen <xiaofanc@gmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2095 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2014-04-14parport: add "aspo" hotpluggable adapter configKarl Hammar
This adds a new adapter config. Design files are available from: http://turkos.aspodata.se/git/openhw/isp/pp_jtag_arm20.sch http://turkos.aspodata.se/git/openhw/isp/pp_jtag_arm20.pcb No need to document it anywhere as only a single device was ever built. Change-Id: If031fdb9dedb1e544401747bfb7fbc5afc4d5407 Signed-off-by: Karl Hammar <karl@aspodata.se> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2094 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-04-14Makefile.am: fix build for libftdi1, pass CFLAGS where appropriatePaul Fertser
Change-Id: I9d8afa6ae32fc01e69ec434b5bc9d71524d386a2 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2079 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2014-04-08jtag/aice/aice_usb: remove unused constantsPaul Fertser
Those are breaking the build with clang 3.4 (current default compiler on OS X 10.9.2). Change-Id: I9f2fbfbb6d544498cb8d6a62565e4ebe7223e784 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2077 Tested-by: jenkins Reviewed-by: Hsiangkai Wang <hsiangkai@gmail.com>
2014-03-30Don't cast return value of [cm]allocAndreas Fritiofson
Change-Id: I0028a5b6757b1ba00031893d9a2a1725f915a0d5 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2069 Tested-by: jenkins Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-29Add usb_blaster cheap clone notes to distPaul Fertser
Change-Id: Ie9569634415ef76e88d5ca58bae6184838cf7114 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1908 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-29Add rlink speed table sources and everything related to distPaul Fertser
GPL requires providing sources for any derived work. I do not see any reason to not include the rlink stuff into release tarballs. Change-Id: I686ab88994030312aca5bdfe731a72f10803b5c3 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1907 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-29jlink: add support for Jlink-OB (0x0105) devicesAndrey Yurovsky
The JLink-OB (onboard) devices work the same way as the normal JLink except that their PID is 0x0105 (and that's the only one we know of so far) and their endpoint addresses are different due to there being a CDC-ACM interface as well. These JLink-OB devices show up on a lot of vendors' development kits as an integrated debugger. This change simply checks whether the adapter we opened has a JLink-OB PID and, if it does, uses the JLink-OB endpoints rather than the default. To do this, we add a new routine, jtag_libusb_get_pid() to the libusb adapter layer, it in turn just calls libusb_get_device_descriptor(), which previously had no wrapper. Also, checkpatch.pl doesn't like the VID/PID macros as defined so I moved them to the array itself. This should have no effect on the code. This change adds the 0102 through 0104 PIDs to openocd.rules as well as this new 0105 PID. Tested on an Atmel SAM4S Xplained board which has a JLink-OB, also regression tested by using a 0x0101 PID normal JLink adapter. Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com> Change-Id: I121d30e57729cda3adb66e2a5dc72e1fcb7ef8b1 Reviewed-on: http://openocd.zylin.com/2031 Tested-by: jenkins Reviewed-by: Xiaofan <xiaofanc@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-03-28ft2232: Mark interface driver as deprecatedAndreas Fritiofson
Change-Id: I5ebc924ab66c86f1902942bebc203a34d97abc64 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1899 Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Tested-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-17CMSIS-DAP: print a debug message when the USB product string cannot be readJörg Wunsch
As suggested by Stian Skjelstad in a comment in: http://openocd.zylin.com/#/c/2044/ if the USB product string cannot be read, provide a debug message so users might get aware of a potential permission problem when looking at the debug output. Fix style bug found by Jenkins. Change-Id: I6acb1c6261fec6f2bee80e4be513a5c5e29eff79 Signed-off-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-on: http://openocd.zylin.com/2048 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-17All Atmel-provided CMSIS-DAP devices use 512 byte packet sizeJörg Wunsch
The existing CMSIS-DAP driver matches the USB VID/PID against 0x3eb (Atmel VID) and 0x2111 (Atmel EDBG embedded CMSIS-DAP debugger), and then bumps the packet size from its default of 64 to 512. However, it turned out that *all* Atmel-provided CMSIS-DAP devices (EDBG with PID 0x2111; JTAGICE3 with firmware version 3.x, PID 0x2140; new Atmel-ICE [successor of JTAGICE3], PID 0x2141) require a 512-byte packet size. Obviously, all run the same USB implementation inside their custom microcontroller. Thus, it seems best to simply assume that *all* Atmel CMSIS-DAP devices use this packet size, and don't check the PID at all. This has also been filed as Trac bug #68: https://sourceforge.net/apps/trac/openocd/ticket/68 Change-Id: I942af93060fdf265fca3961841638caa6182f877 Signed-off-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-on: http://openocd.zylin.com/2045 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
2014-03-17Prevent segfault when the USB product string cannot be retrievedJörg Wunsch
In the CMSIS-DAP driver, if nothing has been specified by the user, an attempt is made to find the first device with the (mandatory) substring "CMSIS-DAP" in any USB device's product string. However, while (usually) all devices can be traversed, devices the user does not have permission for cannot be read the product string from, resulting in a NULL pointer. Trying to find the substring "CMSIS-DAP" causes a segementation fault then. This has also been filed as Trac bug #67: https://sourceforge.net/apps/trac/openocd/ticket/67 Change-Id: Idfc9f072e34152e9af99fe1c8ec88c99dea4624c Signed-off-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-on: http://openocd.zylin.com/2044 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-17stlink_usb.c: add support for STLink V2-1Bartosz Bielawski
The new version of STLink (V2-1) has a different USB endpoint layout. As the PID of the device also changed it's possible to change EPs used by OpenOCD in runtime. The patch adds three new fields to stlink_usb_handle_s and assigns right EP numbers in stlink_usb_open(). Parts of the code inspired by and used with consent of Jens Hoffmann. Change-Id: I93b69fb889f15317e9bf864905f435905db39745 Signed-off-by: Bartosz Bielawski <bartosz.bielawski@gmail.com> Reviewed-on: http://openocd.zylin.com/2019 Tested-by: jenkins Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp> Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-07stlink: Use callback to increase frequency of trace data samplingAndreas Fritiofson
The ST-LINK/V2 has limited internal buffering, such that trace data can be missed if the target is generating data at a rate quicker than the OpenOCD trace sampling. The issue of lost data is compounded since individual TPIU packets may be split across individual STLINK_TRACE_EP reads, and misleading results can occur if mid-packet loss occurs. This patch increases the frequency of checking for pending trace data with the aim of minimising such losses. Note: With the limited (I/O and memory) bandwidth of the ST-LINK/V2 there cannot, however, be a guarantee against trace data loss. The timer callback is only added when enabling tracing, and is removed when tracing is disabled. Change-Id: Ibde9794b77793d3068f88cb5c1a26f9ceadcbd8a Signed-off-by: James G. Smith <jsmith@ecoscentric.com> Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1661 Tested-by: jenkins
2014-03-04CMSIS-DAP: Fix build errors on Mac OS XJens Bauer
Rename the argument variable 'wait' to 'delay', as 'wait' conflicts with an API function declared in system header /usr/include/sys/wait.h on Mac OS X. Change-Id: I5742da6e5def6e5ec197e774c3844e4bf0424569 Signed-off-by: Jens Bauer <jens@gpio.dk> Reviewed-on: http://openocd.zylin.com/1973 Tested-by: jenkins Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24drivers/jtag: usb_blaster: make command handlers more strictAntony Pavlov
If user used wrong argument number for some usb_blaster_* commands then openocd show just warning message. This commit makes command handler's behaviour more strict and openocd treats wrong argument number as an error. In addition we already have 'help' and 'usage' information in struct command_registration ublast_command_handlers[], so we can drop redundancy messages in command handlers. Change-Id: I73b8c75ec60a18e5258a4bdffe972e8a1afc1066 Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Reviewed-on: http://openocd.zylin.com/1942 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24tcl/drscan: handle invalid syntax with a conditional, not assertPaul Fertser
When "drscan" command is used improperly, such as in: drscan stm32f1x.cpu -endstate drpause there're no fields to scan, and so the assert leads to a segfault. This should be treated like any other syntax error instead. Change-Id: Id1743f5d641038e1e3754c6f3097aabc5d1916b9 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1927 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24usb_blaster: ublast_access.h: add guard macroAntony Pavlov
Change-Id: I10f6e2048cf88f64f5dce275a273783365afd65c Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Reviewed-on: http://openocd.zylin.com/1941 Tested-by: jenkins Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-02-24drivers/ftdi: warn the user if he tries to use undefined reset signalsPaul Fertser
It is really an error to try to use a reset_config that doesn't match adapter's capabilities, however OpenOCD has no way to specify them. Using wrong reset_config might lead to very confusing behaviour, so I think LOG_ERROR is justified here. Change-Id: I1c6dcfa7c0d78829229a850189cad646b565dd66 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1948 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24ft2232: warn about lack of TRST on "turtle" adapterPaul Fertser
This patch fixes a build error (assigning a variable to itself) with clang. Since this adapter lacks trst, trying to use it in reset_config will fail silently. Warn the user accordingly. Change-Id: I16fd20936f00d7ff82962f4fcc629ff434aa4dce Reported-by: Rainer Müller <raimue@codingfarm.de> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1946 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>