openocd.git
10 years agostm32 configs: use 4kB working area size by default 78/1378/3
Paul Fertser [Sat, 4 May 2013 21:09:15 +0000 (01:09 +0400)]
stm32 configs: use 4kB working area size by default

This is needed for configs that might be used with the cheapest
STM32F100 parts that have only 4kB SRAM.

Restrictions for the other STM32 families are verified to be set
appropriately.

Change-Id: I1ad2370435015604db9f27c1a76c153480311a28
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1378
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotelnet_server: support C-p, C-n for moving through history 76/1376/2
Paul Fertser [Fri, 3 May 2013 13:19:43 +0000 (17:19 +0400)]
telnet_server: support C-p, C-n for moving through history

This modifies telnet server to allow using common readline combinations to
move up/down history, without the need to touch cursor keys.

Change-Id: Ib659075883e91794b44f391f7c29bbdfdd679d10
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1376
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoefm32: fix FTBFS on ARM due to alignment issues 70/1370/2
Paul Fertser [Mon, 29 Apr 2013 19:31:50 +0000 (23:31 +0400)]
efm32: fix FTBFS on ARM due to alignment issues

The following warnings prevent OpenOCD from building:
efm32.c: In function 'efm32x_read_lock_data':
efm32.c:373:8: error: cast increases required alignment of target type [-Werror=cast-align]
efm32.c:386:9: error: cast increases required alignment of target type [-Werror=cast-align]
efm32.c:394:9: error: cast increases required alignment of target type [-Werror=cast-align]
efm32.c:402:9: error: cast increases required alignment of target type [-Werror=cast-align]
efm32.c: In function 'efm32x_get_page_lock':
efm32.c:430:17: error: cast increases required alignment of target type [-Werror=cast-align]
efm32.c: In function 'efm32x_set_page_lock':
efm32.c:441:19: error: cast increases required alignment of target type [-Werror=cast-align]
cc1: all warnings being treated as errors

This patch is compile-tested only.

Change-Id: Ia3a8f342e0f5e30c8ea4de9435c5c7a80bc100e3
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1370
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agosysfsgpio: do not try to initialise absent signals 75/1375/2
Paul Fertser [Fri, 3 May 2013 08:49:07 +0000 (12:49 +0400)]
sysfsgpio: do not try to initialise absent signals

When e.g. SRST is not specified, the current code results in assigning 0 to
srst_fd and subsequently a stray '1' is output on screen on reset.

Avoid this by not doing bogus initialisation.

Change-Id: Iadb847a384a927ae746124cf6e4e3c6cc8b11406
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1375
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agojtag/adapter: add connect_[de]assert_srst to reset_config usage 77/1377/2
Paul Fertser [Sat, 4 May 2013 16:05:41 +0000 (20:05 +0400)]
jtag/adapter: add connect_[de]assert_srst to reset_config usage

Add the connect under reset options to the online help for
reset_config.

Change-Id: I4b9a87b234de01531390b39b898a848841d1e834
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1377
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agogdb_server: remove target_handle_event from gdb event callback 72/1372/2
Hsiangkai Wang [Wed, 1 May 2013 02:23:38 +0000 (10:23 +0800)]
gdb_server: remove target_handle_event from gdb event callback

In target_call_event_callbacks(), it will execute

1. target_handle_event (use Jim_EvalObj() to evaluate event
   statements in config files)
2. call user registered callbacks

Before calling user registered callbacks, target_handle_event has
been executed.  So, there is no need to call target_handle_event()
in gdb event callback.  It will execute event statements in config
files twice.

Change-Id: I84629e324fa3eb909907badf2319b4138ba89f07
Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com>
Reviewed-on: http://openocd.zylin.com/1372
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoRestore normal development cycle
Freddie Chopin [Sun, 5 May 2013 08:43:24 +0000 (10:43 +0200)]
Restore normal development cycle

1. Archive NEWS for 0.7.0 release
2. Add new blank NEWS file
3. Bump version to 0.8.0 and restore "-dev" suffix

Change-Id: I21febc042faeed294f3beeb5e683535dbf011e8f
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoThe openocd-0.7.0 release. v0.7.0
Freddie Chopin [Sun, 5 May 2013 07:46:23 +0000 (09:46 +0200)]
The openocd-0.7.0 release.

Change-Id: I08157f47ac056e6d2089119dd2d6cbab11b521e8
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agodoc: add info about FT232H and JTAG-lock-pick Tiny 2 adapter 67/1367/2
Freddie Chopin [Sun, 28 Apr 2013 08:53:13 +0000 (10:53 +0200)]
doc: add info about FT232H and JTAG-lock-pick Tiny 2 adapter

Change-Id: I3b1047580669da3f17ea87183536275a10671fec
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/1367
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agodoc: Update list of interfaces, targets and boards 66/1366/2
Freddie Chopin [Sun, 28 Apr 2013 08:33:22 +0000 (10:33 +0200)]
doc: Update list of interfaces, targets and boards

Change-Id: If9481e061f09a37f9ee3c461a1a0ce4d382a9a0d
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/1366
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agodev-doc: fix to release process docs 68/1368/2
Freddie Chopin [Sun, 28 Apr 2013 11:33:16 +0000 (13:33 +0200)]
dev-doc: fix to release process docs

Change-Id: I916e7ff1af211baef1c6d56fd44d292ee6983599
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/1368
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agocfg: remove whitespace 74/1374/2
Spencer Oliver [Thu, 2 May 2013 15:04:45 +0000 (16:04 +0100)]
cfg: remove whitespace

Change-Id: I20edbb50efc03711195102f4c6dc8bcfaf043d44
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1374
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
10 years agocfg: ignore ICEPick jrc tap version 73/1373/3
Spencer Oliver [Thu, 2 May 2013 14:53:54 +0000 (15:53 +0100)]
cfg: ignore ICEPick jrc tap version

Due to reports of newer targets using a updated version of the ICEPick tap
rather than add another tapid we ignore the tap version.

Also see Trac 49 for details.

Change-Id: Ic78414c54af2545c817e1bb2c860970c1b587259
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1373
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
10 years agoRestore -dev suffix
Freddie Chopin [Sun, 28 Apr 2013 11:12:40 +0000 (13:12 +0200)]
Restore -dev suffix

Change-Id: I26f49e02d228b59533237607fa8307ecc627409e
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoThe openocd-0.7.0-rc2 release candidate. v0.7.0-rc2
Freddie Chopin [Sun, 28 Apr 2013 10:38:42 +0000 (12:38 +0200)]
The openocd-0.7.0-rc2 release candidate.

