]> git.sur5r.net Git - openocd/log
openocd
12 years agocfg: add STM32F3-DISCOVERY board support
Spencer Oliver [Wed, 26 Sep 2012 15:17:37 +0000 (16:17 +0100)]
cfg: add STM32F3-DISCOVERY board support

Change-Id: I4a02e0504fc04ffc1238d9bb77ec05c1f781e7e8
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/810
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
12 years agoflash: add stm32f3 rev 2 flash support
Spencer Oliver [Mon, 10 Sep 2012 10:16:20 +0000 (11:16 +0100)]
flash: add stm32f3 rev 2 flash support

Change-Id: Ibab5112f5f70a609136d01ebc50530a334640d03
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/809
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agocfg: fix incorrect str9-comstick reset config
Spencer Oliver [Wed, 26 Sep 2012 09:45:12 +0000 (10:45 +0100)]
cfg: fix incorrect str9-comstick reset config

The str9-comstick uses a direct srst connection rather than via any buffer.
As a result this fixes issues with the newer ftdi driver.

Change-Id: I0968e8459997a6a2b7bf0c46e89662cd57b4f496
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/842
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoftdi: incorrectly using output register for direction
Spencer Oliver [Wed, 26 Sep 2012 14:31:53 +0000 (15:31 +0100)]
ftdi: incorrectly using output register for direction

fix a simple copy/paste bug.

Change-Id: I5caaa4d16d30f26a453bd6a00c95261fd6e716c5
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/849
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
12 years agoftdi: correct ftdi_initialize error text
Spencer Oliver [Mon, 24 Sep 2012 11:58:32 +0000 (12:58 +0100)]
ftdi: correct ftdi_initialize error text

Change-Id: If230c0b5b3a18fd273106b743404079d0cbc9ddc
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/840
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoftdi: fix adapter_init rclk fallback
Spencer Oliver [Mon, 24 Sep 2012 11:29:47 +0000 (12:29 +0100)]
ftdi: fix adapter_init rclk fallback

adapter_init expects jtag_get_speed (via ftdi_khz) to return a valid
fallback speed if the adapter does not support rclk. The call was failing
and so was the rest of the adapter init.

The makes the new ftdi driver emulate the old ftdi driver.

Change-Id: Ic7fac7d201241eb181e98f1ba7111f159731f6e0
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/839
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agocfg: fix incorrect stm32f3 TAPID
Spencer Oliver [Thu, 27 Sep 2012 11:35:44 +0000 (12:35 +0100)]
cfg: fix incorrect stm32f3 TAPID

Change-Id: Id66d4e03a77c47a49086ee753bed01b3944064e1
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/855
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoFix: Error while reading from USB endpoint
Peter Horn [Sat, 29 Sep 2012 16:16:46 +0000 (18:16 +0200)]
Fix: Error while reading from USB endpoint

This patch fixes the bug reported here:

http://sourceforge.net/mailarchive/message.php?msg_id=28350157

When using Rlink under Linux, openocd exits with:

"Error: Read of endpoint 2 returned -75, expected 17"

The return value of -75 translates into EOVERFLOW. The cause is a wrong output buffer size argument passed to dtc_run_download().

Change-Id: I5d056705181ab6a6d4355524df06a0ea9c605961
Signed-off-by: Peter Horn <peter.horn@bluewin.ch>
Reviewed-on: http://openocd.zylin.com/862
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agojtag: remove libftdi enum-compare warning
Spencer Oliver [Wed, 22 Aug 2012 21:16:35 +0000 (22:16 +0100)]
jtag: remove libftdi enum-compare warning

See Trac #52 for details.

Change-Id: Idb509ead2b51bfcceeb00d0224a4d1c395b28a04
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/801
Tested-by: jenkins
Reviewed-by: Olivier Schonken <olivier.schonken@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoAdd extra Coresight component ROM identifiers for the Cortex-M4
Evan Hunter [Tue, 25 Sep 2012 06:41:49 +0000 (16:41 +1000)]
Add extra Coresight component ROM identifiers for the Cortex-M4

Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Change-Id: Iaf2d69cf10c341d3a516986677f69a4389b29b1a
Reviewed-on: http://openocd.zylin.com/841
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoAdded SPIFI flash driver, algorithms, and docs
George Harris [Fri, 17 Aug 2012 00:53:32 +0000 (17:53 -0700)]
Added SPIFI flash driver, algorithms, and docs

Added a flash driver designed to allow program/erase of
memory-mapped SPI flash chips for LPC43xx/LPC18xx family
micros. This driver includes three algorithms - erase,
write, and SPIFI peripheral initialization (to allow
memory-mapped access after a reset). The driver has been
added to the flash driver table (drivers.c), and the
OpenOCD documentation has been updated to include the flash
driver configuration command.

Change-Id: I79f4ff8f1f07de4e5f2fe4f8c23aeb903f868514
Signed-off-by: George Harris <george@luminairecoffee.com>
Reviewed-on: http://openocd.zylin.com/783
Tested-by: jenkins
Reviewed-by: Aurelien Jacobs <aurel@gnuage.org>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoSPI nor drivers refactor
George Harris [Fri, 17 Aug 2012 00:35:39 +0000 (17:35 -0700)]
SPI nor drivers refactor

Moved common SPI flash driver code (device table,
common commands) into flash/nor/spi.c and spi.h.
Updated flash/nor/stmsmi.c to reflect this refactor.

Change-Id: I141644b0af71d3835f29f06dd15b505a00e5b6ec
Signed-off-by: George Harris <george@luminairecoffee.com>
Reviewed-on: http://openocd.zylin.com/782
Tested-by: jenkins
Reviewed-by: Aurelien Jacobs <aurel@gnuage.org>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agodrivers: new jtag bitbang driver using sysfs gpio
Marc Reilly [Sun, 19 Aug 2012 23:46:07 +0000 (09:46 +1000)]
drivers: new jtag bitbang driver using sysfs gpio

This driver implements a bitbang jtag interface using gpio lines exported via
sysfs.

