openocd.git
11 years agojtag: enable connect under reset 71/971/4
Spencer Oliver [Tue, 13 Nov 2012 12:02:26 +0000 (12:02 +0000)]
jtag: enable connect under reset

Currently if the target supports srst_nogate we wait until target assert_reset
until we get a chance to assert the srst.
However sometimes we will not get this far if the target has already failed
the jtag_examine_chain.

This has been tested on targets that support this behaviour (STM32 and STR9).

Change-Id: Ibcf7584b137b472f31ba6ddd5cd99d848c5508d1
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/971
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agojtag: add connect_type reset_config mode flag 76/976/3
Spencer Oliver [Mon, 26 Nov 2012 12:42:41 +0000 (12:42 +0000)]
jtag: add connect_type reset_config mode flag

This adds the ability to request to the adapter how we want to connect to
the target, eg. while srst is asserted or not.

This ability can very handy for connecting to unresponsive targets.
A prerequisite is that the target supports srst_nogate.

Change-Id: I0f7c9475160048e8a963e16077754f5403ac8325
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/976
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agocortex_a: Fix target entry state route. 54/954/2
Evan Hunter [Fri, 2 Nov 2012 06:59:03 +0000 (17:59 +1100)]
cortex_a: Fix target entry state route.

If target is disabled at init, then is examined using 'arp_examine', it
can get to cortex_a8_poll with the target state being unknown.

Change-Id: Ifffb345bf971d275d2eb1912648b29f0a75f6ccc
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/954
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips_m4k: Added SMP debug support for mips architectures 37/937/8
Kamal Dasu [Wed, 17 Oct 2012 16:16:36 +0000 (12:16 -0400)]
mips_m4k: Added SMP debug support for mips architectures

This change adds smp debug support for mips platforms. The change
leverages the exiting gdb smp support as mentioned in the OpenOCD
documentation for using gdb in smp environemnt. Added commands
smp_on, smp_off, smp_gdb to control the smp mode. The implementation
also provides a way to send Jc packet and toggle the gdb display core
context as well.

Change-Id: I0835a5aed1844b6ebf8291582912f20695346003
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Reviewed-on: http://openocd.zylin.com/937
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips_ejtag: Adding EJTAG 4.x and 5.x as valid versions 36/936/3
Kamal Dasu [Wed, 17 Oct 2012 16:12:42 +0000 (12:12 -0400)]
mips_ejtag: Adding EJTAG 4.x and 5.x as valid versions

This is a minor change to log EJTAG version 4.x and 5.x
as valid versions when debug log is enabled.

Change-Id: Ie20458d033c6d22842cb4a31b56765d4ba2ff123
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Reviewed-on: http://openocd.zylin.com/936
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agohelper: fix code formatting 95/995/2
Spencer Oliver [Fri, 23 Nov 2012 16:53:23 +0000 (16:53 +0000)]
helper: fix code formatting

Change-Id: Ide2d704c9ef4f5563649d5db53bbdd3641868b70
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/995
Tested-by: jenkins
11 years agoMake NetBSD a recognized system 98/998/2
Aymeric Vincent [Fri, 30 Nov 2012 17:28:02 +0000 (18:28 +0100)]
Make NetBSD a recognized system

Change-Id: I7fcb540553da7833a8b6a82335a7296539a8f491
Signed-off-by: Aymeric Vincent <vincent.aymeric@gmail.com>
Reviewed-on: http://openocd.zylin.com/998
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: jenkins
11 years agoarm: Mis-aligned data issue fix. 96/996/5
Jason Moehlman [Mon, 19 Nov 2012 23:33:34 +0000 (18:33 -0500)]
arm: Mis-aligned data issue fix.

Fixes issue with big endian hosts and mis-aligned data on some hosts.
Fixes unaligned access exception on hosts that do not support unaligned
access when debugging some arm targets.

Signed-off-by: Jason Moehlman <jmoehlma@linux-software.com>
Change-Id: I6bc6fb1b3c3565b256674b9ef43ed2afd14f5178
Reviewed-on: http://openocd.zylin.com/996
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
11 years agostlink: format src defines 78/978/3
Spencer Oliver [Thu, 15 Nov 2012 09:46:22 +0000 (09:46 +0000)]
stlink: format src defines

Change-Id: I7c3fd6e84681e007f1983ad9b8c85369cf9f3ba1
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/978
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
11 years agoflash: add stm32f42x/stm32f43x support 85/985/2
Spencer Oliver [Mon, 19 Nov 2012 17:21:57 +0000 (17:21 +0000)]
flash: add stm32f42x/stm32f43x support

Other than a larger memory layout these new devices also have an extra
MER1 bit to perform the mass erase.