Change-Id: I0a3576dd098d73437547b619c726cacd8f1dba64
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agotarget: rename cortex_a8 to cortex_a 30/1130/5
Spencer Oliver [Fri, 1 Feb 2013 15:43:21 +0000 (15:43 +0000)]
target: rename cortex_a8 to cortex_a

Rename cortex_a8 target to use a more correct cortex_a name.
This also adds a deprecated_name var so that older scripts issue a warning
to update the target name.

cfg files have also been updated to the new target name.

Change-Id: I0eb1429c9281321efeb444b27a662a941a2ab67f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1130
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agotarget: rename cortex_m3 to cortex_m 29/1129/5
Spencer Oliver [Fri, 1 Feb 2013 15:34:51 +0000 (15:34 +0000)]
target: rename cortex_m3 to cortex_m

Rename cortex_m3 target to use a more correct cortex_m name.
This also adds a deprecated_name var so that older scripts issue a warning
to update the target name.

cfg files have also been updated to the new target name.

Change-Id: Ia8429f38e88da677249c5caa560c50f8ce56ea10
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1129
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoMention "lpc4300" (with "lpc1800" alias) flash drivers in manual 52/1352/2
Freddie Chopin [Sat, 20 Apr 2013 09:05:32 +0000 (11:05 +0200)]
Mention "lpc4300" (with "lpc1800" alias) flash drivers in manual

Change-Id: I0bb28910b2c07b1ca5bd644e0d88b931d585d3e7
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/1352
Tested-by: jenkins
10 years agocortex_m: remove old target breakpoints/watchpoints 63/1363/2
Spencer Oliver [Thu, 25 Apr 2013 16:13:41 +0000 (17:13 +0100)]
cortex_m: remove old target breakpoints/watchpoints

Sometimes the target may have breakpoint registers set from a previous
debug session, we can either sync them or as we have chosen here clear them.

Change-Id: I439a623ebbf010246a70e5596d04aa7d546da731
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1363
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agokinetis: fix "SF1" parts to limit FlexRAM usage 58/1358/2
Christopher Kilgour [Tue, 23 Apr 2013 02:08:15 +0000 (19:08 -0700)]
kinetis: fix "SF1" parts to limit FlexRAM usage

Ensure FlexRAM usage is limited to half the FlexRAM size when programming.
Assume the FlexNVM sector size is equal to half the FlexRAM.
Fix sector erase checking which had an error introduced when the
  kinetis_ftfx_command( ) signature was changed.

Change-Id: I88edd9c7d4a4ba474cad7b00052feaeedfa8ced8
Signed-off-by: Christopher Kilgour <techie@whiterocker.com>
Reviewed-on: http://openocd.zylin.com/1358
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agobuild: fix libftd2xx regression 55/1355/2
Spencer Oliver [Mon, 22 Apr 2013 14:10:56 +0000 (15:10 +0100)]
build: fix libftd2xx regression

Fix build when targeting closed src ftd2xx drivers.
configure is unable to find the dynamic linking loader lib (dl) as it
is included before ftd2xx library.

Change-Id: Ibe7308b66ed846288a31f7a27ff549b6f39baeec
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1355
Tested-by: jenkins
Reviewed-by: Luca Bruno <lucab@debian.org>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoarm: fix arm reg regression 62/1362/2
Spencer Oliver [Tue, 23 Apr 2013 11:15:07 +0000 (12:15 +0100)]
arm: fix arm reg regression

Seems commit fc2abe63fd3cea7497da7be2955d333bd3f800b9 caused a regression
in that the arm reg cmd no longer worked. The issue was caused because we
changed the value of ARM_MODE_THREAD which was being checked in arm_init_arch_info.

Change-Id: Id571d4ab336d1b0e2b93363147af245d24b65ca5
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1362
Tested-by: jenkins
Reviewed-by: Luca Bruno <lucab@debian.org>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agobuild fix: ft2232 59/1359/2
Oleksij Rempel [Mon, 15 Apr 2013 05:57:40 +0000 (07:57 +0200)]
build fix: ft2232

fix build with-ftd2xx-lib

Change-Id: I4a9b5d204c29b7a0714a59494b2b5f959c73f99b
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/1359
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agogdb server: Fix bug. Parse 'M' packet error. 60/1360/2
Hsiangkai Wang [Tue, 23 Apr 2013 10:42:07 +0000 (18:42 +0800)]
gdb server: Fix bug. Parse 'M' packet error.

The format of 'M' packet is 'M addr,length:XX...'. The data
follows ':' immediately. No need to '+2' to SEPARATOR in
unhexify(), because SEPARATOR points to data correctly.

Change-Id: I15b5758b540816cc727752e7bf68cd45e623f603
Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com>
Reviewed-on: http://openocd.zylin.com/1360
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoUpdate NEWS 56/1356/2
Spencer Oliver [Mon, 22 Apr 2013 15:59:39 +0000 (16:59 +0100)]
Update NEWS

Change-Id: Icfc1245552a400232988cf44f54e5c46af1db873
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1356
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
10 years agoRestore -dev suffix
Freddie Chopin [Sun, 21 Apr 2013 08:32:58 +0000 (10:32 +0200)]
Restore -dev suffix

Change-Id: I3662c5993766a76d6dd62b919c56cc059c4e50d4
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoThe openocd-0.7.0-rc1 release candidate. v0.7.0-rc1
Freddie Chopin [Sun, 21 Apr 2013 07:42:33 +0000 (09:42 +0200)]
The openocd-0.7.0-rc1 release candidate.

Change-Id: I2992c31b56b88062cdd8a8208506a61f6367fcbf
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoAdd "lpc1800" alias for "lpc4300" flash driver 51/1351/3
Freddie Chopin [Sat, 20 Apr 2013 08:39:51 +0000 (10:39 +0200)]
Add "lpc1800" alias for "lpc4300" flash driver

Change-Id: I6d2bb9105cc778bd1d21580022529d684c3b21b0
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/1351
Tested-by: jenkins
10 years agoflash/nor: add lpc4300 variant to lpc2000 driver 26/1126/5
Matt Dittrich [Tue, 5 Feb 2013 16:53:49 +0000 (10:53 -0600)]
flash/nor: add lpc4300 variant to lpc2000 driver

This patch adds flash programming support for internal flash of the
LPC43x2/3/5/7 part, tested on a LPC4337 (also tested on a LPC1768
and LPC2468). It should also work with LPC1800's with onchip flash.
The "base" parameter of the "flash bank" command is now significant
for the lpc4300 variant and required to determine the bank number
parameter needed by the IAP routines.