The aim of this driver implementation is to use system GPIOs but to avoid the
need for an additional kernel driver.

A config suitable for RaspberryPi is included.

Change-Id: Ib2acf720247a219768d1cbfeebd88057ed2d7b8b
Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Reviewed-on: http://openocd.zylin.com/762
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoRestore -dev suffix, archive NEWS file, add new blank NEWS file - start
Freddie Chopin [Fri, 7 Sep 2012 09:04:05 +0000 (11:04 +0200)]
Restore -dev suffix, archive NEWS file, add new blank NEWS file - start
new cycle for version 0.7.0.

Change-Id: I549bd815b62292ea4da6ed5c445c7c8a55521d9d
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoThe openocd-0.6.0 release. v0.6.0
Freddie Chopin [Fri, 7 Sep 2012 08:24:36 +0000 (10:24 +0200)]
The openocd-0.6.0 release.

Change-Id: I72eeabfc704d2a979ac0b4492771690631d2300f
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agostlink: issue error for stm32 option writing
Spencer Oliver [Thu, 6 Sep 2012 19:04:22 +0000 (20:04 +0100)]
stlink: issue error for stm32 option writing

The stlink interface currently does not support 16bit read/writes.
Until a fix is included we issue a error that this is unsupported.

Change-Id: I4552cf2bd3b29e90ecc905325b743c08e2b92d67
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/808
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: fix sam3 page read/write address computation error
Chuen Chou [Sun, 2 Sep 2012 07:45:15 +0000 (00:45 -0700)]
flash: fix sam3 page read/write address computation error

In at91sam3.c for Atmel SAM3 flash support, there are arithmetic errors in the functions sam3_page_read() and sam3_page_write().
Address locations are computed incorrectly due to an extra addition operation. This leads to memory locations being skipped during
flash writes and reads.

Smaller programs are written successfully into flash, with memory gaps, while larger programs of legitimate size fail because the
skipped memory is not utilized and therefore unavailable.

The changes address this condition, and have been tested with an Atmel SAM3X-EK evaluation board.

Change-Id: I9ea3b9ed0130b71cbc32b2294e31a6a2bc71b47a
Signed-off-by: Chuen Chou <zhouquan27@gmail.com>
Reviewed-on: http://openocd.zylin.com/806
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoconfigure: use consistent help text
Spencer Oliver [Thu, 30 Aug 2012 14:18:44 +0000 (15:18 +0100)]
configure: use consistent help text

Change-Id: I5e1d7c88e9310e6415f3663d7a657f516bd24660
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/803
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agodocs: add user mailing list and irc info
Spencer Oliver [Wed, 5 Sep 2012 14:35:13 +0000 (15:35 +0100)]
docs: add user mailing list and irc info

Change-Id: I7000b5ab2967f8dc4cea8983978fce824ea1f98e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/807
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agocortex_m: suggest using hardware srst if VECTRESET used
Spencer Oliver [Thu, 30 Aug 2012 11:53:34 +0000 (12:53 +0100)]
cortex_m: suggest using hardware srst if VECTRESET used

If the target does not support SYSRESETREQ we fall back to using VECTRESET.
This however does not reset the peripherals and we issue a warning to the user
to suggest using a reset-init script.

Also suggest that using hardware srst will give them the same functionality
as using SYSRESETREQ.

Change-Id: Ie1781c4b849fed66c52222e6539735537c879fb3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/802
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoRestore -dev tag.
Freddie Chopin [Wed, 29 Aug 2012 07:58:04 +0000 (09:58 +0200)]
Restore -dev tag.

Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoThe openocd-0.6.0-rc2 release candidate. v0.6.0-rc2
Freddie Chopin [Wed, 29 Aug 2012 06:59:33 +0000 (08:59 +0200)]
The openocd-0.6.0-rc2 release candidate.

Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoPic32mx: make row programming work with any offset
Salvador Arroyo [Sat, 25 Aug 2012 14:22:58 +0000 (16:22 +0200)]
Pic32mx: make row programming work with any offset

In function pic32mx_write_block() if the parameter
offset is not a multiple of row size the row offset
(offset % row_size) will be ignored by the flash
controller, shifting the code to the beginning of
the row.
Word programming gets it right.

Change-Id: I134913e3d533688f791bbcb0c6e8983524197f3c
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/796
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoserver: warn if user changes server port after init
Spencer Oliver [Tue, 21 Aug 2012 10:10:18 +0000 (11:10 +0100)]
server: warn if user changes server port after init

So the user can view the current port number these cmds were changed to COMMAND_ANY.
However this means that the user can also attempt to change the port number after init,
even though this is not supported. Issue a warning that this is not supported.

Change-Id: I3d20dcd81277e7d994240a8e314f27672ff760c4
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/788
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agostlink: fix typo
Spencer Oliver [Tue, 28 Aug 2012 16:03:05 +0000 (17:03 +0100)]
stlink: fix typo

Change-Id: I5fe7b695b00faef966e7621614bbd60b6e694a4f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/800
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agostlink: improve swd hardware reset
Spencer Oliver [Tue, 28 Aug 2012 16:02:18 +0000 (17:02 +0100)]
stlink: improve swd hardware reset

Treat SWD wait result as success, otherwise hardware reset will sometimes fail.

Change-Id: I0dbdbe9e75924fe0dde547a72883c60c3db7b15e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/799
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoftdi: fix overflow if last field of a scan is empty
Andreas Fritiofson [Thu, 23 Aug 2012 21:35:48 +0000 (23:35 +0200)]
ftdi: fix overflow if last field of a scan is empty

The last bit of a scan is clocked during TAP movement so it's necessary
for the last field to have at least one bit. Strip trailing empty fields
and make sure the TAP is not affected if there's nothing to scan. Clients
probably shouldn't add empty fields so add a debug message to be able to
track and fix them.

Change-Id: I27552568bc11146570b9b99ed8a1ae81b5fb2c50
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/794
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agompsse: check available buffer space even for discarded data scans
Andreas Fritiofson [Thu, 23 Aug 2012 21:28:10 +0000 (23:28 +0200)]
mpsse: check available buffer space even for discarded data scans

