]> git.sur5r.net Git - openocd/log
openocd
12 years agoARM v4/v5 target files: mrc and mcr help information is incorrect.
Karl Kurbjun [Mon, 22 Oct 2012 18:20:10 +0000 (12:20 -0600)]
ARM v4/v5 target files: mrc and mcr help information is incorrect.

The order of the mrc/mcr command matches the ARM Architecture Reference
Manual.  This patch corrects the help information for mrc/mcr.

Change-Id: I1f0e6a628a3644124591a6aa291b8a58cfd93b44
Signed-off-by: Karl Kurbjun <kkurbjun@gmail.com>
Reviewed-on: http://openocd.zylin.com/914
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agocortex: autostep correctly handle user breakpoint
Spencer Oliver [Tue, 6 Nov 2012 15:43:51 +0000 (15:43 +0000)]
cortex: autostep correctly handle user breakpoint

If we halt due to a breakpoint make sure that we do not remove it during a
step, only remove breakpoints we have created.

Change-Id: I060168e54e53637d4fbf3cbcf62072efdb353807
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/947
Tested-by: jenkins
12 years agocortex_m: Fix single stepping will not return to debug mode sometimes
Peter Horn [Mon, 8 Oct 2012 20:06:07 +0000 (22:06 +0200)]
cortex_m: Fix single stepping will not return to debug mode sometimes

This occurs when stepping past a breakpoint on a even address with
maskisr option set to auto

With -d3 the following log message appears in this case:

"Debug : Interrupt handlers didn't complete within time,
 leaving target running"

Cause : Given a breakpoint is set on the lower half word and the PC is on
the upper half word. When another breakpoint is now set on the current PC
then resuming the core will not result in a break on the newly set
breakpoint. This has been observed on a STM32F1x, STM32F2x (CM3) but not
on a STM32F0x (CM0). It's not clear if this is a STM32F1/F2 only or a
general CM3 problem.

Change-Id: I384813f3bfdf935373b5e23cdb2d7f243c70cc00
Signed-off-by: Peter Horn <peter.horn@bluewin.ch>
Reviewed-on: http://openocd.zylin.com/864
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoAdded support for NXP LPC1850 Microcontroller
Gianluca Renzi [Thu, 25 Oct 2012 12:29:33 +0000 (14:29 +0200)]
Added support for NXP LPC1850 Microcontroller

Added a new configuration file for LPC18xx based boards, such as
HitexLPC1850RevA Evaluation Board, and all other based on the
same microcontroller by NXP.

Change-Id: I68c3827be535b6d09a5c70b6d57191937d00354d
Signed-off-by: Gianluca Renzi <gianlucarenzi@eurekelettronica.it>
Reviewed-on: http://openocd.zylin.com/930
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoGeneric LPC1850 board w/ SPIFI flash.
Gianluca Renzi [Thu, 25 Oct 2012 12:26:42 +0000 (14:26 +0200)]
Generic LPC1850 board w/ SPIFI flash.

This config file is intended as an example of how to
use the lpcspifi flash driver, but it should be functional
for most LPC1850 boards utilizing SPIFI flash.

Change-Id: I855854282336701fd210134497ce014017f3aaec
Signed-off-by: Gianluca Renzi <gianlucarenzi@eurekelettronica.it>
Reviewed-on: http://openocd.zylin.com/929
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoAdded support for SPI Flash Winbond W25Q64CV
Gianluca Renzi [Tue, 6 Nov 2012 13:04:22 +0000 (13:04 +0000)]
Added support for SPI Flash Winbond W25Q64CV

Added in spi device table SPI Flash Winbond W25Q64CV 64Mbit
Its Device ID 0x001740ef is the same as Spansion S25FL064K (may
be a clone?)

Change-Id: I3cdbd182a0ccde75c78684cb9d54c76059bf34e0
Signed-off-by: Gianluca Renzi <gianlucarenzi@eurekelettronica.it>
Reviewed-on: http://openocd.zylin.com/928
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agocortex_m: fix define formatting
Spencer Oliver [Mon, 5 Nov 2012 11:40:56 +0000 (11:40 +0000)]
cortex_m: fix define formatting