NOTE: I could only program flash successfully when the chip is powered
with "P2_7" pulled low to put it in ISP mode.  When running from flash
(and not the ISP ROM), the target fails to halt and the sector erase
fails. This is similar to the behavior I remember when trying out the
spifi driver on a LPC4350... lots of power cycles to make progress, one
To burn, one to run.  So I am not confident my config is set up correctly.

Change-Id: I8a75ef1b95cedd5b5898b2dedff477f502fd19f3
Signed-off-by: Matt Dittrich <mdittrich.dev@gmail.com>
Reviewed-on: http://openocd.zylin.com/1126
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
10 years agoImprove HACKING 50/1350/4
Freddie Chopin [Sat, 20 Apr 2013 07:56:06 +0000 (09:56 +0200)]
Improve HACKING

Reword info about creating SSH key - it's not required to add it to
Github account. Mention adding created SSH key to Gerrit account -
without this step it's not possible to access Gerrit in further
steps.

Change-Id: Ibd81521fbe47d4b4beae0b77cdc9d939fd3ee20c
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/1350
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agotelnet: add telnet history support 10/1310/2
Spencer Oliver [Wed, 27 Mar 2013 16:28:31 +0000 (16:28 +0000)]
telnet: add telnet history support

adapted from Yoshinori Sato's patch:
https://github.com/ysat0/openocd/commit/2f07f4600a0da8206612d78c159bbe1171aa41c2

Change-Id: I084b86d316b0aa6e9593f007c024961dbda805e9
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1310
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoSupport newer OSBDM firmware 48/1348/2
R. Steve McKown [Fri, 19 Apr 2013 17:29:59 +0000 (11:29 -0600)]
Support newer OSBDM firmware

OSBDM: add new VID:PID implemented in OSJTAG/OSBDM firmware somewhere
between versions 30.13 and 31.21.  PFLASH programming works with this
patch, tested on a Freescale Kinetis TWR-K20D72M using its onboard OSBDM
JTAG adapter.

Note: flash program testing required hacking kinetis_write() to force
longword programming, as the FTFL program section commands formulated by
kinetis_write() currently fail on this board's PK20DX256VLL7 processor.

Change-Id: Ib7b92ff2fe9ebf6158fb1489f554a19e96cd9651
Signed-off-by: R. Steve McKown <rsmckown@gmail.com>
Reviewed-on: http://openocd.zylin.com/1348
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agostm32f30x: Add boundary scan TAP ID to match silicon 54/1354/2
Andreas Fritiofson [Sat, 20 Apr 2013 15:29:46 +0000 (17:29 +0200)]
stm32f30x: Add boundary scan TAP ID to match silicon

Change-Id: I74ef3cfc437540aedd99da46ac3e0c6cd9c5cd8d
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1354
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agomips: m4k alternate pracc code. Patch 4 96/1196/9
Salvador Arroyo [Wed, 3 Apr 2013 15:12:01 +0000 (17:12 +0200)]
mips: m4k alternate pracc code. Patch 4

Now all the functions with only fetch accesses are modified.
The same delay between scans has been added to mips32_pracc_fastdata_xfer(), it should work
at the same scan rates as the other pracc functions, but it needs higher scan_delays
to work.

Change-Id: Ifb31d8ea6de9d22674385782913d221a2494dbbf
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1196
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agomips: m4k alternate pracc code. Patch 3 95/1195/12
Salvador Arroyo [Sun, 3 Mar 2013 19:11:38 +0000 (20:11 +0100)]
mips: m4k alternate pracc code. Patch 3

Functions mips32_pracc_read_mem(), mips32_cp0_read() and mips32_pracc_read_regs() are now modified.
mips32_cp0_read() is very similar to mips32_read_u32() with one store access.
mips32_pracc_read_regs() is the only function that can not be executed from only one queue.
Now this function is modified to use reg8, it saves all the registers but does not restore reg8.
To remedy this, mips_ejtag_config_step() is called after mips32_save_context() in
mips_m4k_debug_entry(). Function mips_ejtag_config_step() is modified to use reg8 and
restore it from ejtag info instead of using DeSave for save/restore.

Change-Id: Icc224f6d7e41abdec94199483401cb512cc0b450
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1195
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agomips: m4k alternate pracc code. Patch 2 94/1194/11
Salvador Arroyo [Sun, 3 Mar 2013 12:08:42 +0000 (13:08 +0100)]
mips: m4k alternate pracc code. Patch 2

Each pracc function defines a variable ctx of type struct pracc_queue_info.
To simplify the code tree auxiliary functions are defined: pracc_queue_init(), pracc_add() and
pracc_queue_free().
The second parameter in pracc_add() is the store address if the instruction is a store at dmseg,
otherwise it should be 0.
The code is executed by mips32_pracc_queue_exec(). If ejtag_info->mode is 0 mips32_pracc_exec()
is called and it should work like with current code.
To generate the delay between scans the number of clock ticks are calculated with the help of
jtag_get_speed_khz(). Due to delays in the execution of each single ftdi instruction the number of ticks
are higher as it should be, specially at higher scan rates.
mips32_pracc_read_u32() should now work with the new code.

Change-Id: I471590a4fc89b56af10bd46c48767b4c64de154f
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1194
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agomips: m4k alternate pracc code. Patch 1 93/1193/8
Salvador Arroyo [Sun, 3 Mar 2013 09:50:42 +0000 (10:50 +0100)]
mips: m4k alternate pracc code. Patch 1

This patch and the following patches define another way of doing processor access without the need to read back
the pracc address as needed in current pracc code.
Current pracc code is executed linearly and unconditionally. The processor starts execution at 0xff200200
and the fetch address is ever incremented by 4, including the last instruction in the delay slot of the branch to start.
Most of the processor accesses are fetch and some are store accesses.
After a previous patch regarding the way of restoring registers (reg8 and reg9), there are no load processor accesses.
The pracc address for a store depends only on the store instruction given before.
m4k core has a 5 stage pipeline and the memory access is done in the 3rth stage. This means that the store access
will not arrive immediately after a store instruction, it appears after another instruction enters the pipeline.
For reference: MD00249 mips32 m4k manual.
A new struct pracc_queue_info is defined to help each function in generating the code. The field pracc_list holds in the
lower half the list of instructions and in the upper half the store addressess, if any. In this way the list can be used by
current code or by the new one to generate the sequence of pracc accesses.
For every pracc access only one scan to register "all" is used by calling the new function mips_ejtag_add_scan_96().
This function does not call jtag_execute_queue(), all the scans needed can be queued before calling for execution.
The pracc bit is not checked before execution, is checked after the queue has been executed.
Without calling the wait function the code works much faster, but the scan frequency must be limited. For pic32mx
with core clock at 4Mhz works  up to 600Khz and with 8Mhz up to 1200. To increase the scan frequency a delay
between scans is added by calling jtag_add_cloks().
A time delay in nano seconds is stored in scan_delay, a new field in ejtag_info, and a handler is provided for it.
A mode field is added to ejtag_info to hold the working mode. If a time delay of 2ms (2000000 ns) or higher is set,
current code is executed, if lower, new code is executed.
Initial default values are set in function mips32_init_arch_info. A reset does not change this settings.