When there's no data to scan in or out, we still use the clock data out
command and fill the buffer with zeroes, so make sure the buffer is
checked for available space.

Change-Id: Ia6005c40c81f7fdb89379f1b5023fe383184d210
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/793
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoadapter: remove superfluous line breaks
Spencer Oliver [Tue, 28 Aug 2012 11:20:46 +0000 (12:20 +0100)]
adapter: remove superfluous line breaks

Change-Id: I8e68b9d6f571ef7715a2f4cad0aa78fe4e3b48e8
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/798
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoadapter: add 'adapter speed:' prefix to output
Spencer Oliver [Tue, 28 Aug 2012 11:19:26 +0000 (12:19 +0100)]
adapter: add 'adapter speed:' prefix to output

Currently only the adapter speed is printed, which can be rather misleading
when DEBUG_INFO is disabled, all the user sees is
6000 kHz
instead lets print
adapter speed: 6000 kHz

Change-Id: I8f02a63f47344457e3c3d0a6774157fa18206440
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/797
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoUpdate NEWS
Freddie Chopin [Fri, 17 Aug 2012 06:28:37 +0000 (08:28 +0200)]
Update NEWS

Added some missing items to NEWS file prior to final 0.6.0 release.

Change-Id: I69255c85fa8f4b6f06eae7c56f78072e3ec2d6f8
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/784
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoAdd JTAG-lock-pick Tiny 2 config files
Freddie Chopin [Mon, 20 Aug 2012 19:00:43 +0000 (21:00 +0200)]
Add JTAG-lock-pick Tiny 2 config files

DISTORTEC's JTAG-lock-pick Tiny 2 is a new interface using FT232HL chip
and layout similar to KT-LINK.

Change-Id: I2831b169cd448ca70397f2dd86c5b749dda3dabf
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/787
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoAdd another scripts search path for Windows builds
Freddie Chopin [Fri, 17 Aug 2012 09:54:24 +0000 (11:54 +0200)]
Add another scripts search path for Windows builds

Add single "scripts" folder to search path for Windows OpenOCD builds
that don't use cygwin
bin/openocd.exe
scripts/interface/dummy.cfg
scripts/target/at91eb40a.cfg

Do some refactoring of current code (thx to Andreas).

Change-Id: Idbb08d1368b06f25da44f4f9ab1511db992b1724
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/785
Tested-by: jenkins
12 years agokinetis: bugfix in kinetis_write() fallback path
Andreas Fritiofson [Wed, 18 Jul 2012 22:02:46 +0000 (00:02 +0200)]
kinetis: bugfix in kinetis_write() fallback path

Offset calculation into buffer was wrong and code would read outside buffer
if count was not a multiple of four.

Change-Id: Ied625b10221423d5a5f25d27ce1edd8c2c3eca8a
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/749
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agokinetis: ensure flash writes are not truncated
Christopher Kilgour [Sat, 7 Jul 2012 23:47:06 +0000 (16:47 -0700)]
kinetis: ensure flash writes are not truncated

The number if longwords or "sections" (Freescale term) written for a Kinetis
flash write (4, 8, or 16 bytes depending on the part density/granularity) are
now rounded up to ensure there are no truncations when the desired write is
not a multiple of the minimum write size.

Change-Id: I8db40a8769d8ac5393a46cbf4e5ff0df82faf916
Signed-off-by: Christopher Kilgour <techie@whiterocker.com>
Reviewed-on: http://openocd.zylin.com/738
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agojtag: fix clang ulink memory leaks
Spencer Oliver [Fri, 24 Aug 2012 20:33:35 +0000 (21:33 +0100)]
jtag: fix clang ulink memory leaks

Memory leaks discovered by clang 3.1

Change-Id: I8a784ba9726deac508424eddb27e9c8409e2773f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/795
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoPatch: Make pic32mx unlock work at higher scan frequencies
Salvador Arroyo [Wed, 22 Aug 2012 18:34:02 +0000 (20:34 +0200)]
Patch: Make pic32mx unlock work at higher scan frequencies

For example in a pic32mx220, pic32mx unlock don't work
if adapter_khz is set to 5000 or more.

A short delay after asserting reset fix the problem.

Change-Id: I62e493edfcea585c36c8de77a969cebac7227b96
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/790
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agocfg: update for target's that support cortex_m AIRCR SYSRESETREQ
Spencer Oliver [Thu, 23 Aug 2012 20:03:29 +0000 (21:03 +0100)]
cfg: update for target's that support cortex_m AIRCR SYSRESETREQ

If the target supports SYSRESETREQ make sure we use that as the default
if srst is not fitted/configured.

Change-Id: I24c907493134506320e69c1218702930629c1cdc
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/792
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agostlink: stlink_interface_init_target use hex prefix
Spencer Oliver [Thu, 23 Aug 2012 14:23:54 +0000 (15:23 +0100)]
stlink: stlink_interface_init_target use hex prefix

Change-Id: I782da74687bcf111c1f04c53b2c1120d6a034441
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/791
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoarm7_9: Fix broken halfword/byte memory reads
Andreas Fritiofson [Wed, 22 Aug 2012 17:42:02 +0000 (19:42 +0200)]
arm7_9: Fix broken halfword/byte memory reads

Always scan out all bits, but make sure only the allowed number of bytes
end up in the caller-provided buffer. Discard the rest by adding another
scan field when size < 4.

Rewrite the endianness callback to avoid reading outside allocated memory.
Make it directly usable as a callback without the need for a wrapper. Move
the shared callback to a more suitable home in arm7_9_common.

This fixes the regressions introduced in commits
991ed5a2b657e660f744eefddb084724e52938ea
cb90d32e386a7489d31136997209c61e9559ff5e
and
c3074f377c1da33ca8ba8493826e1b52351eebc6

Change-Id: Ia8bde8c5a9844e89a1d6c0bc8534cd26f02f8d11
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/789
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoSevere bug in Pracc code
Salvador Arroyo [Sun, 5 Aug 2012 09:18:27 +0000 (11:18 +0200)]
Severe bug in Pracc code

