openocd.git
11 years agortos: Rewrite rtos_create() for readability
Peter Stuge [Thu, 4 Oct 2012 12:31:29 +0000 (14:31 +0200)]
rtos: Rewrite rtos_create() for readability

The new code is almost functionally equivalent to the old; besides
error handling the only difference is that the code is now readable.

Many thanks to Matthias Blaicher for pointing out an iteration error
in the rtos_try_next() change, which also affected this change.

Change-Id: If38b87439e9de2303b220b3a7e3200ceaa8391da
Signed-off-by: Peter Stuge <peter@stuge.se>
Reviewed-on: http://openocd.zylin.com/893
Tested-by: jenkins
Reviewed-by: Matthias Blaicher <matthias@blaicher.com>
11 years agoModified Sector Erase for AT91SAM4S
Olivier Schonken [Wed, 12 Sep 2012 19:56:50 +0000 (21:56 +0200)]
Modified Sector Erase for AT91SAM4S

In FLASHD_ErasePages AT91C_EFC_FCMD_EPA is used to erase sectors.
According to the datasheet FARG[15:2] defines the page from which
the erase will start.This page must be modulo 4, 8, 16 or 32
according to the number of pages to erase. FARG[1:0] defines the
number of pages to be erased. Previously (firstpage << 2) was used
to conform to this, seems it should not be shifted... Changed it
to (firstPage) | erasePages.

Change-Id: I791cc7fc4faf056623ad5a6c7e860315306098a1
Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
Reviewed-on: http://openocd.zylin.com/830
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agobuild: fix broken ftd2xx bus blaster
Spencer Oliver [Thu, 4 Oct 2012 13:01:14 +0000 (14:01 +0100)]
build: fix broken ftd2xx bus blaster

If configure is executed without --enable-ft2232_ftd2xx then the bus blaster
or presto will fail to build with unresolved external ftd2xx_status_string.

Make sure we run the ftd2xx build test if --enable-usb_blaster_ftd2xx is enabled.

Change-Id: I09d270d6fcd083d77f6785b8969d9acb3dfef11d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/892
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
11 years agolpc1768-stick: avoid driving srst high at startup
Spencer Oliver [Tue, 2 Oct 2012 11:51:48 +0000 (12:51 +0100)]
lpc1768-stick: avoid driving srst high at startup

this avoid driving nSRST high after startup, by making sure the nOE is
initialized inactive/high.

This also matches the config used for the STM32-PerformanceStick.

Change-Id: I9376de575b7dc834310d57dbd58575d51f60183e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/878
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
11 years agocfg: cortino tested and working
Spencer Oliver [Wed, 26 Sep 2012 11:29:03 +0000 (12:29 +0100)]
cfg: cortino tested and working

Change-Id: I13534742c76ebbb05b47bf98768c997068da747a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/851
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agocfg: fix incorrect cortino reset config
Spencer Oliver [Wed, 26 Sep 2012 11:27:25 +0000 (12:27 +0100)]
cfg: fix incorrect cortino reset config

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

Change-Id: I28f6781bccae24de79aa6a03161f298a14fe2581
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/850
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agocfg: ftdi icdi enable srst open drain config
Spencer Oliver [Wed, 26 Sep 2012 14:36:28 +0000 (15:36 +0100)]
cfg: ftdi icdi enable srst open drain config

Change-Id: I21a115121f167dc88cd9bf2d1ca1ac9f3e1110d7
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/848
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agocfg: update ti/stellaris url's
Spencer Oliver [Tue, 2 Oct 2012 13:33:06 +0000 (14:33 +0100)]
cfg: update ti/stellaris url's

Change-Id: I96f17c5ea2be506a6b88434616ca52c3e392868a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/879
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agocfg: lm3s811ek config tested and working
Spencer Oliver [Tue, 25 Sep 2012 12:22:36 +0000 (13:22 +0100)]
cfg: lm3s811ek config tested and working

Change-Id: I5402b5521d6e1ef0a569f5cad02c003681f5444b
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/847
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agocfg: fix incorrect stm32-performance stick config
Spencer Oliver [Tue, 2 Oct 2012 11:45:41 +0000 (12:45 +0100)]
cfg: fix incorrect stm32-performance stick config

This hardware uses a output enable buffer that was not correctly defined.
Fixes issues when using the new ftdi driver.

Change-Id: Iba6235a71a6d3c7d16ab729f858b336a4574dfea
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/844
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
11 years agocfg: stm32-performance stick config tested and working
Spencer Oliver [Tue, 25 Sep 2012 09:14:24 +0000 (10:14 +0100)]
cfg: stm32-performance stick config tested and working

Change-Id: I9852d11e369e501af240a2b8e9f74306aee4e4a0
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/845
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agogdbserver: code cleanup
Spencer Oliver [Fri, 28 Sep 2012 13:06:57 +0000 (14:06 +0100)]
gdbserver: code cleanup

Change-Id: Iab2966be8dd145f33f41902e2d55afe03d0f5856
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/857
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agodocs: enable local structs in doxygen output
Spencer Oliver [Fri, 28 Sep 2012 13:09:22 +0000 (14:09 +0100)]
docs: enable local structs in doxygen output

Change-Id: I9c811d49690524f1ce5372326de67ec4ac7b09f4
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/858
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agobuild: remove unnecessary jim.h include
Spencer Oliver [Fri, 28 Sep 2012 13:26:00 +0000 (14:26 +0100)]
build: remove unnecessary jim.h include

as well as not being required, as it is already included by jim-nvp.h.
It also makes the doxygen output a bit clearer to read.

Change-Id: Ia2bed7142b4a56b48b1ecf0734e63f860dcd1014
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/859
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agocfg: add ti ek-lm3s9d92 config
Spencer Oliver [Wed, 26 Sep 2012 15:04:27 +0000 (16:04 +0100)]
cfg: add ti ek-lm3s9d92 config

Change-Id: Ib09ca3e57de363a24d704b184ba8546bad08f56f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/853
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agocfg: add ti ek-lm3s8962 config
Spencer Oliver [Wed, 26 Sep 2012 15:01:53 +0000 (16:01 +0100)]
cfg: add ti ek-lm3s8962 config

Change-Id: I753cec80a904130088b00b3f81b6dd61808662d6
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/852
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agosysfsgpio: remove ignoring return value build warning
Spencer Oliver [Thu, 27 Sep 2012 10:06:43 +0000 (11:06 +0100)]
sysfsgpio: remove ignoring return value build warning

fixes following gcc warning:
error: ignoring return value of write, declared with attribute warn_unused_result

Change-Id: I96ea6649078449208a77690caea2cb237c388e6e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/854
Tested-by: jenkins
Reviewed-by: Marc Reilly <marc@cpdesign.com.au>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agocfg: str9-comstick tested and working
Spencer Oliver [Tue, 25 Sep 2012 09:10:21 +0000 (10:10 +0100)]
cfg: str9-comstick tested and working

Change-Id: Ia6c45477381e78cb9508b4731438161e18be1f38
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/843
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 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
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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
11 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>
11 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>
11 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
11 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
11 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
11 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
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)