Change-Id: I266bdb386b24744435b6e29d8489a68c0c15ff65
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1193
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoImprove clone command in README 49/1349/2
Freddie Chopin [Sat, 20 Apr 2013 07:47:41 +0000 (09:47 +0200)]
Improve clone command in README

Without the explicit dir at the end the repository will be cloned to "code".

Change-Id: Icd8b55b4ba74f23b214c3844e2fb785377768119
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/1349
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Tested-by: jenkins
11 years agostm32w: Added sample target configuration for STM32W108 with STLink-V2 47/1347/2
Ben Nahill [Fri, 19 Apr 2013 15:10:04 +0000 (11:10 -0400)]
stm32w: Added sample target configuration for STM32W108 with STLink-V2

As requested, here is the target configuration that I'm using for an
STLink-V2-attached STM32W108C8. For some reason, it only seems to work
with "reset_config trst_only".

Change-Id: Icbff4f83343e1f505d8afdfc53ff6f8b7496cac9
Signed-off-by: Ben Nahill <bnahill@gmail.com>
Reviewed-on: http://openocd.zylin.com/1347
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agotopic: STM32W support added to em357 driver 36/1336/2
Ben Nahill [Wed, 17 Apr 2013 20:46:07 +0000 (16:46 -0400)]
topic: STM32W support added to em357 driver

The em357 driver only supported one page configuration (192k in 96 2048k)
pages. This is fine for em357 chips since that's the size they have, but
ST's STM32W chips (pretty much the same) have different flash
configurations available (64, 128, 192, 256k). I can't find anywhere
that would indicate the size of the chip anywhere in memory so the
selection must be manual, using the 'size' parameter. For backwards
compatibility, any size not known to be in use defaults to the 192k
configuration. I don't have any em357 devices to test, but I also found
that I had to re-assert the FPEC clock enable before performing an
erase. This is a single line and shouldn't break any configurations.

My testing so far has only been with a 64k device with 8k of RAM.

Change-Id: Ic0ac400a9696efaa09d1407dd4a4d456bc2c318b
Signed-off-by: Ben Nahill <bnahill@gmail.com>
Reviewed-on: http://openocd.zylin.com/1336
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
11 years agoprogram: do not poll target after reset run 31/1331/2
Spencer Oliver [Fri, 12 Apr 2013 12:10:35 +0000 (13:10 +0100)]
program: do not poll target after reset run

Disable polling the target before we issue a 'reset run'. This stops errors or
warnings if the target disables the SWD or JTAG interface as part of the
application code.

Change-Id: I5019dffdad41a8e210003ece1caf89069ee0f223
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1331
Tested-by: jenkins
11 years agostlink: fix connect under reset issues 15/1315/2
Spencer Oliver [Thu, 11 Apr 2013 10:15:32 +0000 (11:15 +0100)]
stlink: fix connect under reset issues

We need to make sure that srst is asserted before we attempt to switch into
jtag or swd mode otherwise we receive a error (-9) - invalid device id.

Change-Id: I625166c751cfba8e8a5290f40122bb9afc9dbb39
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1315
Tested-by: jenkins
11 years agoparport: fix parport_toggling_time regression 09/1309/2
Spencer Oliver [Tue, 26 Mar 2013 15:23:16 +0000 (15:23 +0000)]
parport: fix parport_toggling_time regression

If parport_toggling_time is called before the adapter speed has been
configured then the call fails. Probably not the best fix, but does at least
enable parport_toggling_time to be used again.

This regression was added in commit 740b9e25b410c164e661d0334a9ea4168406726b

Change-Id: I90300916d6bda5ef053c557e5ac136c4f002bdd1
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1309
Tested-by: jenkins
11 years agoft2232: remove ft2232_large_scan memory leak 78/1278/3
Andreas Fritiofson [Tue, 19 Mar 2013 13:58:24 +0000 (13:58 +0000)]
ft2232: remove ft2232_large_scan memory leak

This is a very long outstanding issue see:
http://lists.berlios.de/pipermail/openocd-development/2011-June/019404.html

As this driver is deprecated the fix is added to purely to reduce the warnings
reported by clang.

Change-Id: I3a16a704e0e8db27efda50fdcfdd35abf5ebed0f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1278
Tested-by: jenkins
11 years agolibusb: disable debug messages by default 14/1314/2
Spencer Oliver [Tue, 9 Apr 2013 14:40:18 +0000 (15:40 +0100)]
libusb: disable debug messages by default

Change-Id: I15dec0f521502139b57adaff576516af7883a74b
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1314
Tested-by: jenkins
11 years agojimtcl: update embedded jimtcl 11/1311/2
Spencer Oliver [Thu, 28 Mar 2013 09:57:41 +0000 (09:57 +0000)]
jimtcl: update embedded jimtcl

Update to latest jimtcl commit 2c1eba991e21a6f0b531fb0f83e21f9e6ee7c515.
This fixes issues when building on certain versions of Mac OSX.

Change-Id: I551477752d7913c84e6deb60b889d0c14bd200a0
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1311
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
11 years agocfg: Added cfg script for at91sam4sd32x targets 33/1333/2
Peter Dietzsch [Mon, 15 Apr 2013 15:17:08 +0000 (17:17 +0200)]
cfg: Added cfg script for at91sam4sd32x targets

Change-Id: I3b8a54d89a180bfded3dae3f1fe3d940540e6e7d
Signed-off-by: Peter Dietzsch <peter.dietzsch@ib-dt.de>
Reviewed-on: http://openocd.zylin.com/1333
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
11 years agoflash: Added support for at91sam4sd32c 32/1332/2
Peter Dietzsch [Mon, 15 Apr 2013 15:16:30 +0000 (17:16 +0200)]
flash: Added support for at91sam4sd32c

Change-Id: I7223980602d7595a3dd7a3ceaac3f58d4f73f88d
Signed-off-by: Peter Dietzsch <peter.dietzsch@ib-dt.de>
Reviewed-on: http://openocd.zylin.com/1332
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
11 years agoft2232: fix input scan ending in drshift/irshift 49/1049/2
Yann Vernier [Tue, 11 Dec 2012 11:52:24 +0000 (12:52 +0100)]
ft2232: fix input scan ending in drshift/irshift

