]> git.sur5r.net Git - openocd/log
openocd
10 years agoflash: samd: add missing ID for SAMD20E18A
Andrey Yurovsky [Mon, 18 Aug 2014 16:05:56 +0000 (09:05 -0700)]
flash: samd: add missing ID for SAMD20E18A

This was somehow missed in the chip ID table and of course that's
exactly the one on my board (as such, tested on hardware).

Change-Id: I212d7c729d979e0357f1d4635f40935e25fe6ff3
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/2260
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agojlink: Constantify string arrays
Spencer Oliver [Fri, 8 Aug 2014 21:22:30 +0000 (22:22 +0100)]
jlink: Constantify string arrays

Change-Id: Ib63f4c32e6d5a7dad21567521d938142ea40b308
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2245
Tested-by: jenkins
10 years agojlink: add variant "J-Link Lite-ADI"
Spencer Oliver [Fri, 8 Aug 2014 21:07:38 +0000 (22:07 +0100)]
jlink: add variant "J-Link Lite-ADI"

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
10 years agojlink: fix typo
Spencer Oliver [Fri, 8 Aug 2014 21:01:08 +0000 (22:01 +0100)]
jlink: fix typo

Change-Id: If495b819c0532a97447ec7208c13d8a66a3ad47d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2243
Tested-by: jenkins
10 years agoflash/nor/stm32f1x: add STM32F302x6/8 IDs, clarify STM32F302xB/C
Paul Fertser [Thu, 14 Aug 2014 16:36:27 +0000 (20:36 +0400)]
flash/nor/stm32f1x: add STM32F302x6/8 IDs, clarify STM32F302xB/C

Change-Id: I22afbe30f32b0ea9b59c3de8d15ce14bdc4763cc
Reported-by: Luis Rodrigues <lfrodrigues@gmail.com>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2249
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agojtag: usb_blaster: fix initialization regression
Robert Jarzmik [Sun, 27 Jul 2014 10:30:13 +0000 (12:30 +0200)]
jtag: usb_blaster: fix initialization regression

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>
10 years agotransport: emit a warning when a user tries to reselect a transport
Paul Fertser [Fri, 15 Aug 2014 07:31:16 +0000 (11:31 +0400)]
transport: emit a warning when a user tries to reselect a transport

Even though changing transport is impossible, reselecting it should be
harmless.

Change-Id: I6c1c2786134e826f47f848b590e6d712b6fd2206
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2251
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotcl/interface/ftdi: auto-select SWD from converters' configs
Paul Fertser [Thu, 14 Aug 2014 16:12:01 +0000 (20:12 +0400)]
tcl/interface/ftdi: auto-select SWD from converters' configs

When you source a JTAG-SWD converter config, any other transport
doesn't make any sense, so just autoselect it right there.

Change-Id: I6c098740905a0d4007473fc19cc07e11cbcc9369
Suggested-by: Хайруллин Эльдар <eldar.khayrullin@mail.ru>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2248
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Eldar Khayrullin <eldar.khayrullin@mail.ru>
10 years agotcl/board/stm32ldiscovery: fix breakage
Eldar Khayrullin [Sun, 17 Aug 2014 08:17:57 +0000 (12:17 +0400)]
tcl/board/stm32ldiscovery: fix breakage

Change-Id: I450ea82c27009be6bad6a7814969d81964ff44d8
Signed-off-by: Eldar Khayrullin <eldar.khayrullin@mail.ru>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2255
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agomips_m4k.c: EJTAGBOOT and NORMALBOOT are not supported on EJTAG 2.0
Oleksij Rempel [Thu, 23 Jan 2014 20:08:31 +0000 (21:08 +0100)]
mips_m4k.c: EJTAGBOOT and NORMALBOOT are not supported on EJTAG 2.0

Change-Id: I8157c19e9d8aed5c2376a2c54c32c1ddac1ad5af
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/1934
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agomips_m4k.c: D or I breaks only if they supported.
Oleksij Rempel [Wed, 22 Jan 2014 11:27:19 +0000 (12:27 +0100)]
mips_m4k.c: D or I breaks only if they supported.

For example Realtek RTL8186 (Lexra LX5280 core) don't
support break- and watchpoints.

Change-Id: Ie00102da4bf13a8c42a9ad05910c66884f297cfd
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/1933
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agomips32.c: cache debug caps and support EJTAG 2.0 specific changes
Oleksij Rempel [Wed, 5 Feb 2014 22:11:15 +0000 (23:11 +0100)]
mips32.c: cache debug caps and support EJTAG 2.0 specific changes

EJTAG v2.0 indicated some debug caps in IMP register.
V2.6 moved them to DCR register. To make it more universal,
convert this values and store them for later use.

Change-Id: Id6b9f47c9c2ea94d37281ebfcae5acf357261ddf
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/1932
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agomips32.c: fix IB and DB bits check for EJTAG v2.0
Oleksij Rempel [Tue, 21 Jan 2014 19:48:14 +0000 (20:48 +0100)]
mips32.c: fix IB and DB bits check for EJTAG v2.0