The function  wait_for_pracc_rw() fails if Pracc bit is 0.
The variable ejtag_ctrl is loaded with the content of the
control register in the first scan.
In the second scan Pracc bit is scanned out as 0, letting
the proccesor go. The result is unpredictable.

All the strange data corruption when scanning at certain
frequencies, or the strange delays needed when entering
or leaving fasdata area are retated to this bug.

Now the code works at any scan frequency, tested up to 15000Khz
and indepently of processor speed, tested at 31.25Khz and 4/8Mhz.

Change-Id: Iedfd81d06d6af4bc738a521f720e42323025b268
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/769
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agotarget: remove unused working area 'user' field
Spencer Oliver [Thu, 16 Aug 2012 10:05:47 +0000 (11:05 +0100)]
target: remove unused working area 'user' field

working_area::user has never been used so lets remove it.

Change-Id: I1200311b34248549c1fe30c9f675e6129b7bebee
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/781
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agocfi: fix type-punning warnings in cfi_spansion_write_block
Andreas Fritiofson [Mon, 13 Aug 2012 22:12:07 +0000 (00:12 +0200)]
cfi: fix type-punning warnings in cfi_spansion_write_block

Retest the condition when needed, instead of abusing the common_magic
field as a flag. There are only two options here. Either it's an armv7m or
it's another arm. is_arm(...) will return true even for armv7m, so it's
imperative to check in the right order.

Change-Id: Ic227f19f7babf1b0b0fe075f9a3abc4eabc7d5f1
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/779
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agobuild: fix clang warnings
Martin Nowak [Wed, 1 Aug 2012 20:35:04 +0000 (22:35 +0200)]
build: fix clang warnings

Change-Id: I3c6a63a18034535f0a8c2c62ba8a708f09d7839b
Signed-off-by: Martin Nowak <dawg@dawgfoto.de>
Reviewed-on: http://openocd.zylin.com/765
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agotarget: catch dap_lookup read error
Spencer Oliver [Mon, 13 Aug 2012 11:32:27 +0000 (12:32 +0100)]
target: catch dap_lookup read error

Issue found by clang-3.1

Change-Id: I2e922ec83117e75db5bec1e82edaa75a9e6e7464
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/778
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: remove lpc2000 clang warnings
Spencer Oliver [Mon, 13 Aug 2012 10:35:20 +0000 (11:35 +0100)]
flash: remove lpc2000 clang warnings

By Initialising the param_table we remove the clang warning's.
We are also make sure we are not passing any rogue values to lpc2000_iap_call.

Change-Id: Idb3b0077d1dae5f03dedab1d46d01140fe9ffb10
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/777
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agotcl: fix potential memory leaks
Spencer Oliver [Mon, 13 Aug 2012 10:31:54 +0000 (11:31 +0100)]
tcl: fix potential memory leaks

Reorder to allocate all memory after COMMAND_PARSE_NUMBER call.
This removes a clang warning about un-released memory

Change-Id: I8dbeb664a6467077157015bd879bc0aefc5e8614
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/776
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agobuild: fix memory leaks
Spencer Oliver [Mon, 13 Aug 2012 10:22:35 +0000 (11:22 +0100)]
build: fix memory leaks

Fix the memory leaks found by clang-3.1

Change-Id: Iaae68627ef599c324c9c9ee5737c22e92512862d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/775
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: fix FC_FLEX_RAM class code path
Spencer Oliver [Fri, 10 Aug 2012 15:17:24 +0000 (16:17 +0100)]
flash: fix FC_FLEX_RAM class code path

If the flash class was defined as FC_FLEX_RAM then this would always drop
through to the default handler.

This bug was found by clang, so untested.

Change-Id: I2d9fe6415dd216728a145519400f7b9ef1bd3c3a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/773
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
12 years agohelper: command.c cleanup
Spencer Oliver [Fri, 10 Aug 2012 14:56:29 +0000 (15:56 +0100)]
helper: command.c cleanup

Change-Id: I66643960e38625e843b5f54d1c072e4eee78284d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/772
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoftdi: Olimex ARM-USB-TINY validated
Aurelien Jacobs [Tue, 7 Aug 2012 08:42:41 +0000 (10:42 +0200)]
ftdi: Olimex ARM-USB-TINY validated

Flashing a CFI flash and debugging with gdb work fine.

Change-Id: Ib2578ee6f41c1003968198439033d00d805122f7
Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
Reviewed-on: http://openocd.zylin.com/770
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoconfigure.ac: Fix misspelled variable
Andreas Fritiofson [Sat, 11 Aug 2012 19:43:06 +0000 (21:43 +0200)]
configure.ac: Fix misspelled variable

Nothing checks it against 0, so it hasn't caused any problems.

Change-Id: I5e349299c37fb72bab811d78992f6de3731a986a
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/774
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agocfg: remove duplicate Olimex ARM-USB-OCD config
Spencer Oliver [Tue, 14 Aug 2012 13:37:35 +0000 (14:37 +0100)]
cfg: remove duplicate Olimex ARM-USB-OCD config

This file is already included as olimex-arm-usb-ocd.cfg.

Change-Id: I0e66977c58e74ac93a0dc3a0c88a5e5af4992f8b
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/780
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agocfg: added new openocd-usb highspeed adapter
Andrew Karpow [Thu, 9 Aug 2012 22:05:06 +0000 (00:05 +0200)]
cfg: added new openocd-usb highspeed adapter

The embedded projects shop released a new highspeed version of
the openocd-usb adapter. These configuration files adds support
for it.

Change-Id: I9b23d7889f998712b9041af101e3f0b9aba85b28
Signed-off-by: Andrew Karpow <notandyk@gmail.com>
Reviewed-on: http://openocd.zylin.com/771
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoRestore "-dev" tag.
Freddie Chopin [Thu, 2 Aug 2012 16:01:20 +0000 (18:01 +0200)]
Restore "-dev" tag.