Change-Id: I7110a05bac95c1707160d1f5622181664291eb4a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/985
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
11 years agomips: patch mips32_pracc_exec_write() 75/975/2
Salvador Arroyo [Sun, 11 Nov 2012 17:06:57 +0000 (18:06 +0100)]
mips: patch mips32_pracc_exec_write()

No function writes to MIPS32_PRACC_PARAM_IN addresses and probably has no much sense.
Any attempt to write to those addresses should be an error.

Change-Id: Iebea5fa9954e2cd56ad34976dd7d25009c6e6388
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/975
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips: optimize mips32_pracc_read_regs() code 58/958/2
Salvador Arroyo [Sat, 3 Nov 2012 11:39:27 +0000 (12:39 +0100)]
mips: optimize mips32_pracc_read_regs() code

Current code needs 101 pracc accesses for this function, this code needs 12 less.
There is a singularity in this code, is the only function that restore
a register from param out instead from  pracc stack. Obviously the register
was previously stored at param out. This save 2 pracc accesses.

Change-Id: Ie95b6f983a3198dafc0eab2dd5acc11f871a8d83
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/958
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips: optimize mips32_pracc_write_regs() code. 57/957/3
Salvador Arroyo [Sat, 3 Nov 2012 10:29:46 +0000 (11:29 +0100)]
mips: optimize mips32_pracc_write_regs() code.

All the the loads are done with lui and ori instructions, there is
no need to save any register, they will be overwritten.
Like in the previous patch, for speed optimization in write code,
same instructions can be saved if the lower half word or the upper
half word is 0.
If the lower half word is 0, it can be loaded with only a lui instruction.
If the higher half word is 0 it can be done with an ori instruction with register 0.
This code saves 10 pracc accesses at a minimum, and 40 at a maximum,
obviously if register 2 to 31 are 0 or a half word is 0
Current code needs 91 pracc accesses.

Change-Id: I892c5b440191d0c7a474c96845d41c373b7fc637
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/957
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
11 years agomips: optimize write code for speed 56/956/3
Salvador Arroyo [Fri, 2 Nov 2012 15:08:31 +0000 (16:08 +0100)]
mips: optimize write code for speed

All the writes are done by the new function mips32_pracc_write_mem_generic().
The code is similar to the read generic code.
The reuse of register 15 as memory base address saves 3 pracc accesses.
The first write takes 13(12) pracc accesses and for additional writes 3(2).
Loading miniprograms should take 25% less time and loading fastdata transfer
handler code should be over 2x faster.

Change-Id: Ia3b24ba084af33be99da19f00a7fd4d1b291f350
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/956
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips: optimize read code for speed 55/955/3
Salvador Arroyo [Fri, 2 Nov 2012 09:14:58 +0000 (10:14 +0100)]
mips: optimize read code for speed

Really nothing new that not explained in previous patches.
The code is expanded as needed, there are no loops in pracc code.
For the first value pracc accesses are reduced from 39 to 16
and for aditional values from 10 to 3.
dump_image should work around 3x faster.

Change-Id: I37c9b13395c09eb52a91f10cdb6cbaedef8ab98b
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/955
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips: optimize mips32_pracc_read_u32() function 52/952/2
Salvador Arroyo [Thu, 1 Nov 2012 22:22:32 +0000 (23:22 +0100)]
mips: optimize mips32_pracc_read_u32() function

This function is highly optimized, there is not much to
improve.
Loading the base address for pracc access with the new
defined MIPS32_PRACC_BASE_ADDR saves one instruction.
The memory address is loaded in too steps. First the upper
address is loaded. The lower address is passed as an offset in
the memory load instruction.
The offset is signed, if the lower address is in the range of
0x8000 to 0xffff the offset is a negative value, and the upper
address must be incremented by 1.
Pracc accesses are now 12 instead of 14.

Change-Id: I286945b240ed5c5d5cc540780a41a8a5fa075da3
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/952
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips: optimize CP0 read/write code 51/951/3
Salvador Arroyo [Thu, 1 Nov 2012 19:55:28 +0000 (20:55 +0100)]
mips: optimize CP0 read/write code

MIPS32_PRACC_BASE_ADDR is defined as 0xFF200000. Now is
possible to load the base address with a lui instruction and
only one pracc access.
Offsets to the pracc code addresses are defined to simplify the code
and probably make it a bit more readable or self-explained.

Change-Id: I853dd2d7fad52745931cc6e6be68c0ae156d897e
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/951
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
11 years agomips: code clean up in mips_m4k_debug_entry() function 50/950/2
Salvador Arroyo [Thu, 1 Nov 2012 14:45:12 +0000 (15:45 +0100)]
mips: code clean up in mips_m4k_debug_entry() function