Change-Id: I4e28dddc1d5d9c2b923ae17beacdd7f73591b1d0
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/1931
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agomips_ejtag.c: do not set v2.6 ECR bits on v2.0 devices
Oleksij Rempel [Thu, 23 Jan 2014 08:47:37 +0000 (09:47 +0100)]
mips_ejtag.c: do not set v2.6 ECR bits on v2.0 devices

Change-Id: I894abbb923282d5f84daf8e0bca69190c07567de
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/1930
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agomips_ejtag.c|h: use version specific IMPs
Oleksij Rempel [Thu, 14 Aug 2014 21:10:33 +0000 (22:10 +0100)]
mips_ejtag.c|h: use version specific IMPs

and make version specific debug log

Change-Id: I17f7ff757cfa1264a1dadbfe20c5e21de62ef87a
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/1929
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoRemoved limit on lenght of command line options.
Cristian Maglie [Fri, 8 Aug 2014 16:40:57 +0000 (18:40 +0200)]
Removed limit on lenght of command line options.

In particular -f and -s options may contains paths that can easily
exceed the (old) 128 bytes buffer.

Change-Id: Ifc198536549f50663e8e588519bb9ef75dcd172c
Signed-off-by: Cristian Maglie <c.maglie@bug.st>
Reviewed-on: http://openocd.zylin.com/2241
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agotcl/board: Add board configuration for nRF51822-mKIT
Andrey Smirnov [Wed, 16 Apr 2014 12:00:45 +0000 (05:00 -0700)]
tcl/board: Add board configuration for nRF51822-mKIT

Add board configuration for Nordic's nRF51822-mKIT devkit, available
here:
http://mbed.org/platforms/Nordic-nRF51822/

Change-Id: Ib9329307147b1e7be061a5060b4eec8256fe2bd4
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
[gus@projectgus.com: Minor tweaks, model number]
Signed-off-by: Angus Gratton <gus@projectgus.com>
Reviewed-on: http://openocd.zylin.com/2116
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agostlink_usb: Fix swallowed error on read/write operations, add retries on SWD WAIT...
Angus Gratton [Fri, 27 Jun 2014 23:27:11 +0000 (09:27 +1000)]
stlink_usb: Fix swallowed error on read/write operations, add retries on SWD 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>
10 years agonRF51822: Add workaround for PAN-16 where not all RAM blocks reliably enabled on...
Angus Gratton [Tue, 1 Jul 2014 00:23:25 +0000 (10:23 +1000)]
nRF51822: Add workaround for PAN-16 where not all RAM blocks reliably enabled on reset

According to Nordic Semiconductor Product Anomaly Notice (document
NRF51822-PAN), item 16, some revisions of nRF51822 sometimes reset
without all RAM blocks enabled. This was noted on NRF51822-QFAA rev
CA/C0, only 8KiB of memory was accessible.

This patch turns on all RAM following a debugger induced reset
(matches specified behaviour.)

Change-Id: I4f8be4ec3d1271da7fe5bc9a084fdcb2968535bb
Signed-off-by: Angus Gratton <gus@projectgus.com>
Reviewed-on: http://openocd.zylin.com/2202
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agotcl/target: added support for TI OMAP/AM 3505 and 3517
Andrey Skvortsov [Wed, 7 May 2014 08:59:21 +0000 (12:59 +0400)]
tcl/target: added support for TI OMAP/AM 3505 and 3517

added TAPID for OMAP/AM 3505 and 3517. Tested on TAM3517 Twister board
with AM3517 SoC.

Change-Id: I78a3268a4adb18092c694a556538c99c9032f648
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2127
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agoAllow transports to override the selected target (hla configs unification)
Paul Fertser [Sat, 28 Sep 2013 10:23:15 +0000 (14:23 +0400)]
Allow transports to override the selected target (hla configs unification)

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>
10 years agonewdap: Ignore -irlen/-irmask/etc newdap params on SWD or CMSIS-DAP
Angus Gratton [Wed, 23 Jul 2014 22:14:04 +0000 (08:14 +1000)]
newdap: Ignore -irlen/-irmask/etc newdap params on SWD or CMSIS-DAP

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>
10 years agointerface/ftdi: Mark flyswatter.cfg as tested
Andreas Fritiofson [Sat, 2 Aug 2014 08:32:47 +0000 (10:32 +0200)]
interface/ftdi: Mark flyswatter.cfg as tested

- Flyswatter + Proxmark3 (Atmel AT91SAM7S256) - works
- Flyswatter + Tiva Launchpad (EK-TM4C123GXL) - works

Change-Id: I615e0ff9262be6ae1064fb2de8e6e810775e7db4
Tested-by: Ondrej Mikle <ondrej.mikle@nic.cz>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2237
Tested-by: jenkins
10 years agodrivers/jlink: Revert old workaround
Andreas Fritiofson [Thu, 24 Jul 2014 21:14:03 +0000 (23:14 +0200)]
drivers/jlink: Revert old workaround

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>
10 years agodrivers/jlink: fix SWD speed config, and set it before sending anything
Paul Fertser [Sat, 19 Jul 2014 12:48:09 +0000 (16:48 +0400)]
drivers/jlink: fix SWD speed config, and set it before sending anything

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>
10 years agodrivers/jtag/jlink: support SWD mode
Paul Fertser [Wed, 14 May 2014 07:42:16 +0000 (11:42 +0400)]
drivers/jtag/jlink: support SWD mode

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>
10 years agotcl/board: fix all the remaining boards that were sourcing ft2232 configs
Paul Fertser [Mon, 28 Jul 2014 18:10:45 +0000 (22:10 +0400)]
tcl/board: fix all the remaining boards that were sourcing ft2232 configs