The final bit was incorrectly added as output data, even if no data was
to be written. Changed it to match handling of other bits.

Change-Id: I91e5ba0c932876bfb579c22e6c7ef0300baa1534
Signed-off-by: Yann Vernier <yann.vernier@orsoc.se>
Reviewed-on: http://openocd.zylin.com/1049
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoarm_adi_v5: fix for csw nonsecure access. 76/1276/3
Michel JAOUEN [Mon, 18 Mar 2013 15:45:40 +0000 (16:45 +0100)]
arm_adi_v5: fix for csw nonsecure access.

Add command to fix CSW_SPROT in register AP_CSW.
This solves dap apmem access in non secure access.

Change-Id: I7cfcb6434d75f5cfd4a2630a059901cdeea010ce
Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-on: http://openocd.zylin.com/1276
Tested-by: jenkins
Reviewed-by: mike brown
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips: code cleanup in cp0 command handlers 90/1190/5
Salvador Arroyo [Sat, 2 Mar 2013 15:20:42 +0000 (16:20 +0100)]
mips: code cleanup in cp0 command handlers

After calling mips32_cp0_read() nothing has been queued, the call to jtag_exec_queue() is unnecessary.

Change-Id: Ie25438045a8e9b6b1b170df7b52609d45f284b5a
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1190
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips: change in restoring debug working register 46/1146/6
Salvador Arroyo [Sun, 24 Feb 2013 16:05:28 +0000 (17:05 +0100)]
mips: change in restoring debug working register

In current devel code there are 3 functions (related to m4k code) that need to restore register 8 from pracc stack:
mips32_pracc_read_u32()
mips32_cp0_read()
mips32_pracc_write_mem_generic()

And mips32_pracc_read_mem() needs to restore regs 8 and 9 from pracc stack.

Values in this registers should be the same as read by mips32_pracc_read_regs() when entering debug
mode and can be modified by mips32_pracc_write_regs() when leaving debug mode.
There is no need to read their values from the processor registers every time.

The fields reg8 and reg9 are added to struct mips_ejtag to store these register values
and the call to mips32_save_context() is shifted in mips_m4k_debug_entry() in order
to store them before any other function needs to restore these registers.
For the same reason in function mips_m4k_step() the call to mips_m4k_set_breakpoint(), if needed,
should be made after calling mips_m4k_debug_entry().
For single word write the number of pracc accesses are now 9 or 8, from 13 or 12 in current code,
single word read takes now 10 instead of 12.

This patch is really the first in a set of patches for an alternate m4k pracc code
much faster that current code. At least for me with pic32mx works fine.

Change-Id: Ibd9df5e8b9f78ce05a180949ba6a561c761b61d6
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1146
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agomips: mips32_pracc_fastdata_xfer() little modification 42/1142/3
Salvador Arroyo [Sat, 23 Feb 2013 21:53:35 +0000 (22:53 +0100)]
mips: mips32_pracc_fastdata_xfer() little modification

In this function after loading the handler code and the jump code there is a call
to wait_for_pracc_rw() to verify that a pracc access is pending.
Next the address is read to verify that the handler is running, the address should be at
fastdata area.
Next, another call is made to wait_for_pracc_rw(). This call is not needed, we now already
that a pracc access is pending.
Better we call this function before loading the end address to be sure it is loaded correctly.

Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Change-Id: If311450ea634786fc28cf1a8e18ed24ce5257d20
Reviewed-on: http://openocd.zylin.com/1142
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agopic32mx: 0 wait state option 41/1141/3
Salvador Arroyo [Sat, 23 Feb 2013 19:00:21 +0000 (20:00 +0100)]
pic32mx: 0 wait state option

By default pic32mx starts after any reset with 1 wait state for RAM access/exec.
It can be changed to 0 wait states by clearing the BMXWSDRM bit (bit 6) in BMXCON register.
With 0 wait states near doubles the execution speed. CRC check sum can be done much faster
increasing verify_image speed. Fast data transfer also works with a bit higher scan rate, up to 1500 Khz.
This option can be set at any time with
mww 0xbf882004 0x40
or cleared with
mww 0xbf882008 0x40.
Some numbers for FTDI/HS with current devel code and a elf file:

Core clock / wait states              verify_image speed
------------------------------------|------------------------------

        4 Mhz    /    1                            21 KiB/s
        4 Mhz    /    0                            36 KiB/s
        8 Mhz    /    1                            37 KiB/s
        8 Mhz    /    0                            57 KiB/s

Change-Id: I4092ad0f3753f72f77108718d0ed3a3ab84e3b23
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1141
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
11 years agopic32mx: false pending at low core clock 39/1139/4
Salvador Arroyo [Sun, 17 Feb 2013 18:23:16 +0000 (19:23 +0100)]
pic32mx: false pending at low core clock

To show up the fail try to step with the core clock set to 31.25Khz
and with a ftdi/hs adapter or with a wiggler, -not with ft2232-.
The scan frequency should be set to 300Khz or higher, at lower frequency probably will not fail.

The code exits with error because the pracc address is at 0x0.

It also fails when using the "all" register, but in this case the code works without any message because the
pracc address is at 0xff202004 when it fails.

I never saw this fail with the core clock set to 500Khz or higher, but ...

The workaround simply puts a 1 ms delay after the execution of the DERET instruction.

Change-Id: I38e8c01a9c39aedd3282140543b83a0844d8ad29
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1139
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoAdded support for ARMv7-M in arm io. 88/1188/6
Henrik Nilsson [Wed, 27 Feb 2013 18:16:47 +0000 (19:16 +0100)]
Added support for ARMv7-M in arm io.

Added support for ARMv7-M targets in arm_nandwrite and
arm_nandread.

Change-Id: Iab1d78d401f735e191c6a8519f3619035a300fae
Signed-off-by: Henrik Nilsson <henrik.nilsson@bytequest.se>
Reviewed-on: http://openocd.zylin.com/1188
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agoAdd abort when JTAG-DP transaction times out. 15/1115/3
Evan Hunter [Thu, 17 Jan 2013 10:23:55 +0000 (18:23 +0800)]
Add abort when JTAG-DP transaction times out.

Fixes system hang for devices that don't ignore
transactions to bad addresses.

Change-Id: Ia98344d7efc12951ef79dbc82b8f792b70a22cee
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/1115
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoarm_adi_v5: fix mem_ap_read_buf_u32() JTAG nastiness.. 77/1277/4
mike brown [Mon, 18 Mar 2013 17:19:14 +0000 (17:19 +0000)]
arm_adi_v5: fix mem_ap_read_buf_u32() JTAG nastiness..