Change-Id: Ibdec882b2afc7e16f2361f86715463e030a54964
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/963
Tested-by: jenkins
12 years agortos: Make ChibiOS code aware of endiness
Matthias Blaicher [Mon, 5 Nov 2012 10:22:12 +0000 (11:22 +0100)]
rtos: Make ChibiOS code aware of endiness

The ChibiOS code was derived from other RTOS support code which
does not honor the target vs. host endiness.

The other RTOS code still needs to be fixed.

Change-Id: Idf42cfaa30945289bf1756ad6491fff84913eda9
Signed-off-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-on: http://openocd.zylin.com/962
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agortos: Add FPU detection to ChibiOS/RT
Matthias Blaicher [Mon, 5 Nov 2012 08:44:22 +0000 (09:44 +0100)]
rtos: Add FPU detection to ChibiOS/RT

The stacking of ChibiOS/RT depends on the usage of an FPU. If the
FPU is enabled the FPU registers are also saved on context switch.

This patch adds automatic detection of FPU for armv7m targets.

Note: With this patch, openocd will only output an error message
      warning that the FPU is enabled.

      For further FPU support, the correct stacking information
      also needs to be added.

Change-Id: I0984cbd9180f247ba2fa610e74a6413cc54239ea
Signed-off-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-on: http://openocd.zylin.com/961
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agortos: Fix wrong ReadyList lookup in ChibiOS
Matthias Blaicher [Sun, 4 Nov 2012 13:56:08 +0000 (14:56 +0100)]
rtos: Fix wrong ReadyList lookup in ChibiOS

We already have the address of the ReadyList provided by gdb.
It is wrong to resolve that address a second time and it only
works by accident.

Change-Id: I82fa2360931c416290cd7f83e1883f86f90dedc2
Signed-off-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-on: http://openocd.zylin.com/959
Reviewed-by: Joel Bodenmann <joel@unormal.org>
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agofix memory leaks
Sergey Borshch [Wed, 19 Sep 2012 07:07:36 +0000 (10:07 +0300)]
fix memory leaks

if add_connection() fails, memory allocated in copy_command_context() is lost.

Signed-off-by: Sergey Borshch <sb-sf@users.sourceforge.net>
Change-Id: I91a2757f29612038031eb8953100faa3b850d3a6
Reviewed-on: http://openocd.zylin.com/836
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoEnsure Cortex-M reset wakes device from sleep (wfi/wfe)
Evan Hunter [Thu, 11 Oct 2012 20:24:11 +0000 (07:24 +1100)]
Ensure Cortex-M reset wakes device from sleep (wfi/wfe)

Change-Id: Idb52ca3123bb3e2f7863ba1b82ac9b176d7cb094
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/833
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agompsse: Always perform a general reset of the MPSSE in mpsse_open()
Peter Stuge [Sun, 28 Oct 2012 04:42:15 +0000 (05:42 +0100)]
mpsse: Always perform a general reset of the MPSSE in mpsse_open()

Per AN_135 FTDI MPSSE Basics Version 1.1, section 4.2 step 7.
http://www.ftdichip.com/Support/Documents/AppNotes/AN_135_MPSSE_Basics.pdf

This allows to stop and restart OpenOCD reliably, without needing
to power cycle the interface.

Change-Id: Ibeafe5ecfe7b2f6f82712cbc85116904407ddb36
Signed-off-by: Peter Stuge <peter@stuge.se>
Reviewed-on: http://openocd.zylin.com/939
Tested-by: jenkins
12 years agoftdi/flyswatter2.cfg: Define the LED signal
Peter Stuge [Sun, 28 Oct 2012 05:00:48 +0000 (06:00 +0100)]
ftdi/flyswatter2.cfg: Define the LED signal