This was reported in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751372 .

Change-Id: I258f3d40593ff2966ce3ca61c13a23699d1b162f
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2230
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agoFix some problems with the bin2char utility
Andreas Fritiofson [Wed, 18 Jun 2014 21:10:45 +0000 (23:10 +0200)]
Fix some problems with the bin2char utility

Don't hardcode the type for the array, just output the array initializer
so the includer can choose the type and storage class, zero-terminate at
will and so on.

Change-Id: I6d5e0710eaaba0a218b3eb32f6569177356f4462
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2176
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoProvide od+sed replacement for the bin2char helper
Paul Fertser [Sun, 11 May 2014 18:15:55 +0000 (22:15 +0400)]
Provide od+sed replacement for the bin2char helper

Using custom build-time tools is always more problematic, especially
for cross-compiling.

This alternative implementation assumes "od" (IEEE Std 1003.1-2001)
and sed are available which should be the case for any reasonably
modern system.

Change-Id: I0208f475648c78e7dca127ff4bab60d314b2bf53
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2139
Tested-by: jenkins
Reviewed-by: Fatih Aşıcı <fatih.asici@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agotcl/board: add STM32429I-EVAL and STM32439I-EVAL dev boards from ST.
Fredrik Hederstierna [Thu, 12 Jun 2014 22:29:43 +0000 (00:29 +0200)]
tcl/board: add STM32429I-EVAL and STM32439I-EVAL dev boards from ST.

Change-Id: I304b6e7bae832391f11d53003299d68e31b0e4ef
Signed-off-by: Fredrik Hederstierna <fredrik@hederstierna.com>
Reviewed-on: http://openocd.zylin.com/2171
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agotcl/target/stm32l: restore slow clock on reset
Paul Fertser [Mon, 23 Jun 2014 12:32:54 +0000 (16:32 +0400)]
tcl/target/stm32l: restore slow clock on reset

Change-Id: I63eafaa38b188fe50c13ab966be44a3eaa2006b0
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2188
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoAdding support for the Atmel SAMR21.
Thomas Schmid [Tue, 1 Jul 2014 17:29:56 +0000 (11:29 -0600)]
Adding support for the Atmel SAMR21.

The Atmel SAMR21 is a Atmel SAMD21 with an Atmel RF233 in one package (two
dies). Tested with the SAMR21 Xplained Pro eval kit.

Change-Id: I1d79ea05834b925d7ec810527206fe86854e684b
Signed-off-by: Thomas Schmid <thomas@rfranging.com>
Reviewed-on: http://openocd.zylin.com/2194
Tested-by: jenkins
Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agodrivers/cmsis_dap_usb: Return with ERROR_FAIL if no CMSIS-DAP device is found.
Masaki Muranaka [Tue, 24 Jun 2014 00:33:05 +0000 (09:33 +0900)]
drivers/cmsis_dap_usb: Return with ERROR_FAIL if no CMSIS-DAP device is found.

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>
10 years agomips_m4k.c: make sure fast_data_area is safe
Oleksij Rempel [Tue, 7 Jan 2014 19:28:12 +0000 (20:28 +0100)]
mips_m4k.c: make sure fast_data_area is safe

If load_image address overlap with fast_data_area,
it will caouse different mysterius issues. This patch
should prevent it.

Change-Id: Ibc95e5aa3ac002a59755029496b6a72616e9287f
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/1854
Tested-by: jenkins
Reviewed-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agocfg: Rename leftover cortex_a8 -> cortex_a
Andreas Fritiofson [Thu, 3 Jul 2014 21:44:02 +0000 (23:44 +0200)]
cfg: Rename leftover cortex_a8 -> cortex_a

Change-Id: Id11d89ae2fb78854da4284afb7f14d8a892a2e49
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2197
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agokinetis : Added Kinetis-K Series MDM-AP ID.
Nemui Trinomius [Tue, 1 Jul 2014 22:18:16 +0000 (07:18 +0900)]
kinetis : Added Kinetis-K Series MDM-AP ID.

Kinetis-K series has ID:0x001C0000 on MDM-AP IDR register.
Other Kinetis(L/M/V/E) series have ID:0x001C0020.

Change-Id: Iada37038cd239f7331ba80a3673b36bf7e18c555
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/2195
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agocortex_a: target implementation renames cortex_a8 to cortex_a
Kamal Dasu [Thu, 29 Aug 2013 15:53:26 +0000 (11:53 -0400)]
cortex_a: target implementation renames cortex_a8 to cortex_a

A previous commit changes the target name used by tcl scripts.
commit d9ba56c295f057e716519a798bf9cdb4898c24f4
target: rename cortex_a8 to cortex_a