Change-Id: Ibb7669ea73872d75a5c2f32f2264e57b1d0f20c7
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoThe openocd-0.6.0-rc1 release candidate. v0.6.0-rc1
Freddie Chopin [Thu, 2 Aug 2012 15:18:27 +0000 (17:18 +0200)]
The openocd-0.6.0-rc1 release candidate.

Change-Id: Idd85159050a39c2136ee8a31f939a2b3e35cff1b
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agotarget: add valid smp target check
Spencer Oliver [Thu, 2 Aug 2012 09:18:33 +0000 (10:18 +0100)]
target: add valid smp target check

Check that the target is valid before calling any target functions.

Change-Id: I538fccc79d5ec89976e14beab02cb20490b299bb
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/766
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoUpdate link and instructions about ssh keys in HACKING
Freddie Chopin [Thu, 2 Aug 2012 12:34:58 +0000 (14:34 +0200)]
Update link and instructions about ssh keys in HACKING

Gitweb changed their instructions, info about ssh keys is now on
separate page for all platforms (selector at top of the page).

Change-Id: I3eab5dfae06cfb73f4a76718f92518454021e557
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/768
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoAdd missing files (header and .txt) for release.
Freddie Chopin [Thu, 2 Aug 2012 12:14:47 +0000 (14:14 +0200)]
Add missing files (header and .txt) for release.

make distcheck is used to make packages with OpenOCD release, this
command uses information from Makefile.am files to know which files
should be included in the package and which can be left only in
repository. This patch makes a few headers from recent JTAG drivers
and one txt file with info about target tcl config files included in
released packages.

Change-Id: I91202290633a30f53624a8c7d9a0ebf72c40772b
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/767
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoarm946e: add icache/dcache manipulation commands.
Alexander Osipenko [Fri, 8 Jun 2012 19:24:13 +0000 (23:24 +0400)]
arm946e: add icache/dcache manipulation commands.

Provide cache operations coherent with internal target state.
Functions similar to xscale target.

Change-Id: Ic6b9a894154f6e4f5672b5d7f5035c9774ee9499
Signed-off-by: Alexander Osipenko <sipych@gmail.com>
Reviewed-on: http://openocd.zylin.com/695
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoarm946e: cp15 command returns value to the script
Alexander Osipenko [Fri, 8 Jun 2012 19:21:31 +0000 (23:21 +0400)]
arm946e: cp15 command returns value to the script

Not just print it.

This enables scripts to analyze valuable config options of
arm946e-s cores, do internal BIST memory tests and more.

Be careful to flush caches before disabling it.
Do not forget that BIST test overwrites  memory.

 - cp15 rewritten from COMMAND_HANDLER to jim_handler.

Change-Id: I734da0be6db0a3127c2daa94ed75efef94da8ceb
Signed-off-by: Alexander Osipenko <sipych@gmail.com>
Reviewed-on: http://openocd.zylin.com/694
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoarm946e: cleanup C0.C cache type reg access
Alexander Osipenko [Fri, 8 Jun 2012 19:18:04 +0000 (23:18 +0400)]
arm946e: cleanup C0.C cache type reg access

Cache type register C0.C is read-only, and display
hard core configuration information.
This information is unlikely be changed in runtime.

 - removed C0.C access when result is not used in
   arm946e_invalidate_dcache()
 - access C0.C only once per target, store result
   in cp15_cache_info field of target structure
 - fix cache index count calculation

Change-Id: I12bc4c967fdf07f54d755f2f2f42406c0ababc1a
Signed-off-by: Alexander Osipenko <sipych@gmail.com>
Reviewed-on: http://openocd.zylin.com/693
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoarm946e: don't use global variables for context
Alexander Osipenko [Mon, 30 Jul 2012 23:50:09 +0000 (03:50 +0400)]
arm946e: don't use global variables for context

Global variables 'dc' 'ic' had been used in the code
to keep target's state of D-cache and I-cache
on debug entry.

This may lead to incorrect operation in configurations
with multiple cores and unequal cache states.

Fix: move cache state to the appropriate bits of the
'cp15_control_reg' field (already present but unused).
Vaule of cp15 control register stored here on
arm946e_post_debug_entry(), and analyzed later
in arm946e_write_memory().

Change-Id: I71ef82be00c21d6fffb3726cec4974d1ece70dfe
Signed-off-by: Alexander Osipenko <sipych@gmail.com>
Reviewed-on: http://openocd.zylin.com/692
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoadded target configs for the lpc17xx devices
Vandra Akos [Sun, 27 May 2012 10:50:04 +0000 (12:50 +0200)]
added target configs for the lpc17xx devices

lpc1751, lpc1752, lpc1754, lpc1756, lpc1758, lpc1759
lpc1763, lpc1764, lpc1765, lpc1766, lpc1767, lpc1768, lpc1769

Change-Id: I740b66930cd379c9390f3c1031cdbada747a6ce4
Signed-off-by: Vandra Akos <axos88@gmail.com>
Reviewed-on: http://openocd.zylin.com/676
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
12 years agocfg: Add Hitex LPC1768-Stick using ftdi driver
Joerg Fischer [Wed, 25 Jul 2012 08:10:37 +0000 (10:10 +0200)]
cfg: Add Hitex LPC1768-Stick using ftdi driver

Add cfg files for Hitex LPC1768 Stick
Website: http://www.hitex.com/?id=1602

This board has a FTDI2232D as JTAG interface, using the
same layout as the Hitex STM32-PerformanceStick but with
different USB PID.

Main MCU is a LPC1768 from NXP.

The interface config uses the ftdi driver instead of ft2232.
The corresponding ft2232 layout would be "stm32stick".

Change-Id: I1fd15588c5af35f7d51777d1ad958cc1dc72c6f7
Signed-off-by: Joerg Fischer <turboj@gmx.de>
Reviewed-on: http://openocd.zylin.com/763
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: stm32f1x: Pad odd byte writes early to avoid 16-bit writes
Andreas Fritiofson [Fri, 20 Jul 2012 12:44:22 +0000 (14:44 +0200)]
flash: stm32f1x: Pad odd byte writes early to avoid 16-bit writes