Change-Id: Ic5d85c0d855bcffba54de7df6cff4d726656af97
Signed-off-by: Peter Stuge <peter@stuge.se>
Reviewed-on: http://openocd.zylin.com/940
Tested-by: jenkins
12 years agoftdi/flyswatter2.cfg: Fix the signal layout
Peter Stuge [Sun, 28 Oct 2012 03:54:13 +0000 (04:54 +0100)]
ftdi/flyswatter2.cfg: Fix the signal layout

Change-Id: If6612af25fa3562f49e9c8ccff01b6ef0af5ceb0
Signed-off-by: Peter Stuge <peter@stuge.se>
Reviewed-on: http://openocd.zylin.com/938
Tested-by: jenkins
12 years agoflash: update stm32 flash driver versions
Spencer Oliver [Wed, 24 Oct 2012 11:03:17 +0000 (12:03 +0100)]
flash: update stm32 flash driver versions

Seems ST have changed the ref manual (RM0313 rev1) and reverted to using
letters rather than numbers for the stm32f3x family.

Change-Id: I3a87ec9b0b2447d57dfef98603d30e28fe9ac927
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/926
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agogdb: fix broken qCRC packet handling
Spencer Oliver [Fri, 26 Oct 2012 11:59:29 +0000 (12:59 +0100)]
gdb: fix broken qCRC packet handling

The rtos layer was incorrectly handling a qCRC packet as a qC packet.
Make sure we check for the qCRC packet and return unhandled so the gdb
server gets a chance to handle it.

This packet is used in the gdb compare-sections cmd.

Change-Id: I21f8e5fa7225fccd13d65cf9e40186895065a7e3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/933
Tested-by: jenkins
Reviewed-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agogdb: use strncmp rather than strstr
Spencer Oliver [Fri, 26 Oct 2012 11:47:06 +0000 (12:47 +0100)]
gdb: use strncmp rather than strstr

All the packets received will be at start of the packet buffer, so use
more efficient strncmp.

Change-Id: Ib9c45d8f53425367006b1f880c1bde27f03a6cf9
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/932
Tested-by: jenkins
Reviewed-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoioutil: make the file compile on MacOS
Edgar Grimberg [Wed, 17 Oct 2012 22:27:02 +0000 (00:27 +0200)]
ioutil: make the file compile on MacOS

The meminfo command cannot exist if the malloc.h header is not
present.
Cannot get the mac address without sys/ioctl.h and SIOCGIFHWADDR
defined

Change-Id: Ifc0fb98c3a60c53ad2e19473e08b34c460529d0b
Signed-off-by: Edgar Grimberg <edgar.grimberg@gmail.com>
Reviewed-on: http://openocd.zylin.com/912
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoadi_v5_jtag.c: Avoid infinite recursion in jtagdp_transaction_endcheck()
Andreas Fritiofson [Tue, 9 Oct 2012 14:47:16 +0000 (16:47 +0200)]
adi_v5_jtag.c: Avoid infinite recursion in jtagdp_transaction_endcheck()

Change-Id: I81163d9c2ff97ed768f8a3ac1505a8d2b5016b91
Signed-off-by: Peter Stuge <peter@stuge.se>
Reviewed-on: http://openocd.zylin.com/908
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
12 years agortos: fix gdb qC command answer
Matthias Blaicher [Tue, 23 Oct 2012 14:53:16 +0000 (16:53 +0200)]
rtos: fix gdb qC command answer

rtos->current_thread is of type int64_t. All other commands already
respect this.

Change-Id: I9951946ff2a09c53cd78c6ab882c80cdd2ab7ac6
Signed-off-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-on: http://openocd.zylin.com/917
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agortos: Use ARRAY_SIZE instead of coding it by hand
Matthias Blaicher [Sat, 27 Oct 2012 15:21:24 +0000 (17:21 +0200)]
rtos: Use ARRAY_SIZE instead of coding it by hand

Use ARRAY_SIZE in helper/types.h to determine the size of the
symbol list.