Moved JTAG code out of transport-neutral file (arm_adi_v5.c) into
transport specific file (adi_v5_jtag.c).
Added ap_block_read to dap_ops interface (arm_adi_v5.h) to support
the move.

Change-Id: I796d3984f138aad052b97c77ac9c12ffd1158f74
Signed-off-by: mike brown <mike@theshedworks.org.uk>
Reviewed-on: http://openocd.zylin.com/1277
Tested-by: jenkins
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agogdb server: Fix buffer overrun - sprintf appends a terminating null to the data which... 12/1312/2
Evan Hunter [Tue, 2 Apr 2013 06:35:23 +0000 (17:35 +1100)]
gdb server: Fix buffer overrun - sprintf appends a terminating null to the data which was overrunning the supplied buffer.

Fixes regression introduced in commit 07dcd5648d146d38f9ffa619f0737587e592d0b6

Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Change-Id: Iec64233c0da5a044fb984c4b1803309cb636efe9
Reviewed-on: http://openocd.zylin.com/1312
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoti_icdi: add icdi_usb_query result check 79/1279/2
Spencer Oliver [Tue, 19 Mar 2013 14:14:51 +0000 (14:14 +0000)]
ti_icdi: add icdi_usb_query result check

Change-Id: I0b40586677a77ee6ae46fe120a677616bde22d1e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1279
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
11 years agodocs: update incorrect urls 48/1248/3
Spencer Oliver [Sat, 16 Mar 2013 20:38:38 +0000 (20:38 +0000)]
docs: update incorrect urls

These were missed when git was moved to the new SF platform during Nov 2012.

Change-Id: I7b4ae9dea010d95f9bf4c26841b5b724f41768be
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1248
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
11 years agodocs: remove unnecessary whitespace 45/1245/2
Spencer Oliver [Thu, 14 Mar 2013 22:03:00 +0000 (22:03 +0000)]
docs: remove unnecessary whitespace

Change-Id: I11bad3de145d941b61e9bd4920bc3281ece91ab3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1245
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agodocs: fix html anchor xref links 44/1244/2
Spencer Oliver [Thu, 14 Mar 2013 21:38:19 +0000 (21:38 +0000)]
docs: fix html anchor xref links

makeinfo has a long outstanding bug that means @anchors are not correctly
formatted for split html, see:
http://lists.gnu.org/archive/html/bug-texinfo/2012-06/msg00000.html

The issue relates to using spaces or hyphens in the @anchor name.
Issue also reported via Trac #44

Change-Id: Id72e23375dd167674b2ae5b314e8242b90a72a5f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1244
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agoat91sam3: Wrong PLLA frequency calculations 07/1307/2
Thomas Schmid [Sat, 23 Mar 2013 19:13:46 +0000 (13:13 -0600)]
at91sam3: Wrong PLLA frequency calculations

The command 'at91sam3 info' ignores PLLA DIV values >1. This patch fixes it.
Tested on a SAM3S4C chip.

Change-Id: I051f41bb3dcefe1ac785fbcb48477a807daa16a2
Signed-off-by: Thomas Schmid <thomas.schmid@gmail.com>
Reviewed-on: http://openocd.zylin.com/1307
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
11 years agortos: fixed handling of qThreadExtraInfo packets 08/1308/2
Christian Gudrian [Sun, 24 Mar 2013 11:46:58 +0000 (12:46 +0100)]
rtos: fixed handling of qThreadExtraInfo packets

The commit "gdbserver: use common hexify/unhexify routines" [3d62c3d]
mis-replaced a call to "str_to_hex" with a call to "unhexify". "hexify"
should have been used instead.

Change-Id: I5f5904b1b422f819a6308e2c0740ea43d22c7d0b
Signed-off-by: Christian Gudrian <christian.gudrian@gmx.de>
Reviewed-on: http://openocd.zylin.com/1308
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
11 years agotarget: fix broken Cortex-R4 support 46/1246/2
Spencer Oliver [Fri, 15 Mar 2013 16:59:32 +0000 (16:59 +0000)]
target: fix broken Cortex-R4 support

This regression was caused due to the recent addition of R4 support and
the removal of the bulk_write_memory handler.

Change-Id: Ide692737f235c0e9906becb6f3502ba52c5907aa
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1246
Tested-by: jenkins
11 years agotarget: Retire target_bulk_write_memory() 14/1214/2
Andreas Fritiofson [Fri, 8 Mar 2013 20:13:42 +0000 (21:13 +0100)]
target: Retire target_bulk_write_memory()

The only caller was arm_nandwrite(). Replace that call with
target_write_buffer() instead, which in turn may end up calling the same
bulk_write_memory target API function.

Change-Id: If34c7474df5cf14af3b732fb4774816818f28e79
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1214
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agotarget: Add default implementation of bulk_write_memory 13/1213/2
Andreas Fritiofson [Fri, 8 Mar 2013 00:17:18 +0000 (01:17 +0100)]
target: Add default implementation of bulk_write_memory

Remove dummy implementations from all targets except arm7_9 and mips, which
are the only ones with real implementations. Replace with a single default
implementation simply calling target_write_memory().

Change-Id: I9228104240bc0b50661be20bc7909713ccda2164
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1213
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoarch: Added ARMv7R and Cortex-R4 support 58/358/6
Evan Hunter [Thu, 11 Oct 2012 22:45:33 +0000 (09:45 +1100)]
arch: Added ARMv7R and Cortex-R4 support

Rewrite to merge Cortex-A and Cortex-R code

Change-Id: I4541557980d43d1bba6e8d1bfeb04f536ed25a00
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/358
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoadi_v5: search for Debug and Memory AP support 09/909/6
Evan Hunter [Thu, 11 Oct 2012 22:07:45 +0000 (09:07 +1100)]
adi_v5: search for Debug and Memory AP support

Adds dap_find_ap() function.

Change-Id: I6643025624009b12d4936de67a605da52c07be49
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/909
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agocortex_a : optimize apb read/write access. 03/903/7
Evan Hunter [Tue, 23 Oct 2012 04:48:41 +0000 (15:48 +1100)]
cortex_a : optimize apb read/write access.

Rewrite: Adheres more closely to 'fast read/write' examples in TRM.
up to 50x faster

Change-Id: Ieb4da57d8367628f3e7306827a5b1f0ab550e641
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/903
Tested-by: jenkins
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agojtag: add support for some probes that are mostly compatible with opendous 87/687/10
Stefan Mahr [Tue, 5 Jun 2012 21:22:38 +0000 (23:22 +0200)]
jtag: add support for some probes that are mostly compatible with opendous

This patch adds support for usbprog-jtag and usbvlab that are mostly compatible
to opendous except for IN and OUT endpoints and usb transfer mode.