For odd byte counts, stm32x_write() pads the last byte and writes it using
a discrete 16-bit access. The stlink debugger can't issue 16-bit writes so
it fails for odd byte writes.

This patch changes stm32x_write() to pad odd byte writes into a new buffer
and use the normal code path with a single block write. The fallback path,
when working area cannot be allocated, has to use 16-bit writes though
which means that sufficient working area is required for stlink and odd
byte writes.

Change-Id: I4c5dc456300b6e1056f76b0095be8aceee3e954f
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/756
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agocfg: Add config file variants using the ftdi driver instead of ft2232
Freddie Chopin [Thu, 19 Jul 2012 07:32:04 +0000 (09:32 +0200)]
cfg: Add config file variants using the ftdi driver instead of ft2232

part 4 - files that are currently untested

Change-Id: Ic4a08fdefc99e7a9d50885c888c3fca60ffa39bd
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/750
Tested-by: jenkins
12 years agocfg: Add config file variants using the ftdi driver instead of ft2232
Freddie Chopin [Fri, 20 Jul 2012 08:19:51 +0000 (10:19 +0200)]
cfg: Add config file variants using the ftdi driver instead of ft2232

part 3 - files that are currently untested but verified with schematics

Change-Id: Ia00c3b6437bffcfa0d178e779926ad9309e289fe
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/755
Tested-by: jenkins
12 years agocfg: Add config file variants using the ftdi driver instead of ft2232
Freddie Chopin [Fri, 20 Jul 2012 07:37:10 +0000 (09:37 +0200)]
cfg: Add config file variants using the ftdi driver instead of ft2232

part 2 - files that are currently untested but assumed to work, as other configs using the same layout work
fine

Change-Id: Ifaa1904227ebdc394362ccaf3ad3c5384a716657
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/754
Tested-by: jenkins
12 years agocfg: Add config file variants using the ftdi driver instead of ft2232
Freddie Chopin [Thu, 19 Jul 2012 07:30:27 +0000 (09:30 +0200)]
cfg: Add config file variants using the ftdi driver instead of ft2232

part 1 - files that were tested an verified as working fine

Change-Id: If5986853a1cf118a9eb3b4c13b036d0f71c39624
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/534
Tested-by: jenkins
12 years agotelnet: cleanup comments
Spencer Oliver [Thu, 19 Jul 2012 14:11:45 +0000 (15:11 +0100)]
telnet: cleanup comments

seems comments were mangled during the last cleanup.

Change-Id: If759f62032705c7baffd3973e9717eb7e8a5d17c
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/752
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agodoc: add missing ulink v1 to supported interfaces
Spencer Oliver [Mon, 23 Jul 2012 13:54:22 +0000 (14:54 +0100)]
doc: add missing ulink v1 to supported interfaces

Change-Id: Ic497a3f9076ec1799ca715a99bc2e634bd1af40d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/761
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoBugfixes in mips32_pracc.c
Salvador Arroyo [Thu, 7 Jun 2012 14:44:34 +0000 (16:44 +0200)]
Bugfixes in mips32_pracc.c

When testing a pic32mx220f032b with different values
for adapter_khz and cpu clocks i was getting a lot of
corrupted data from the chip. From time to time
openocd fails with segmentation faults or is aborted
due to memory corruption.

Change-Id: I134743f75c477b3d55dc74ae4474598e153b4a4a
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/690
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoSpeed up mips_m4k_write_memory()
Salvador [Wed, 9 May 2012 15:21:19 +0000 (17:21 +0200)]
Speed up mips_m4k_write_memory()

Do not call mips32_cp0_read() if not needed.
This will speed up execution of mips_m4k_write_memory()
by near 2x, with parameter count = 1.

Change-Id: I7829a7802b6475bc6d4ac3f0632d8d239d1072da
Signed-off-by: Salvador <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/624
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: reduce code duplication in stm32 flash probe
Andreas Fritiofson [Mon, 16 Jul 2012 22:43:46 +0000 (00:43 +0200)]
flash: reduce code duplication in stm32 flash probe

Remove a lot of the repetitive code in stm32f1x flash probe by converting
the large if-selector to a switch, moving the common checks outside it and
concentrating the failure handling to a single point.

Do the same with stm32f2x and stm32lx for consistency.

Change-Id: Ic0ecfb1533c49f5d2108cda5fd20c8372d7c71ef
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/746
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: fix stm32 flash driver typo's
Spencer Oliver [Thu, 12 Jul 2012 11:30:31 +0000 (12:30 +0100)]
flash: fix stm32 flash driver typo's

Change-Id: I37f3fee063d7f8729e057dcfe8904651790439e6
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/745
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: handle zero when reading stm32 flash size reg
Spencer Oliver [Thu, 12 Jul 2012 11:29:38 +0000 (12:29 +0100)]
flash: handle zero when reading stm32 flash size reg

Some variants read 0 for the flash size register, rather than
failing lets assume we have max flash fitted.

Change-Id: Ie1fb4e73606f49268a6fd5921c3aef75bc4790d3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/744
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: stm32l handle flash size read failure
Spencer Oliver [Thu, 12 Jul 2012 11:25:10 +0000 (12:25 +0100)]
flash: stm32l handle flash size read failure

Rather than failing if the flash size reg cannot be read lets assume
we have the max flash size fitted.

It is quite common on early ST silicon to not correct support this register.

Change-Id: Ife058d60ae0027faad2c929ebd5b7fe2ef27234d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/743
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: add stm32l Revision X support
Spencer Oliver [Thu, 12 Jul 2012 11:15:26 +0000 (12:15 +0100)]
flash: add stm32l Revision X support

Revision X is not mentioned in the latest RM0038 rev5, however it has been
confirmed correct by ST using ST-LINK Utilty.

Change-Id: I65210e512ea25818a1d0d3b223502ebd7535b29d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/742
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agolpc1768.cfg abstracted and moved to lpc17xx.cfg
Vandra Akos [Sun, 27 May 2012 10:36:55 +0000 (12:36 +0200)]
lpc1768.cfg abstracted and moved to lpc17xx.cfg