The current change renames target functions and definitions in the
implementation from cortex_a8 to cortex_a.
This prepares the implementation to support Cortex-A8, A9, A15-MPCore
in one place.

Change-Id: I73b5a38a92c12ba5bd3b806fbbb664817575a6d7
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Reviewed-on: http://openocd.zylin.com/1599
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agovsllink: Port to libusb-1.0 API
Fatih Aşıcı [Tue, 18 Feb 2014 07:55:15 +0000 (09:55 +0200)]
vsllink: Port to libusb-1.0 API

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>
10 years agovsllink: Add SWD support
Fatih Aşıcı [Sun, 16 Feb 2014 09:12:39 +0000 (10:12 +0100)]
vsllink: Add SWD support

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
10 years agojtag/drivers/opendous: remove ftime() calls
Paul Fertser [Mon, 23 Jun 2014 10:01:56 +0000 (14:01 +0400)]
jtag/drivers/opendous: remove ftime() calls

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>
10 years agodrivers/cmsis_dap_usb: restructure init sequence a bit
Paul Fertser [Wed, 25 Jun 2014 18:50:03 +0000 (22:50 +0400)]
drivers/cmsis_dap_usb: restructure init sequence a bit

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>
10 years agojtag/drivers/cmsis_dap: fix check for hardcoded vids/pids
Paul Fertser [Tue, 24 Jun 2014 14:10:35 +0000 (18:10 +0400)]
jtag/drivers/cmsis_dap: fix check for hardcoded vids/pids

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>
10 years agoOpenocd: svf: Add ability to ignore svf_check_tdo errors
Kamal Dasu [Thu, 20 Feb 2014 22:46:42 +0000 (17:46 -0500)]
Openocd: svf: Add ability to ignore svf_check_tdo errors

Added Openocd commandline argument to ignore_error when the
read back TDO does not match to expected value specified with
TDO after masking with what is specified in MASK. This allows
to continue to play entire SVF file ignoring errors.
Error logs clearly show the failure reason and prints
read back TDO value.

Change-Id: I324f476fc16a003b35e6f2c5b63976431f49d54a
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Reviewed-on: http://openocd.zylin.com/2129
Tested-by: jenkins
Reviewed-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agoAdd error handling and remove double readout.
Mathias K [Tue, 26 Feb 2013 16:24:41 +0000 (17:24 +0100)]
Add error handling and remove double readout.

Remove double readout of DCB_DHCSR in target poll. The return value
of the endreset event is handled and not ignored in target poll.

Change-Id: I8fe026418dadcf0b0dcbb09acee871ad950937a2
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/1181
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agojtag/drivers/ftdi: do not touch unavailable reset signals
Paul Fertser [Sun, 22 Jun 2014 19:23:31 +0000 (23:23 +0400)]
jtag/drivers/ftdi: do not touch unavailable reset signals

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>
10 years agocfg: add SWD configs for stellaris ftdi based adapters
Spencer Oliver [Fri, 20 Jun 2014 22:59:30 +0000 (23:59 +0100)]
cfg: add SWD configs for stellaris ftdi based adapters

Tested on hardware.

Change-Id: Ib0191e97988dc79e9a62da74bd7fe25f548ff5a2
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2185
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
10 years agotcl/interface/ftdi: add SWD configs for kt-link, olimex, rowley and resistor hack
Paul Fertser [Fri, 20 Jun 2014 10:48:05 +0000 (14:48 +0400)]
tcl/interface/ftdi: add SWD configs for kt-link, olimex, rowley and resistor hack

Resistor hack is runtime-tested, other configs are based on
schematics.

Change-Id: I8daffa0434cd41d142fbec7c230a302284f7aa31
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2184
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agojtag/drivers/ftdi: require defining SWD_EN signal for SWD mode
Paul Fertser [Fri, 20 Jun 2014 09:31:25 +0000 (13:31 +0400)]
jtag/drivers/ftdi: require defining SWD_EN signal for SWD mode

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
10 years agojtag/drivers/ftdi: declare standard JTAG signals on SWD init
Paul Fertser [Fri, 20 Jun 2014 09:13:27 +0000 (13:13 +0400)]
jtag/drivers/ftdi: declare standard JTAG signals on SWD init

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>
10 years agojtag/drivers/ftdi: add option to declare signal aliases
Paul Fertser [Fri, 20 Jun 2014 08:47:24 +0000 (12:47 +0400)]
jtag/drivers/ftdi: add option to declare signal aliases

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>
10 years agoAuto-select JTAG transport when appropriate
Paul Fertser [Thu, 19 Jun 2014 10:21:21 +0000 (14:21 +0400)]
Auto-select JTAG transport when appropriate

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>
10 years agoRelax polling check if not in JTAG mode
Andreas Fritiofson [Wed, 14 May 2014 20:14:10 +0000 (22:14 +0200)]
Relax polling check if not in JTAG mode

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>
10 years agocfg: Add SWD support to JTAG-lock-pick Tiny 2
Andreas Fritiofson [Fri, 9 May 2014 20:38:45 +0000 (22:38 +0200)]
cfg: Add SWD support to JTAG-lock-pick Tiny 2