Change-Id: I44557c2449fe7473295038efa6ae4fc8d80ec7bf
Signed-off-by: Stefan Mahr <stefan.mahr@sphairon.com>
Reviewed-on: http://openocd.zylin.com/687
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agojtag: usb_blaster: fix allocation of usb_blaster_device_desc 24/1224/2
Stefan Mahr [Tue, 12 Mar 2013 10:00:50 +0000 (11:00 +0100)]
jtag: usb_blaster: fix allocation of usb_blaster_device_desc

usb_blaster_device_desc was allocated, but never freed.

Change-Id: I764bd092c71b8c260b98aab0e7a1710fd7bfa9fd
Signed-off-by: Stefan Mahr <stefan.mahr@sphairon.com>
Reviewed-on: http://openocd.zylin.com/1224
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
11 years agojtag: parport: avoid freeing read-only memory section 23/1223/2
Stefan Mahr [Tue, 12 Mar 2013 09:43:21 +0000 (10:43 +0100)]
jtag: parport: avoid freeing read-only memory section

If command parport_cable is not executed, parport_cable points to
const char array in read-only memory as default. On exit free()
will try to free this read-only memory. This patch uses strdup to
allocate memory when defining default setting.

Change-Id: I290e707ac6a37e9dc1b45c85ca51d8bd6aac6761
Signed-off-by: Stefan Mahr <stefan.mahr@sphairon.com>
Reviewed-on: http://openocd.zylin.com/1223
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agojtag: opendous: fix tap buffer overflow 16/1216/2
Stefan Mahr [Sat, 9 Mar 2013 16:50:54 +0000 (17:50 +0100)]
jtag: opendous: fix tap buffer overflow

Appending bits to TAP buffer doesn't check if there's enough space left.
This patch adds this check to fix TAP overflow error.

Change-Id: If80d5ab4a24983ad24f3cab31f9676d1590ebf5d
Signed-off-by: Stefan Mahr <stefan.mahr@sphairon.com>
Reviewed-on: http://openocd.zylin.com/1216
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agotarget: Remove read_memory_imp 19/1219/2
Andreas Fritiofson [Sun, 10 Mar 2013 13:39:31 +0000 (14:39 +0100)]
target: Remove read_memory_imp

Change-Id: Idc6ef3b075ccbb5945df8fea746011cb17175d8f
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1219
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agotarget: Remove write_memory_imp 18/1218/2
Andreas Fritiofson [Sun, 10 Mar 2013 12:16:14 +0000 (13:16 +0100)]
target: Remove write_memory_imp

Change-Id: I5d933bc19443bba8a0193c90471fdd0614324a92
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1218
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agotarget: Remove soft_reset_halt_imp 17/1217/2
Andreas Fritiofson [Sun, 10 Mar 2013 11:50:29 +0000 (12:50 +0100)]
target: Remove soft_reset_halt_imp

Change-Id: I12c907584ef73de570eba2dcfeb8477cabc6098f
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1217
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agodoc: opendous interface based on ft2232H 98/1098/4
Rodrigo Melo [Thu, 27 Dec 2012 22:50:52 +0000 (19:50 -0300)]
doc: opendous interface based on ft2232H

It was listed in the ft2232 based cables supported. Moreover, the
ft2232_channel option, which was added to support this cable, was explained.

Change-Id: I82ebc7bc10d6472f96ab150e78d623a617edccd2
Signed-off-by: Rodrigo Melo <rmelo@inti.gob.ar>
Reviewed-on: http://openocd.zylin.com/1098
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agointerface: opendous_ftdi config file added 96/1096/4
Rodrigo Melo [Thu, 27 Dec 2012 22:37:15 +0000 (19:37 -0300)]
interface: opendous_ftdi config file added

This config file add support to the opendous cable based on the chip ft2232H,
using the ft2232 interface driver.

Change-Id: I8171a0c475af8d61e081844ee86466a392138fb0
Signed-off-by: Rodrigo Melo <rmelo@inti.gob.ar>
Reviewed-on: http://openocd.zylin.com/1096
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoft2232: ft2232_channel option added 95/1095/5
Rodrigo Melo [Thu, 27 Dec 2012 22:31:21 +0000 (19:31 -0300)]
ft2232: ft2232_channel option added

With this option a different channel of the ft2232 chip can be selected using
a previously existing layout. It was made for a partner called Salvador
Tropea.

Change-Id: Ia0dedb2f50e232d089e73788735edc8f47ee23e6
Signed-off-by: Rodrigo Melo <rmelo@inti.gob.ar>
Reviewed-on: http://openocd.zylin.com/1095
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agodoc: Added MIPS target document 04/904/7
Drasko DRASKOVIC [Sun, 7 Oct 2012 22:41:36 +0000 (00:41 +0200)]
doc: Added MIPS target document

This document explains MIPS EJTAG operations
implementations within OpenOCD.

Change-Id: Ieaf01f8bc5a97d7b0f2c847bac5fbb2ccf8ba088
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Reviewed-on: http://openocd.zylin.com/904
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoKinetis: Flash command function matches datasheet 92/1192/6
Alex Austin [Sun, 3 Mar 2013 10:08:18 +0000 (04:08 -0600)]
Kinetis: Flash command function matches datasheet

The kinetis datasheets specify the flash registers as bytes rather
than as words, as the previous implementation did.  This also makes
a few code sections slightly less endian-magical.

Change-Id: If8f4adfc7f4341085ae5b6eacbf7d74bbd74cf08
Signed-off-by: Alex Austin <alex.austin@spectrumdsi.com>
Reviewed-on: http://openocd.zylin.com/1192
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoKinetis: Symbolic names for Addresses and Commands 91/1191/6
Alex Austin [Sun, 3 Mar 2013 01:19:15 +0000 (19:19 -0600)]
Kinetis: Symbolic names for Addresses and Commands

Change-Id: I2165b66c37bd1608139b5dd00f48124161e13ef0
Signed-off-by: Alex Austin <alex.austin@spectrumdsi.com>
Reviewed-on: http://openocd.zylin.com/1191
Tested-by: jenkins
Reviewed-by: Christopher Kilgour <techie@whiterocker.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agodocs: add gerrit http password url 07/1207/3
Spencer Oliver [Thu, 7 Mar 2013 12:12:26 +0000 (12:12 +0000)]
docs: add gerrit http password url

Add url to show where the http password is configured.
Also add note that password can also be saved to url git config.

Change-Id: I3c1a022580e5f73372b0c50e8d1d2f0b1498966f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1207
Tested-by: jenkins
11 years agotcl: add flash programming helper 99/1199/3
Spencer Oliver [Wed, 6 Mar 2013 15:29:15 +0000 (15:29 +0000)]
tcl: add flash programming helper