- Moved variant-independent code to lpc17xx.cfg, which will be included from
lpc17??.cfg files automatically.
- lpc1768.cfg filled with variant-dependent code.

Change-Id: I7dabe6ed7da7be640ed38c13aaaa096b8796d9a0
Signed-off-by: Vandra Akos <axos88@gmail.com>
Reviewed-on: http://openocd.zylin.com/675
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agocfg: remove deprecated stm32 target configs
Andreas Fritiofson [Wed, 11 Jul 2012 19:48:09 +0000 (21:48 +0200)]
cfg: remove deprecated stm32 target configs

These were deprecated in commit 69ac20a.

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Change-Id: I047872f8cd61b42aaca6588ab75566219e4a3f5d
Reviewed-on: http://openocd.zylin.com/741
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoAdd support for FT232H chips
Freddie Chopin [Thu, 5 Jul 2012 10:31:11 +0000 (12:31 +0200)]
Add support for FT232H chips

FT232H chips are new highspeed devices from FTDI. Basically these are a half of FT2232H (or a quarter of FT4232H), so only one channel which can be used as OpenOCD
interface. The chips are supported by libftdi 0.20 or later and by ftd2xx 2.08.12 or later.

Change-Id: Ic9a2c279167c3419a24f0d6befacbb83c4ffeb25
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/736
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Salvador Arroyo <sarroyofdez@yahoo.es>
12 years agoflash: don't write to FLASH_CR in stm32x_write_block
Andreas Fritiofson [Wed, 11 Jul 2012 14:23:48 +0000 (16:23 +0200)]
flash: don't write to FLASH_CR in stm32x_write_block

It's unnecessary and prevents reusing this function to fix
option byte writes.

Also try to disable flash writing after an error.

Change-Id: Ib5a7b768a1523e6b8da1555126fef4c1e60ab083
Signed-off-by: Szymon Modzelewski <szmodzelewski@gmail.com>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/479
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoTest the incoming debug_level, rather than the current.
Alan Bowman [Wed, 25 Jul 2012 18:58:11 +0000 (19:58 +0100)]
Test the incoming debug_level, rather than the current.

The existing code tests the current debug_level for validity, allowing
the user to set it too high and never change it after that.  The new
behaviour is to test the debug_level that the user has requested.

Change-Id: I85726a2e606c8d137e9b1cfe76fee865084844b1
Signed-off-by: Alan Bowman <alan.michael.bowman@gmail.com>
Reviewed-on: http://openocd.zylin.com/764
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
12 years agoRevert "When calling openocd from a shell like this:"
Alex Austin [Fri, 20 Jul 2012 12:58:14 +0000 (12:58 +0000)]
Revert "When calling openocd from a shell like this:"

This reverts commit e8641695c634109ebf5f1149923971770da1d28a

Original premise was wrong. Proper command is "shutdown", not "exit".

Change-Id: I07f5fe0dda9c24abe53628da986bfda0e406bb4a
Signed-off-by: Alex Austin <alex.austin@spectrumdsi.com>
Reviewed-on: http://openocd.zylin.com/757
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoboard: Add TI AM335x Evaluation Module
Tom Rini [Thu, 19 Jul 2012 18:29:54 +0000 (11:29 -0700)]
board: Add TI AM335x Evaluation Module

This patch adds the TI AM335x Evaluation Module (ti_am335xevm) board
configuration file.

Change-Id: Id3529e54972f8acd8c790ad55c8d0f4058a1a1f6
Signed-off-by: Tom Rini <trini@ti.com>
Reviewed-on: http://openocd.zylin.com/753
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoAdd config file for Lattice LC4032ZE CPLD (ispMACH 4000ZE family)
Freddie Chopin [Tue, 17 Jul 2012 08:03:32 +0000 (10:03 +0200)]
Add config file for Lattice LC4032ZE CPLD (ispMACH 4000ZE family)

Change-Id: Iefec12b30ff737317c454b472200fd7e7edde619
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/748
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoMPSSE: Add FT232H to supported chips
Salvador Arroyo [Sun, 27 May 2012 16:03:07 +0000 (18:03 +0200)]
MPSSE: Add FT232H to supported chips

Change-Id: I1ce1db7eb87a7cdeafc1f8b8b34594f6fa3bf1f8
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/677
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoAdd FTDI JTAG driver using MPSSE layer
Andreas Fritiofson [Sun, 29 Jan 2012 23:45:18 +0000 (00:45 +0100)]
Add FTDI JTAG driver using MPSSE layer

Based on ft2232.c but uses the MPSSE layer for low-level access, greatly
simplifying the JTAG logic. Remove all libftdi/FTD2XX code and all layout
specific code. Layout specifications are instead handled in Tcl.

Use a signal abstraction to enable Tcl configuration files to define
outputs for one or several FTDI GPIO. These outputs can then be
controlled using the ftdi_set_signal command. Special signal names are
reserved for nTRST, nSRST and LED (for blink) so that they, if defined,
will be used for their customary purpose.

Depending on the type of buffer attached to the FTDI GPIO, the outputs
have to be controlled differently. In order to support tristateable
signals such as nSRST, both a data GPIO and an output-enable GPIO can be
specified for each signal. The following output buffer configurations are
supported:

* Push-pull with one FTDI output as (non-)inverted data line
* Open drain with one FTDI output as (non-)inverted output-enable
* Tristate with one FTDI output as (non-)inverted data line and another
  FTDI output as (non-)inverted output-enable
* Unbuffered, using the FTDI GPIO as a tristate output directly by
  switching data and direction as necessary

The data and output-enables are specified as 16-bit bitmasks,
corresponding to the concatenation of the high and low FTDI GPIO
registers. To specify an unbuffered output, use the same bitmask
for both data and output-enable.

The adapter configuration file must also specify default values for the
FTDI data and direction GPIO registers, and the channel being used (if
different from 0).

Change-Id: I287a41d4c696cf5fc74eb10d5e63578b0dc7f826
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/452
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoAdd MPSSE communications layer for FTDI chips
Andreas Fritiofson [Sun, 29 Jan 2012 23:16:41 +0000 (00:16 +0100)]
Add MPSSE communications layer for FTDI chips