Change-Id: I61eac507fa6861b7daf603ebca58e8bf3cc699c1
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2136
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoAdd FTDI SWD driver
Andreas Fritiofson [Sat, 10 May 2014 09:31:49 +0000 (11:31 +0200)]
Add FTDI SWD driver

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>
10 years agotransport: Constify the transports vector
Andreas Fritiofson [Sat, 10 May 2014 09:31:35 +0000 (11:31 +0200)]
transport: Constify the transports vector

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>
10 years agoswd: Add frequency setting and special/switching sequences to the API
Andreas Fritiofson [Sun, 2 Mar 2014 19:35:32 +0000 (20:35 +0100)]
swd: Add frequency setting and special/switching sequences to the API

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>
10 years agoadi_v5: Make sure all bit masks are unsigned and wide enough.
Andreas Fritiofson [Sun, 2 Mar 2014 19:33:54 +0000 (20:33 +0100)]
adi_v5: Make sure all bit masks are unsigned and wide enough.

Also align them with spaces instead of tabs.

Change-Id: I1c01412a3ea77b29e8e133f5c92d05ed79d7c0f3
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2133
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoswd: Remove support for turnaround periods other than 1
Andreas Fritiofson [Fri, 9 May 2014 20:50:34 +0000 (22:50 +0200)]
swd: Remove support for turnaround periods other than 1

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>
10 years agoswd: Fix park bit polarity according to ADIv5.1 Supplement
Andreas Fritiofson [Fri, 9 May 2014 20:49:21 +0000 (22:49 +0200)]
swd: Fix park bit polarity according to ADIv5.1 Supplement

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>
10 years agoswd: Convert API to asynchronous
Andreas Fritiofson [Wed, 18 Jun 2014 22:47:17 +0000 (00:47 +0200)]
swd: Convert API to asynchronous

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>
10 years agoadi_v5_cmsis_dap.c: Simplify debugging output
Andrey Smirnov [Wed, 18 Jun 2014 21:41:00 +0000 (23:41 +0200)]
adi_v5_cmsis_dap.c: Simplify debugging output

Name of the function is already a part of the LOG_DEBUG macro, so
there's no need to include it in the string itself.

Change-Id: I18c3d5b746e9106d55104e490ccf5bc5e85cc380
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2138
Tested-by: jenkins
10 years agocortex_m: Do additional initialization during reset
Andrey Smirnov [Thu, 3 Apr 2014 21:59:44 +0000 (14:59 -0700)]
cortex_m: Do additional initialization during reset

SAM4L requires additional steps to be taken right after SYSRESETREQ is
issued in order to function robustly:

       - CMSIS-DAP DAP driver needs to explicitly check for sticky bit
         errors since it is possible for adapter to perform successful
         write opration, report no errors and then, under the hood, do
         some other things that will result in sticky bit being set.

       - Debugger needs to wait for security system to finish
         intialization and assert CDBGPWRUPACK before proceeding

This change is related to commit http://openocd.zylin.com/#/c/1995/

Change-Id: I741c95a809bfd60d930cec9482239e4796a62326
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2088
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
10 years agoadi_v5_cmisis_dap: Separate ABORT from clearing sticky errors
Andrey Smirnov [Wed, 18 Jun 2014 21:33:51 +0000 (23:33 +0200)]
adi_v5_cmisis_dap: Separate ABORT from clearing sticky errors

We don't need to do full blown AP ABORT in case of CMSIS-DAP errors,
and the code that was in place was not doing that(issuing AP ABORT)
anyway.

Change-Id: Ide83b1f8875d725da6cb0d53aae8229f8c6316b3
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2112
Tested-by: jenkins
Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
10 years agodrivers/cmsis_dap_usb: remove jtag reset hacks
Paul Fertser [Fri, 9 May 2014 13:57:20 +0000 (17:57 +0400)]
drivers/cmsis_dap_usb: remove jtag reset hacks

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>
10 years agotcl: introduce using_(jtag|swd|hla) helpers and use them in reset handler
Paul Fertser [Sat, 1 Mar 2014 18:40:54 +0000 (22:40 +0400)]
tcl: introduce using_(jtag|swd|hla) helpers and use them in reset handler

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>
10 years agoswd: Improve parity calculation and move it to types.h
Andreas Fritiofson [Sun, 16 Feb 2014 23:27:09 +0000 (00:27 +0100)]
swd: Improve parity calculation and move it to types.h

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>
10 years agoadi_v5_swd: Separate sticky error clearing from AP abort
Andreas Fritiofson [Sat, 10 May 2014 16:49:44 +0000 (18:49 +0200)]
adi_v5_swd: Separate sticky error clearing from AP abort

Swd_queue_ap_abort should set DAPABORT, not only clear sticky errors.
However, DAPABORT should not be set as soon as there is a single
FAULT/WAIT response. It's an "emergency only" operations for use only when
the AP have stalled the transfer for a long time. So these need to be
separate functions.