Change-Id: Icc9838323510f8602efa5d0162a4daed33f863b9
Signed-off-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-on: http://openocd.zylin.com/935
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agortos: Fix wrong allocation in linux_get_symbol_list_to_lookup
Matthias Blaicher [Sat, 27 Oct 2012 14:00:12 +0000 (16:00 +0200)]
rtos: Fix wrong allocation in linux_get_symbol_list_to_lookup

linux_get_symbol_list_to_lookup allocates to few memory. On 64 bit
systems the error did not show due to char* being twice its size,
leaving accidentally enough space.

This patch makes linux_get_symbol_list_to_lookup behave identical
to all other RTOS.

Change-Id: I290ea241fb20b65585c8be14609a92fdbd2a307d
Signed-off-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-on: http://openocd.zylin.com/934
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoRevert "gdb_server : 'R' command replied by OK"
Spencer Oliver [Wed, 10 Oct 2012 16:35:39 +0000 (17:35 +0100)]
Revert "gdb_server : 'R' command replied by OK"

This reverts commit 1e7e59445287c3389b52903a7cacdb5635248f32.

For some reason the above commit added a reply to the restart command - this is
not required as per the gdb docs.

Newer versions of gdb (7.0 and above) will complain about this reply.

Change-Id: Ieeae3dcf44d798a91dfc6f7348da982c2ce1be31
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/910
Tested-by: jenkins
Reviewed-by: Joel Bodenmann <joel@unormal.org>
12 years agodocs: mention extended-remote support
Spencer Oliver [Thu, 18 Oct 2012 09:52:16 +0000 (10:52 +0100)]
docs: mention extended-remote support

Change-Id: Idd7cc0364856082cbbfee5015e49cd7d237d68ef
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/913
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agostlink: fix vector catch not being cleared
Spencer Oliver [Mon, 8 Oct 2012 09:05:45 +0000 (10:05 +0100)]
stlink: fix vector catch not being cleared

Seems after a reset the stlink is not clearing the vector catch (VC_CORERESET)
in the Debug Control Register.

This has the side effect if the user presses an external reset the core will
halt, this patch fixes that.

Change-Id: Ic3b2c3991b79cacbbd901c02b79613c2e204e71f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/905
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agogdb: fix extended-remote restart
Spencer Oliver [Thu, 11 Oct 2012 10:19:52 +0000 (11:19 +0100)]
gdb: fix extended-remote restart

Seems versions of gdb > 6.8 require an W stop reply after receiving a
kill packet.