This is a higher-level libftdi replacement for use when implementing
protocol drivers for FT2232, FT2232H or FT4232H. It takes care of device
open/close and, unlike libftdi, also MPSSE command abstraction, command
queueing, buffer handling and return data parsing.

The FTDI device is accessed through libusb-1.0 in asynchronous mode.

Change-Id: I051adb574dcc39f8ca9cd7f6dbe6ae4aeea5f4c8
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/451
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agotarget: Cortex-M use consistent arm dap access
Spencer Oliver [Wed, 27 Jun 2012 22:49:37 +0000 (23:49 +0100)]
target: Cortex-M use consistent arm dap access

Purely cosmetic but use the same style as Cortex-A target, this makes
searching refs easier.

Change-Id: I732ad9701f561e2312c5d191f5aaffd3a2f2393d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/731
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
12 years agostlink: fix arm semihosting support
Spencer Oliver [Tue, 3 Jul 2012 14:50:24 +0000 (15:50 +0100)]
stlink: fix arm semihosting support

Add missing arm cmd handlers that enable semi hosting support to work as
expected.

Change-Id: I063d82c48b82b4f6aed4efc4b08ea752d78e9047
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/734
Tested-by: jenkins
Reviewed-by: Alan Bowman <alan.michael.bowman@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
12 years agoflash: add stm32f3x support
Spencer Oliver [Wed, 4 Jul 2012 20:19:17 +0000 (21:19 +0100)]
flash: add stm32f3x support

add support for the new stm32f3x family from stmicro:
http://www.st.com/stm32f3

Change-Id: Icd1db95bb2767d9c0ecef24deefa92b4fdaa4f14
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/735
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
12 years agojtag: fix opendous reset command
Stefan Mahr [Wed, 27 Jun 2012 22:53:54 +0000 (00:53 +0200)]
jtag: fix opendous reset command

This cast to uint16_t is not (host) endianess save.
Depending on compiler usb_out_buffer[1] may be undefined.

Change-Id: If686e5d5da39541329c340bbdef472ee7ab0281c
Signed-off-by: Stefan Mahr <stefan.mahr@sphairon.com>
Reviewed-on: http://openocd.zylin.com/732
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agotarget: detect correct Cortex-M tar auto increment size
Spencer Oliver [Wed, 27 Jun 2012 22:25:07 +0000 (23:25 +0100)]
target: detect correct Cortex-M tar auto increment size

The ADIv5 spec guarentees that tar_autoincr_block will be 10bits.
Make this the default for Cortex-M family until we detect a Cortex-M3/M4,
we then change autoincrement to 12bits.

Change-Id: Ie8c89134aa036879bdd8a3c312cee9715dbc6913
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/730
Tested-by: jenkins
Reviewed-by: simon qian <simonqian.openocd@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agojtag: remove redundant id check
Spencer Oliver [Tue, 26 Jun 2012 12:12:14 +0000 (13:12 +0100)]
jtag: remove redundant id check

commit 5b0a1315948252ddde03fc74763ef8300c5f329c removed the need to check
for 0xffffffff.

Change-Id: Ib4d99bf1797ccd868ec15631dbc16079571a8dd6
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/728
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoWhen calling openocd from a shell like this:
Stian Skjelsad [Sat, 18 Feb 2012 15:10:19 +0000 (16:10 +0100)]
When calling openocd from a shell like this:

openocd -f board/sheevaplug.cfg -c init -c exit

the calling shell will believe that openocd exited with an error due to exitval will be non-zero

This is not tested against incomming telnet

Change-Id: I63d15715a7b46f39a7de261a45039f8c3cad7a98
Signed-off-by: Stian Skjelstad <stian@nixia.no>
Reviewed-on: http://openocd.zylin.com/470
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Bill Traynor <wmat@alphatroop.com>
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agotarget.c, jim_target_md using command_print_sameline
Vandra Akos [Fri, 25 May 2012 01:02:55 +0000 (03:02 +0200)]
target.c, jim_target_md using command_print_sameline

jim_target_md is supposed to print out results with command_print in
hexdump format. It was using command_print which appends a newline character
aftre every invocation. Using command_print_sameline instead

Change-Id: Iaff03021acc38d54b5a082cb58b82aa4449c0715
Signed-off-by: Vandra Akos <axos88@gmail.com>
Reviewed-on: http://openocd.zylin.com/669
Tested-by: jenkins
Reviewed-by: Alexander Osipenko <sipych@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agotarget/target.c, jim_target_md refractored
Vandra Akos [Thu, 24 May 2012 13:17:34 +0000 (15:17 +0200)]
target/target.c, jim_target_md refractored

 - Added a few lines of comment before the function explaining the usage and the
output generated by the command
 - Added a few lines of comment in the body explaining what is happening to improve
code readability
 - Renamed a few variables to improve readability:
    * a -> addr
    * b -> dwidth
    * c -> count
 - Added a new variable, named byte to contain the number of bytes to read, instead
of overwriting the count parameter, to avoid confusion between the two values.

Change-Id: I5828ec0f5aadaa39becec7b84f198756bb2c3d41
Signed-off-by: Vandra Akos <axos88@gmail.com>
Reviewed-on: http://openocd.zylin.com/665
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoAdd a bit-level transfer queue
Andreas Fritiofson [Sun, 12 Feb 2012 21:29:50 +0000 (22:29 +0100)]
Add a bit-level transfer queue

Interface drivers regularly need to keep track of where each part of a long
read buffer should be copied, once that data arrives. Both source and
destination are often at an arbitrary bit offset.

This queued bit-level copy can help with that, by allowing the driver to
perform postponed reads from the receive buffer already when building the
transmit buffer, and have those reads executed at a later time when data is
available.

For simplicity, it uses the linked list implementation list.h imported from
the Linux kernel.

Change-Id: I06862a0a6f057cbbcacfb021f17a795195faded2
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/450
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Peter Stuge <peter@stuge.se>