This adds a program proc that simplifies using OpenOCD as a standalone
programmer.

Change-Id: I6ece492cd878c170b734e8bb2e09fe8c4557d5a6
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1199
Tested-by: jenkins
Reviewed-by: Jörg Fischer <turboj@gmx.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
11 years agortos: fixes warning 09/1209/3
Øyvind Harboe [Thu, 7 Mar 2013 11:56:19 +0000 (12:56 +0100)]
rtos: fixes warning

Change-Id: I45db15b16b52c71009d8830985f42ac88eabe160
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/1209
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
11 years agogdb: use stdio functions to convert parameters 28/1128/4
Spencer Oliver [Thu, 7 Mar 2013 16:00:45 +0000 (16:00 +0000)]
gdb: use stdio functions to convert parameters

This reduces the number of gdb conversion routines we have to maintain.

Change-Id: Ia43d6cac86cbe4f76fe0875b9d9c16ac340296db
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1128
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agointerface: opendous_ftdi config file added 97/1097/4
Rodrigo Melo [Thu, 27 Dec 2012 22:39:46 +0000 (19:39 -0300)]
interface: opendous_ftdi config file added

This config file add support to the opendous cable based on the chip ft2232H,
using the ftdi interface driver.

Change-Id: I4491f99d7b14f7078a04583ef0c4acd8692c4349
Signed-off-by: Rodrigo Melo <rmelo@inti.gob.ar>
Reviewed-on: http://openocd.zylin.com/1097
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agodocs: use doxygen keywords for formatting 10/1210/2
Spencer Oliver [Thu, 7 Mar 2013 12:21:46 +0000 (12:21 +0000)]
docs: use doxygen keywords for formatting

Rather than use bold fonts etc, use the correct keywords so doxygen formats
better.

Change-Id: Id9d63f0fc3465665376d7a536c4d6da71998f40e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1210
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
11 years agocfg: add Netgear DG834v3 configuration 89/1189/2
Spencer Oliver [Thu, 28 Feb 2013 15:39:15 +0000 (15:39 +0000)]
cfg: add Netgear DG834v3 configuration

Change-Id: I3f4880d8b07b9623544b94d316b37e6d0ae97020
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1189
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
11 years agoflash: fix stm32 failed probe using incorrect flash size 87/1187/2
Spencer Oliver [Wed, 27 Feb 2013 12:48:11 +0000 (12:48 +0000)]
flash: fix stm32 failed probe using incorrect flash size

This fixes an issue if the device is manually probed after the initial probe
fails due to being unable to read flash size register. In this situation the
driver assumes the user has overridden the flash size when infact this may
not be the case.

It also seems on the older stm32f1 devices the flash register is not readable
when locked, this does not seem to apply to the newer parts - f0, f3, f4.

Change-Id: I125f872fcb2d962ca6705f97b62d957e2b31303b
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1187
Tested-by: jenkins
Reviewed-by: Johan Almquist <johan.almquist@assaabloy.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agostm32: update stm32f1x driver for f0x and f3x option bytes 84/1184/2
Spencer Oliver [Tue, 26 Feb 2013 11:57:02 +0000 (11:57 +0000)]
stm32: update stm32f1x driver for f0x and f3x option bytes

The stm32f0 and stm32f3 share the same option byte location, but the format
differs.

Adding an option_offset fixes the broken options_read cmd and incorrectly
setting Hardware Watchdog when unlocking a f3x device.

Change-Id: I82d66b6198294ea9eedb44ca8b2fb368c0cb15e8
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1184
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agoti-icdi: catch failed icdi_send_cmd 80/1180/2
Spencer Oliver [Mon, 25 Feb 2013 15:45:12 +0000 (15:45 +0000)]
ti-icdi: catch failed icdi_send_cmd

warnings detected by clang.

Change-Id: I1532bcc12a8ab7446646dfb2a7afa8894ff03679
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1180
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
11 years agocfg: add basic support of Freescale i.MX6 series targets 35/1135/2
Vladimir Zapolskiy [Fri, 8 Feb 2013 00:12:49 +0000 (02:12 +0200)]
cfg: add basic support of Freescale i.MX6 series targets

This change adds a simple target configuration for Freescale
single/dual/quad core i.MX6 SoCs, only one core is configured by default.

Change-Id: I853dd27f4c6765b7f731be2ddea82e85d496c6a4
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-on: http://openocd.zylin.com/1135
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agotarget: use common target_name to access target::cmd_name member 82/1182/2
Spencer Oliver [Mon, 25 Feb 2013 16:52:00 +0000 (16:52 +0000)]
target: use common target_name to access target::cmd_name member

Change-Id: I203b89ef25a072c3b00b504483d5f2a83477fad6
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1182
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
11 years agospeed up ftdi by reorder to out-in 42/942/3
Peter Henn [Sun, 28 Oct 2012 21:08:37 +0000 (22:08 +0100)]
speed up ftdi by reorder to out-in

When the ftdi driver calls finally the mpsse_flush function, it first
initiate the USB in and finally the corresponding USB out transaction.
Because data in is requested too early the USB device will always answer
the first USB in by a NAK. That can prevented by a simple reordering of
the out and then the in transfer and can improve the Jtag performance for
high JTAG clock rates.

Change-Id: I17abf1487c914c92e2e447ee6d30562ef629f327
Signed-off-by: Peter Henn <Peter.Henn@web.de>
Reviewed-on: http://openocd.zylin.com/942
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
11 years agoChange reset configuration. 86/1186/3
Mathias K [Wed, 27 Feb 2013 13:01:21 +0000 (14:01 +0100)]
Change reset configuration.

This patch change the default reset config from SYSRESETREQ to the working
VECTRESET.

Change-Id: I21a9a74b9c0c68cfa3a6e6dac9b123acc98a93cb
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/1186
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
11 years agoMove back off timer to target struct 79/1179/4
Mathias K [Mon, 25 Feb 2013 17:15:15 +0000 (18:15 +0100)]
Move back off timer to target struct

Move the global target back off timer to the target struct. This will
fix the wrong error handling with multi target devices like smp systems.

Change-Id: Ia327182ed5d13ca87323700017a8c40ecc6b25a3
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/1179
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
11 years agoAdd the target name to debug output for better understanding and error identification. 78/1178/4
Mathias K [Mon, 25 Feb 2013 17:12:30 +0000 (18:12 +0100)]
Add the target name to debug output for better understanding and error identification.

Change-Id: I1054debea6cd3a6548aadeae2d84000a0039814e
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/1178
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>

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)