Change-Id: I37618447884faad54d846c2b07fa668ad505919d
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1956
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoadi_v5: Remove unused features of the DAP and SWD interfaces
Andreas Fritiofson [Tue, 18 Feb 2014 21:23:44 +0000 (22:23 +0100)]
adi_v5: Remove unused features of the DAP and SWD interfaces

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>
10 years agoadi_v5_swd: Read RDBUFF once after a sequence of AP reads
Andreas Fritiofson [Sun, 16 Feb 2014 08:29:01 +0000 (09:29 +0100)]
adi_v5_swd: Read RDBUFF once after a sequence of AP reads

Increases performance by a factor of two for long reads.

Change-Id: I81a7a83835058560c6a53a43c3cc991100f01766
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1954
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoadi_v5: Remove strange IDCODE check from dap info handler
Andreas Fritiofson [Sun, 16 Feb 2014 01:22:41 +0000 (02:22 +0100)]
adi_v5: Remove strange IDCODE check from dap info handler

Otherwise it breaks SWD targets. The check seems really weird anyway since
it loops through *all* TAPs after the ADIv5 target but doesn't do anything
at all with the result, other than not setting the return values despite
returning ERROR_OK.

Remove a bogus initialization that was needed because of the odd
behaviour of this routine when an IDCODE wasn't found.

Change-Id: Ic086352f6af868b3406b00420291a0a671e3acac
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1953
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoadi_v5_swd: Improve SWD support
Fatih Aşıcı [Fri, 14 Feb 2014 11:37:04 +0000 (13:37 +0200)]
adi_v5_swd: Improve SWD support

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
10 years agoconfigure: fix formatting when "echo -n" is not supported
Paul Fertser [Sun, 15 Jun 2014 06:20:45 +0000 (10:20 +0400)]
configure: fix formatting when "echo -n" is not supported