Without this we receive the following error from gdb:
gdb/thread.c:72: internal-error: inferior_thread: Assertion `tp' failed.

Change-Id: I86765a321f0429c9b517fe13ded0ee2dbd4b2f87
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/911
Tested-by: jenkins
Reviewed-by: Joel Bodenmann <joel@unormal.org>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: fix at91sam3/4 driver typos
Spencer Oliver [Thu, 4 Oct 2012 15:18:15 +0000 (16:18 +0100)]
flash: fix at91sam3/4 driver typos

Change-Id: I06efdfcc48279b06035e9e173945304310054864
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/896
Tested-by: jenkins
Reviewed-by: Olivier Schonken <olivier.schonken@gmail.com>
12 years agoFix serious bug in LPC2xxx/LPC17xx flash algorithm.
Freddie Chopin [Sat, 6 Oct 2012 07:49:28 +0000 (09:49 +0200)]
Fix serious bug in LPC2xxx/LPC17xx flash algorithm.

Flash algorithm for LPC17xx/LPC2xxx was trying to "reuse" previously
allocated working area on next flashing which is not possible -
working areas are freed automatically on reset. This caused all but
first flashing attempts to fail. As there is no point in storing pointer
to working area, it was converted to local variable.

Change-Id: I939946325ff9eecc4861c0f51ab0f73871a3d7b9
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/860
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoCleanup lpc2000.c
Freddie Chopin [Fri, 5 Oct 2012 20:16:35 +0000 (22:16 +0200)]
Cleanup lpc2000.c

Do some cleanup in lpc2000.c - concatenate short lines into single
longer lines, move variable declarations to "just before" they are
used, etc.

Change-Id: Ia7b9f0307dd4857ee8e15c8a6d4d7b5c4392fd80
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/861
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agortos: Add ChibiOS/RT support
Matthias Blaicher [Fri, 5 Oct 2012 16:56:04 +0000 (18:56 +0200)]
rtos: Add ChibiOS/RT support

This patch adds ChibiOS/RT support. This patch requires at least
ChibiOS/RT development version starting from SVN revision 4734.

Note, that the Thread structures depend not only on the target
but also on the ChibiOS configuration at build time.
To correct this ChibiOS includes a new "memory signature" which
specifies the offsets.

Special thanks go to Peter Stuge and Spencer Oliver for their
continous input and feedback to this patch.

Change-Id: I842bf7ba6c2309a4efe93d29ea6cd0784a8b22a3
Signed-off-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-on: http://openocd.zylin.com/901
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agocfi: remove typos and code cleanup
Spencer Oliver [Mon, 8 Oct 2012 15:14:30 +0000 (16:14 +0100)]
cfi: remove typos and code cleanup

No change to code, just fix some formatting issues.

Change-Id: I177430a99bfecbf90a1ddf623321c29d4db516b0
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/906
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoflash: update stellaris flash data to latest dev package 9453
Spencer Oliver [Thu, 27 Sep 2012 14:55:13 +0000 (15:55 +0100)]
flash: update stellaris flash data to latest dev package 9453

Change-Id: I16107a093d4ed7342583f5c32ad16aa98f81d122
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/856
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agortos: Don't crash on qSymbol GDB packet when no RTOS is configured
Matthias Blaicher [Tue, 9 Oct 2012 08:25:00 +0000 (10:25 +0200)]
rtos: Don't crash on qSymbol GDB packet when no RTOS is configured

Commit 43902905bbc8fdc9d764f3843d697161d9b5fd92 fixed a bug but also
introduced a regression. The RTOS GDB packet handler is always called,
not only when an RTOS is actually configured, so it is important to
check if an RTOS has been configured or not before actually processing
the qSymbol packet.

Change-Id: I1aed54f6c2817e1ebf99ddcda051df4554ea5a3a
Signed-off-by: Peter Stuge <peter@stuge.se>
Reviewed-on: http://openocd.zylin.com/907
Tested-by: jenkins
12 years agortos: support FreeRTOS over stlink
Paul Fertser [Thu, 17 May 2012 19:38:25 +0000 (23:38 +0400)]
rtos: support FreeRTOS over stlink

Since stlink is a special case it presents the same CPU core under a
different name, so copy the configuration to account for that.

Change-Id: I9febf79b388301bde6211d185b5b8161cdadb9ff
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/652
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agorlink: Fix DTC command timeout
Peter Horn [Mon, 8 Oct 2012 18:55:01 +0000 (20:55 +0200)]
rlink: Fix DTC command timeout

With the current timeout setting i = 10 in drtc_run_timeout()
I get "Error: too many retries waiting for DTC status" when
loading a program into the FLASH of an STM32F1.

By experimentation a value of i = 22 was found to be the minimum
on my system. Therefore the value has been increased to i = 50.

Change-Id: Ib67fc648ccaad305871b81c2c39e49de53c330a0
Signed-off-by: Peter Horn <peter.horn@bluewin.ch>
Reviewed-on: http://openocd.zylin.com/863
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agodsp5680xx_flash: Remove unused flash bank structure
Andreas Fritiofson [Sun, 30 Sep 2012 21:04:40 +0000 (23:04 +0200)]
dsp5680xx_flash: Remove unused flash bank structure

Change-Id: I947b6730b3741a71303e440daefa4fcf583cb9cf
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/867
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agostm32f1x: Increase options erase timeout
Andreas Fritiofson [Fri, 5 Oct 2012 22:13:24 +0000 (00:13 +0200)]
stm32f1x: Increase options erase timeout

The erase time for the option byte page is not directly specified but is
assumed to be the same as the other pages (or mass erase) which is 20 to
40 ms. The current timeout value is 10 which means 10 ms plus the time to
poll the status flag that many times.

With faster interfaces or drivers (such as when using the ftdi driver
instead of the ft2232 driver) the adapter delay is not enough in some
cases, unless the jtag freq is reduced as a workaround. The result is a
"timed out waiting for flash" error when trying to write the options.

Increase the timeout to a minimum of 100 ms, which is in line with the
other erase timeouts. Also make defines of both the erase and the program
timeouts.

Change-Id: Ia86e71505033c52b60ef30092000689fbb547a18
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/902
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoflash/nor/stellaris: Remove unnecessary write_algorithm check
Andreas Fritiofson [Sun, 30 Sep 2012 21:03:44 +0000 (23:03 +0200)]
flash/nor/stellaris: Remove unnecessary write_algorithm check

The pointer must be non-null here since we returned if allocation failed.

Change-Id: I9b75099ed3b3870c815d1df5760ed1f3fe1d20d6
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/866
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoflash/nor: make all working area pointers local
Andreas Fritiofson [Sun, 30 Sep 2012 21:01:51 +0000 (23:01 +0200)]
flash/nor: make all working area pointers local

Working area pointers shouldn't be re-used, so there's no point in storing
them in the flash bank struct. Make all such pointers local.

Change-Id: Iab65b4e8b475fed7fc72fb8928f54590fa69d260
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/865
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
12 years agoreadme: update missing configure args
Spencer Oliver [Thu, 4 Oct 2012 22:54:45 +0000 (23:54 +0100)]
readme: update missing configure args

Change-Id: I495a4557f161290f8f99788de27958f7dc08d6f6
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/900
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agoRevert "target: remove unused working area 'user' field"
Spencer Oliver [Thu, 4 Oct 2012 21:40:59 +0000 (21:40 +0000)]
Revert "target: remove unused working area 'user' field"

This reverts commit 63a23e6fc862b94f00e0833ab474bd02901a019f

Change-Id: I62778fb3b1dabc6470d582bea9ca64d593999233
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Change-Id: Iaf5a2cf5bdc4a62ba68ad9403e1c1229112970de
Reviewed-on: http://openocd.zylin.com/899
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
12 years agortos: Rewrite rtos_qsymbol() and fix auto-detect false positive
Peter Stuge [Thu, 4 Oct 2012 13:17:53 +0000 (15:17 +0200)]
rtos: Rewrite rtos_qsymbol() and fix auto-detect false positive

Matthias Blaicher submitted a patch at http://openocd.zylin.com/#/c/891/
to fix the false positive; when no RTOS was detected OpenOCD used the
last RTOS in the list.

While reviewing the code affected by Matthias' patch a rewrite seemed
appropriate, to make the code readable.

Matthias has abandoned his change and this change also fixes the false
positive.

Change-Id: Ic3327ccd036da52ba0a7e21ef93018205e74149c
Signed-off-by: Peter Stuge <peter@stuge.se>
Reviewed-on: http://openocd.zylin.com/895
Reviewed-by: Matthias Blaicher <matthias@blaicher.com>
Tested-by: jenkins
12 years agortos: Rewrite rtos_try_next() for readability
Peter Stuge [Thu, 4 Oct 2012 12:35:18 +0000 (14:35 +0200)]
rtos: Rewrite rtos_try_next() for readability

The new code is almost functionally equivalent to the old.

The function now returns 0 instead of -1 if target->rtos has not yet
been allocated. All call sites only test for success, and in practise
that is also the only thing that matters; if the function successfully
iterated to the next RTOS or not.

Other than that the only difference is that the code is now readable.

Many thanks to Matthias Blaicher for the fix to the iteration error!

Change-Id: I3342826f653b5e46c99ad1f58eec26ff10795c33
Signed-off-by: Peter Stuge <peter@stuge.se>
Reviewed-on: http://openocd.zylin.com/894
Reviewed-by: Matthias Blaicher <matthias@blaicher.com>
Tested-by: jenkins
12 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>
12 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>
12 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>
12 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
12 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>
12 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>
12 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>
12 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>
12 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>
12 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
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
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>