The function mips_ejtag_read_debug() is defined in mips_ejtag.c
and is called only by mips_m4k_debug_entry() for reading the
CP0 debug register. The comment in this function is obviously wrong.
There is a generic function to read CP0 registers with similar code.
A call to mips32_cp0_read() should work in the same way.
The purpose of reading the debug register is to test if the DSS
bit is set and clear the SSt bit.
It is faster and easier if the SSt bit is cleared without any check.
Remark: DSS bit set only means that a debug single-step exception
ocurred, but it is not possible to step over a sdbbp instruction,
in this case DSS will not be set and the SSt bit not cleared by code.
Resume command at another address will step, so really the behavior
is not the same.

Change-Id: Ibd35f80e0f7669976d96f4ed813830cecf587971
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/950
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips: optimize mips_ejtag_step_disable() code 44/944/3
Salvador Arroyo [Tue, 30 Oct 2012 22:15:35 +0000 (23:15 +0100)]
mips: optimize mips_ejtag_step_disable() code

The code is a bit large compared to mips_ejtag_step_enable().
With the mips32 xori instruction the code can be
reused.
The number of pracc accesses are reduced from 18 to 7.

Change-Id: If3974ebd64da4461c22b089796646990e68e1b72
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/944
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoPic32mx.cfg: Change system clock to 8Mhz after reset-init. 05/805/3
Salvador Arroyo [Sat, 1 Sep 2012 11:50:39 +0000 (13:50 +0200)]
Pic32mx.cfg: Change system clock to 8Mhz after reset-init.

As for openocd 0.6.0-rc2 the function mips32_pracc_fastdata_xfer()
should now work at a scan frequency up to 1200Khz.
Mainly usefull to increase programming speed.

Also verify_image should be slightly faster.

Change-Id: I1e9b2be73690a4597e2f6ba069c1205026850f07
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/805
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agodoc: update to new sourceforge git url 82/982/3
Spencer Oliver [Thu, 15 Nov 2012 23:05:13 +0000 (23:05 +0000)]
doc: update to new sourceforge git url

The new sourceforge platform also supports http access, so use that rather
then repo.or.cz.

Change-Id: Ica89d9475847a2095c179b240053145795549802
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/982
Tested-by: jenkins
11 years agoRevert "mpsse: Always perform a general reset of the MPSSE in mpsse_open()" 73/973/2
Freddie Chopin [Fri, 9 Nov 2012 22:18:23 +0000 (23:18 +0100)]
Revert "mpsse: Always perform a general reset of the MPSSE in mpsse_open()"

This reverts commit 452248af1d06cb1140b85f53ef4fdee1c746d807. This change
breaks all non-high speed adapters. The patch was not tested and did not get
any review.

Change-Id: Ib38fd242a202fd7c5a8711d9f857cd8f586df44e
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/973
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agortos: Fix error in reading the current thread in ChibiOS/RT 74/974/3
Matthias Blaicher [Sat, 10 Nov 2012 11:10:15 +0000 (12:10 +0100)]
rtos: Fix error in reading the current thread in ChibiOS/RT

Commit c4ab127b4069e20e introduces a copy&paste error which affects
the detection of the current thread.

As a result, the stack of the current thread won't be detected
correctly in most cases.

Change-Id: Ib46b8f64be8053d7e9103f427c66796963214419
Signed-off-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-on: http://openocd.zylin.com/974
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agotarget: add async algorithm timeout 49/949/3
Spencer Oliver [Mon, 5 Nov 2012 13:04:15 +0000 (13:04 +0000)]
target: add async algorithm timeout

An issue was observed when using an async algorithm with a target that had
not been previously reset beforehand. The target would enter a infinite
loop within target_run_flash_async_algorithm.

Add a timeout that will at least prevent this issue from happening. and also
suggest the user resets the target.

Change-Id: I5277e0d64e252d3d353e8d5bc9889a37fdc63060
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/949
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
11 years agoARM v4/v5 target files: mrc and mcr help information is incorrect. 14/914/2
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>
11 years agocortex: autostep correctly handle user breakpoint 47/947/3
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
11 years agocortex_m: Fix single stepping will not return to debug mode sometimes 64/864/5
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>
11 years agoAdded support for NXP LPC1850 Microcontroller 30/930/4
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>
11 years agoGeneric LPC1850 board w/ SPIFI flash. 29/929/4
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>
11 years agoAdded support for SPI Flash Winbond W25Q64CV 28/928/4
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>
11 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
11 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>
11 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>
11 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>
11 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>
11 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>
11 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
11 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
11 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
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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
11 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
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>

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)