The -n option is non-standard and is unavailable on some systems
(e.g. OS X's shell builtin).

Change-Id: Ia2fed186dee5fa6da543944873d67ebee1d9354e
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2172
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agojtag/drivers/jlink: better diagnostics for RCLK problems
Paul Fertser [Thu, 12 Jun 2014 14:56:32 +0000 (18:56 +0400)]
jtag/drivers/jlink: better diagnostics for RCLK problems

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>
10 years agoflash: samd: add SAMD10 and SAMD11 part IDs
Andrey Yurovsky [Thu, 12 Jun 2014 16:57:29 +0000 (09:57 -0700)]
flash: samd: add SAMD10 and SAMD11 part IDs

Add part IDs for the new SAMD10 and SAMD11 parts within the Atmel SAMD
family, they have the same Flash controller as the other samd parts and
should be supported by the at91samd driver.  Compile-tested only.

Change-Id: I493ae96a7d7e8d19e607fd9a4b6544a982be42b3
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/2170
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotcl/target/fm3.cfg: use a CHIPNAME known by the flash driver
Paul Fertser [Wed, 4 Jun 2014 07:49:58 +0000 (11:49 +0400)]
tcl/target/fm3.cfg: use a CHIPNAME known by the flash driver

fm3 flash driver needs to know which chip variant is used.

This fixes "unknown fm3 variant: mb9bf500.cpu" error if the config is
used as is.

Change-Id: I500fcfb413f23ee246678cec5bd19d14139a28e2
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2160
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotarget: arm_adi_v5: added types and subtypes based on latest coresight documentation
Jiri Kastner [Tue, 10 Jun 2014 08:37:50 +0000 (10:37 +0200)]
target: arm_adi_v5: added types and subtypes based on latest coresight documentation

while investigating coresight components, i've found some new partnumbers and devtypes.

Change-Id: Ie68032b0b21d542c2084f80db38b06f5cd4c7591
Signed-off-by: Jiri Kastner <cz172638@gmail.com>
Reviewed-on: http://openocd.zylin.com/2166
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoopenrisc: add support for JTAG Serial Port
Franck Jullien [Fri, 30 May 2014 14:49:42 +0000 (16:49 +0200)]
openrisc: add support for JTAG Serial Port

Change-Id: I623a8c74bcca2edb5f996b69c02d73a6f67b7d34
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-on: http://openocd.zylin.com/2162
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoopenrisc: restore current JTAG module while polling the CPU
Franck Jullien [Mon, 9 Jun 2014 19:31:47 +0000 (21:31 +0200)]
openrisc: restore current JTAG module while polling the CPU

Change-Id: I93827afaa164d23a93bdddbfa864624b18473f45
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-on: http://openocd.zylin.com/2163
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoflash/nor/tcl.c: fix formatting in "rejected" error message
Paul Fertser [Wed, 4 Jun 2014 07:59:35 +0000 (11:59 +0400)]
flash/nor/tcl.c: fix formatting in "rejected" error message

The error message (with the usage field unpopulated) looks like this,
obviously missing at least a space before Usage:

Error: 'fm3' driver rejected flash bank at 0x00000000Usage (null)

Change-Id: I2a625676e784d02942823f972a201f7f4f810c68
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2161
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agosvf: Only read TDO back from the device if we actually need to look at the bits.
Joshua Wise [Fri, 16 May 2014 08:08:43 +0000 (01:08 -0700)]
svf: Only read TDO back from the device if we actually need to look at the bits.

This results in a 90% speedup on USB-Blaster, which serializes repeated
TDI input against TDO readback; program time on an 5CGXFC5C6F27 part was
dropped from 2m30s to 9s.

Signed-off-by: Joshua Wise <joshua@joshuawise.com>
Change-Id: I92d5a8b800492283d619328549235b610528c338
Reviewed-on: http://openocd.zylin.com/2145
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotcl/target/am335x.cfg: Drop gdb-attach stanza
Tom Rini [Fri, 21 Mar 2014 13:48:33 +0000 (09:48 -0400)]
tcl/target/am335x.cfg: Drop gdb-attach stanza

This isn't needed nor a recommended practice now, was a simple
copy/paste from amdm37x.cfg anyhow.

Change-Id: I064226dc859d7563cfad945b577279fc37448645
Signed-off-by: Tom Rini <trini@ti.com>
Reviewed-on: http://openocd.zylin.com/2068
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoefm32 : Added ZeroGecko family support.
Nemui Trinomius [Thu, 27 Feb 2014 14:57:09 +0000 (23:57 +0900)]
efm32 : Added ZeroGecko family support.

Added Cortex-M0plus "ZeroGecko" Family to flash driver.
Tested on EFM32ZG222F32.

Change-Id: I1660b34ef6ee04837e97581504fff0faf84d1c6d
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/1994
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agocortex_a: fix lockup when writing to high address
Seth LaForge [Tue, 6 May 2014 23:02:23 +0000 (16:02 -0700)]
cortex_a: fix lockup when writing to high address

On a processor with caches, when you write data to memory OpenOCD invalidates
the cache lines affected. If you write to an address within 64 bytes of
UINT32_MAX, then the for loop control variable wrapped around resulting in an
infinite loop. Change control variable to be an offset from the address
involved. We should never be asked to write 2^32 bytes, so wraparound should
not be a problem.

Change-Id: Ibfe654113eff71684862ff651e7a1cd05ccc6760
Signed-off-by: Seth LaForge <sethml@google.com>
Reviewed-on: http://openocd.zylin.com/2126
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agocfg: Added Nucleo-F334R8 board config.
Nemui Trinomius [Mon, 16 Jun 2014 14:10:19 +0000 (23:10 +0900)]
cfg: Added Nucleo-F334R8 board config.

It supports STLink/V2-1.

Change-Id: I0a8c01247a7a0165321818ca222479e3ae67ce5c
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/2175
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agostm32f1x: add STM32F33x support.
Nemui Trinomius [Mon, 16 Jun 2014 13:58:17 +0000 (22:58 +0900)]
stm32f1x: add STM32F33x support.

Added STM32F33x series to flash driver.
Tested on NUCLEO-F334R8 board(STM32F334R8T6).

Change-Id: I2fe70d40eb7613a7a3cfa63d25fa83f7bc055fb4
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/2174
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoflash/nor/kinetis: prevent segfaulting with an HLA
Paul Fertser [Sun, 15 Jun 2014 14:33:30 +0000 (18:33 +0400)]
flash/nor/kinetis: prevent segfaulting with an HLA

HLAs do not provide direct DAP access, so the best we can do about it
is skipping it.

Change-Id: I877ef8fd2d86e40e7442a637cdba182cfd60e05a
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2173
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agotcl/board: add Atmel SAM4E-EK
Marco Cruz [Thu, 29 May 2014 18:18:11 +0000 (15:18 -0300)]
tcl/board: add Atmel SAM4E-EK

Change-Id: I07d7e0528ed4e88b070ba4e7598a193ec8e9e37d
Signed-off-by: Marco Cruz <marco.caratuva@gmail.com>
Reviewed-on: http://openocd.zylin.com/2158
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agoflash/nor/at91sam4: add SAM4E16 support
Marco Cruz [Thu, 29 May 2014 17:15:06 +0000 (14:15 -0300)]
flash/nor/at91sam4: add SAM4E16 support

Change-Id: I7ab4750073c9d34812b690996eef76fccf70c627
Signed-off-by: Marco Cruz <marco.caratuva@gmail.com>
Reviewed-on: http://openocd.zylin.com/2157
Reviewed-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agoREADME.OSX: mention Gentoo Prefix and clarify other options
Paul Fertser [Sat, 17 May 2014 08:46:06 +0000 (12:46 +0400)]
README.OSX: mention Gentoo Prefix and clarify other options

Change-Id: I431bfb9acf7dd6ad61b9e8f5c20568be22e9f39d
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2146
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotarget: or1k: remove wrong endian swap from or1k generic code
Franck Jullien [Mon, 25 Nov 2013 22:18:19 +0000 (23:18 +0100)]
target: or1k: remove wrong endian swap from or1k generic code

We don't need to swap the endianness in the target generic code.
This swap is necessary because of the adv_debug_if debug unit.
This patch moves this specific piece of code from or1k.c to
or1k_du_adv.c.

Change-Id: I3acea092fe6edfa79b4a87861b5f01204f071bf0
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-on: http://openocd.zylin.com/1663
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agotcl/target/kl25.cfg: add maximum speed specification
Paul Fertser [Wed, 23 Apr 2014 08:22:39 +0000 (12:22 +0400)]
tcl/target/kl25.cfg: add maximum speed specification

Maximum frequency wasn't tested on hardware but the docs seem to be
quite explicit and do not mention any restrictions for that.

Change-Id: Idcf58df5358d06525e683f07c76eedad8f0b292d
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2120
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agotcl: add ASUS RT-N66U config
Paul Fertser [Sat, 24 May 2014 06:04:14 +0000 (10:04 +0400)]
tcl: add ASUS RT-N66U config

CFI flashing verified with real hardware. RAM configuration wasn't
attempted.

Change-Id: I9185ab71430d799793befef708a15f62edba1663
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2153
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agojtag/drivers/osbdm: downgrade init message severity, fix wording
Paul Fertser [Thu, 29 May 2014 07:13:24 +0000 (11:13 +0400)]
jtag/drivers/osbdm: downgrade init message severity, fix wording

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>
10 years agoFlash/LPC2000: Add support for auto-probing flash size
Cosmin Gorgovan [Sat, 29 Mar 2014 22:34:43 +0000 (22:34 +0000)]
Flash/LPC2000: Add support for auto-probing flash size

Adds support for auto-probing on devices which support the IAP
Read Part ID command. Includes IDs for all LPC17XX, LPC13XX,
LPC11XX and LPC11XXX devices with publicly available user
manuals.

To use auto-probing, select the 'auto' lpc2000 variant.

Change-Id: Ic617c32925c9ebe0e9d9192ed8ddbfa08e9f0aaa
Signed-off-by: Cosmin Gorgovan <cosmin@linux-geek.org>
Reviewed-on: http://openocd.zylin.com/2075
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoFlash/LPC2000: Add support for LPC11(x)xx, LPC13xx
Cosmin Gorgovan [Sat, 29 Mar 2014 19:20:08 +0000 (19:20 +0000)]
Flash/LPC2000: Add support for LPC11(x)xx, LPC13xx

LPC11(x)xx and LPC13xx devices are mostly compatible with the lpc1700
variant of the LPC2000 driver, but use a fixed flash sector size of 4KB.

Change-Id: I033515f4ff6bc61d3b9babd27096f78c99cea927
Signed-off-by: Cosmin Gorgovan <cosmin@linux-geek.org>
Reviewed-on: http://openocd.zylin.com/2071
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoSTM32F2x: Don't clear FLASH_OPTCR bits when locking register
Elliott Partridge [Wed, 28 May 2014 16:20:44 +0000 (12:20 -0400)]
STM32F2x: Don't clear FLASH_OPTCR bits when locking register

stm32x_write_options is locking the FLASH_OPTCR register by
writing 0x00000001 to it, which clears the other bits. This
causes problems with subsequent flash operations; the hardware
is probably seeing the write protection bits in the register
set to '0' (protect), causing a WRPERR.
This patch ORs the value of the register with 0x00000001, so that
the only change is the lock bit itself.

Change-Id: I0e3ca9aa6563ce1b57a01fc0faf7563b6b85f620
Signed-off-by: Elliott Partridge <elliott.partridge@gmail.com>
Reviewed-on: http://openocd.zylin.com/2155
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoDisable multiprocessor-id read on ARMv7-R cores
Alex Ray [Sun, 6 Apr 2014 14:34:27 +0000 (07:34 -0700)]
Disable multiprocessor-id read on ARMv7-R cores

ARMv7-R cores are largely uniprocessor-configured, and when they are
multiprocessor-configured the format of the MPIDR register isn't
compatible with ARMv7-A cores.

Change-Id: I024ec514496fbab5075c6fb34b6acd870e68e1fc
Signed-off-by: Alex Ray <a@machinaut.com>
Reviewed-on: http://openocd.zylin.com/2096
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agosrc/target: select the last created target as current
Paul Fertser [Thu, 15 May 2014 18:17:13 +0000 (22:17 +0400)]
src/target: select the last created target as current

Configuration commands assume the last created target is the one they
should be applied to. An example of this is sourcing an stm32f1.cfg
several times to access several microcontrollers on the same JTAG chain
where cortex_m reset_config should apply to the target that was just
created, not to the first one.

This fixes http://sourceforge.net/p/openocd/tickets/71/ .

Change-Id: I1ca41cc05fe5f36c4bc62dde4614da1405754fd8
Reported-by: Michael Eischer <mieischer@users.sf.net>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2142
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agojtag/drivers/stlink: allow to reconnect seamlessly after polling failure
Paul Fertser [Fri, 23 May 2014 11:53:59 +0000 (15:53 +0400)]
jtag/drivers/stlink: allow to reconnect seamlessly after polling failure

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>
10 years agotarget: reexamine after polling succeeds again
Paul Fertser [Fri, 23 May 2014 11:17:31 +0000 (15:17 +0400)]
target: reexamine after polling succeeds again

If polling was failing, it likely meant that either the target was
disconnected or rebooted. In the latter case it needs to be reexamined
to be properly configured for the debug session, so do it just in
case.

Reported-by: Tim Sander <tim@krieglstein.org>
Tested-by: Tim Sander <tim@krieglstein.org>
Change-Id: I5b067c18d9276d4e86cc59739f196ae7d0931622
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2151
Tested-by: jenkins
Reviewed-by: Tim Sander <tim@krieglstein.org>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>