openocd.git
5 years agoAdd CMSIS-DAP information to the READMEs. 80/1880/2
Paul Fertser [Fri, 17 Jan 2014 11:25:53 +0000 (15:25 +0400)]
Add CMSIS-DAP information to the READMEs.

Change-Id: I8c87d559adf07b0f0702fe9d388f26bf046bcb8b
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1880
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agogdb_server: check for invalid read memory requests 53/1853/3
Paul Fertser [Mon, 6 Jan 2014 17:36:21 +0000 (21:36 +0400)]
gdb_server: check for invalid read memory requests

This prevents invalid free(NULL) (that crashes OpenOCD on desktop
distros).

With radare2 it's now a bit more useful, memory access works if I seek
to the correct address, can't test further as it apparently lacks thumb2
support.

Change-Id: I6ec32d09fd52dab53ba765d7f7519baa1f55d973
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1853
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoRetire jtag_add_dr_out 01/1801/2
Andreas Fritiofson [Wed, 6 Nov 2013 23:40:50 +0000 (00:40 +0100)]
Retire jtag_add_dr_out

The out only version of jtag_add_dr_scan smells like a bogus optimization
that complicates the minidriver API for questionable gain.

The function was only used by four old ARM targets. Rewrite the callers
to use the generic function and remove all implementations.

Change-Id: I13b643687ee8ed6bc9b6336e7096c34f40ea96af
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1801
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agojtag/drivers: add USB-Blaster II 91/1791/8
Franck Jullien [Sun, 3 Nov 2013 16:31:44 +0000 (17:31 +0100)]
jtag/drivers: add USB-Blaster II

This patchs adds a new access driver for the existing
USB-Blaster interface driver.

This interface (as it is build-in on the sockit development
board) is composed of a Cypress EZ-USB plus a CPLD.

The Cypress chip as an embedded 8051 microcontroller.
When it's powered up, the firmware is downloaded to the
chip then the device is disconnected and reconnected with
the new firmware.

The USB-Blaster II protocol is almost identicial to
the old one. The only difference is that you need to
send a 0x5F before read TDO back. This command
seems to copy TDO buffer datas to the endpoint buffer.

Driver will be auto enabled if libusb-1.0 is detected.

Change-Id: I562a720a68cb4dcabeab791947d5d38776cb70fa
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-on: http://openocd.zylin.com/1791
Tested-by: jenkins
Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agocfg: add Freescale FRDM-KL46Z Board 66/1866/2
Spencer Oliver [Sat, 11 Jan 2014 23:14:13 +0000 (23:14 +0000)]
cfg: add Freescale FRDM-KL46Z Board

Change-Id: Ib585728f13a380eeeb2ada095f3e1a1c2aaf44cb
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1866
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
5 years agotarget: fix typos 64/1864/2
Spencer Oliver [Sat, 11 Jan 2014 22:17:33 +0000 (22:17 +0000)]
target: fix typos

Change-Id: Icdb517224e8bcf41a16498088e09955048077d35
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1864
Tested-by: jenkins
Reviewed-by: Bill Traynor <btraynor@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
5 years agocortexm: use Cortex-M rather than cortex-m3 for dwt registers 65/1865/3
Spencer Oliver [Mon, 13 Jan 2014 09:53:32 +0000 (09:53 +0000)]
cortexm: use Cortex-M rather than cortex-m3 for dwt registers

Change-Id: I28e3a8c65ccc4a4e3ec94e41c846e6a263c165e8
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1865
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
5 years agoConform to C99 integer types format specifiers 94/1794/5
Hsiangkai Wang [Mon, 4 Nov 2013 04:43:12 +0000 (12:43 +0800)]
Conform to C99 integer types format specifiers

Review and modify to conform to C99 integer types format specifiers.
Use arm-none-eabi toolchain to build successfully.

Change-Id: If855072a8f88886809309155ac6d031dcfcbc4b2
Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com>
Signed-off-by: Hsiangkai <hsiangkai@gmail.com>
Reviewed-on: http://openocd.zylin.com/1794
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoGrammatical cleanup to Tcl Scripting chapter of User's Guide 72/1872/4
Robert P. J. Day [Mon, 13 Jan 2014 11:49:33 +0000 (06:49 -0500)]
Grammatical cleanup to Tcl Scripting chapter of User's Guide

Changes solely to the Tcl Scripting API chapter of the UG:

* Some grammatical cleanup
* Fix formatting issues (@example and @verbatim formatting)
* Add references to missing OSes OpenBSD, NetBSD and eCos.

Change-Id: I3ec1a192a0b1e0a207dceb76fd39008d01e287a5
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-on: http://openocd.zylin.com/1872
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoAtmel samd: add support for SAMD21 73/1873/2
Andrey Yurovsky [Mon, 23 Dec 2013 18:27:28 +0000 (10:27 -0800)]
Atmel samd: add support for SAMD21

Tested with SAMD21J18A on the SAMD21 Xplained Pro board.

Change-Id: Ice9ebcd229ed038b3193baf92d910f9256d7ce91
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/1873
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agocortex_m: Avoid unnecessary saving and restoring of DCRDR 48/1848/3
Andreas Fritiofson [Sun, 29 Dec 2013 20:59:36 +0000 (21:59 +0100)]
cortex_m: Avoid unnecessary saving and restoring of DCRDR

This is used for the emulated DCC channel which is only maintained as long
as target->dbg_msg_enabled is set. Skip the saving and restoring if not
enabled to save one dap_run() per core register access.

Note that we could've probably queued all core register accesses in the
same transaction if the armv7 register framework hadn't required
synchronous register accesses.

Change-Id: I4fe6d713261ee5db42422203eb63035fdcc48891
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1848
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoadi_v5: Remove unnecessary MEM-AP access functions 47/1847/2
Andreas Fritiofson [Sun, 29 Dec 2013 20:14:58 +0000 (21:14 +0100)]
adi_v5: Remove unnecessary MEM-AP access functions

It's far nicer to pass a size parameter than to split the calls to
separate wrappers which are combined to a single function anyway.

Change-Id: I716741ebf916f6f8e9358a31c8f4fe761107c82f
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1847
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agocortex_m: Fix possible endianness problem in emulated DCC channel 46/1846/2
Andreas Fritiofson [Sun, 29 Dec 2013 20:12:30 +0000 (21:12 +0100)]
cortex_m: Fix possible endianness problem in emulated DCC channel

Change-Id: If7104464a8c65085f3ceac445e9c9be8446f2da9
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1846
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotarget: Add test bench for memory access functions 29/1629/5
Andreas Fritiofson [Sun, 29 Dec 2013 14:22:39 +0000 (15:22 +0100)]
target: Add test bench for memory access functions

Change-Id: I86e6fe4d0b4d580389ae5e1d3f4813d1e25b2613
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1629
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agolpc2000: fix LPC810 programming support 43/1843/2
Nemui Trinomius [Fri, 27 Dec 2013 03:25:33 +0000 (12:25 +0900)]
lpc2000: fix LPC810 programming support

IAP commands fail on programming LPC810 because it has only 1kByte of SRAM.
This patch is fixing cmd51_max_buffer suitable size for LPC810,LPC811 and
other LPC1000 series.
Tested on a LPC810,LPC812,LPC11u14,and LPC1114(DIP28).

Change-Id: Iecec9fd963cb63bdff4a7bd3bbf4f8b1a7c60fbd
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/1843
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoA few more grammar and typo fixes from the User's Guide. 63/1863/2
Robert P. J. Day [Sat, 11 Jan 2014 10:35:49 +0000 (05:35 -0500)]
A few more grammar and typo fixes from the User's Guide.

More cleanup from some of the later chapters from the User's Guide,
no functional changes.

Change-Id: Ib2860fc2574503e8107935d79db45fa96014fe3a
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-on: http://openocd.zylin.com/1863
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoRemove obsolete tip referring to 2010 removal of TAP numbers. 62/1862/2
Robert P. J. Day [Sat, 11 Jan 2014 09:42:35 +0000 (04:42 -0500)]
Remove obsolete tip referring to 2010 removal of TAP numbers.

Remove a tip describing the discouraged use of TAP numbers, and how
these numbers would be removed by mid-2010.

Change-Id: Iebe7e2e4a0f8e1f18a91d7935588dd9ced2b398d
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-on: http://openocd.zylin.com/1862
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoProofreading, typo and grammar fixes to Ch 10 User's Guide. 61/1861/2
Robert P. J. Day [Fri, 10 Jan 2014 17:15:52 +0000 (12:15 -0500)]
Proofreading, typo and grammar fixes to Ch 10 User's Guide.

Various cleanups to Chapter 10 of the User's Guide, no functional
changes.

Change-Id: I055d032eacc8e85b1d8edbd4bcc505f6f0feaa49
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-on: http://openocd.zylin.com/1861
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoSome minor URL fixes and typo fixes, no functional changes. 59/1859/2
Robert P. J. Day [Thu, 9 Jan 2014 16:09:48 +0000 (11:09 -0500)]
Some minor URL fixes and typo fixes, no functional changes.

Change-Id: Ib262d9e6330c35d26868942b821de7b53e00b854
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-on: http://openocd.zylin.com/1859
Tested-by: jenkins
Reviewed-by: Bill Traynor <btraynor@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoadd support for Atmel SAMD NOR Flash 84/1684/8
Andrey Yurovsky [Fri, 4 Oct 2013 03:41:33 +0000 (20:41 -0700)]
add support for Atmel SAMD NOR Flash

This adds a new NOR Flash driver, "at91samd", which supports the
built-in Flash on Atmel's D-series Cortex M MCUs, starting with the D20.
Parts and their geometry are detected automatically using the DSU and
lookup schemes described in the D20 document, 42129F–SAM–10/2013.
Future D-series variants and families should presumably use this
controller as well (possibly with minor changes and improvements).

Tested on the SAMD20 Xplained Pro board, for which we also add the
corresponding Flash configuration.

Change-Id: Id8d3dd601e9f53121682d1a1190d0be4ea3b83eb
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/1684
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoadd support for Atmel SAM4L NOR Flash 39/1639/13
Andrey Yurovsky [Thu, 19 Sep 2013 20:59:09 +0000 (13:59 -0700)]
add support for Atmel SAM4L NOR Flash

This adds a new NOR Flash driver, "at91sam4l", which supports the
built-in Flash on Atmel's low-power SAM4L family of Cortex M4 MCUs.
Parts and their geometry are detected automatically using the Chip ID
and lookup schemes described in document 42023E–SAM–07/2013.

Tested on AT91SAM4LC4CA via the SAM4L XPlained Pro development kit.

Change-Id: If73499dee92cc8ce231845244ea25c6984f6cecd
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/1639
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agocfg: add initial Atmel xplained kit support 25/1625/9
Spencer Oliver [Mon, 4 Nov 2013 21:24:39 +0000 (21:24 +0000)]
cfg: add initial Atmel xplained kit support

These kits feature a CMSIS-DAP compliant debugger and so have been added
as part of the pending support.

Currently the flash drivers for the L8 and D20 are wip.

One issue this implementation of CMSIS-DAP raised is that it supports
512byte HID reports, however using the current HIDAPI we have no cross platform
way of querying this info. Long term we plan to add this support to HIDAPI.

Change-Id: Ie8b7c871f58a099d963cd71a9f8a0105a38784e9
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1625
Tested-by: jenkins
5 years agocfg: add stm32 cmsis-dap compliant config 43/1543/16
Spencer Oliver [Tue, 6 Aug 2013 12:12:10 +0000 (13:12 +0100)]
cfg: add stm32 cmsis-dap compliant config

Change-Id: I3cfb21fdcef830e22b03bf4b5d58993728cc7475
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1543
Tested-by: jenkins
5 years agocmsis-dap: add initial cmsis-dap support 42/1542/19
Spencer Oliver [Thu, 19 Dec 2013 21:33:19 +0000 (21:33 +0000)]
cmsis-dap: add initial cmsis-dap support

This is based on work from:
https://github.com/TheShed/OpenOCD-CMSIS-DAP/tree/cmsis-dap

Main changes include moving over to using HIDAPI rather than libusb-1.0
and cleaning up to merge into master. Support for reset using srst has
also been added.

It has been tested on all the mbed boards as well as the Freedom board
from Freescale. These boards only implement SWD mode, however JTAG mode
has been tested with a Keil ULINK2 and a stm32 target - but requires a lot
more work.

Change-Id: I96d5ee1993bc9c0526219ab754c5aad3b55d812d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/1542
Tested-by: jenkins
5 years agocommand: Fix formatting for empty usage string 58/1858/2
Andreas Fritiofson [Wed, 8 Jan 2014 15:56:30 +0000 (16:56 +0100)]
command: Fix formatting for empty usage string

Introduced by requirement in 54d6330b.

Change-Id: If3dba057127b54b15ca7f364f37c6286d34f77e0
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-on: http://openocd.zylin.com/1858
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotcl/netgear-dg834v3.cfg: add to easy firmware recovery list 51/1851/5
Paul Fertser [Mon, 30 Dec 2013 19:09:51 +0000 (23:09 +0400)]
tcl/netgear-dg834v3.cfg: add to easy firmware recovery list

Change-Id: I6e5205ec41c58dc2fe3fb0051c30918507ef1e88
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1851
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotools: add firmware recovery helpers 50/1850/5
Paul Fertser [Mon, 30 Dec 2013 18:33:43 +0000 (22:33 +0400)]
tools: add firmware recovery helpers

This adds a set of helper functions with the aim to make it possible
to flash mass-market devices without RTFMing altogether (i.e. to
obsolete GPL-violating proprietary tjtag and other similar software).

Real-life tested on an RT-N16 and WRT54GL.

Change-Id: I197a9b28a5f386803f081057c4b4ebf2f9c447b1
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1850
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotcl/board: add Linksys WRT54GL v1.1 board config 52/1852/3
Paul Fertser [Tue, 31 Dec 2013 15:07:47 +0000 (19:07 +0400)]
tcl/board: add Linksys WRT54GL v1.1 board config

Tested flashing a real v1.1 device.

Change-Id: Ie0d202b9fded8b92e731d93e0ef17be415a75fc8
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1852
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotcl: add bcm47xx config and Asus RT-N16 board using it 49/1849/2
Paul Fertser [Mon, 30 Dec 2013 18:26:36 +0000 (22:26 +0400)]
tcl: add bcm47xx config and Asus RT-N16 board using it

This adds the bcm47xx config with the special undocumented trick to
put it into standard EJTAG mode from the mystic "LV mode".

The RAM setup is not done as it would require considerable efforts
without much practical gain.

The only issue I noticed so far is that "reset" doesn't actually reset
the chip.

Unfortunately, it's unclear how to make it work properly with SRST as
OpenOCD asserts it in MIPS-specific code so the device will enter LV
mode again but the LV tap is already disabled by that time, so it's
not possible to send the magic command again.

Anyway, this config is more than enough to "recover" any RT-N16
provided the hardware is not damaged.

Change-Id: I0894e339763e6d20d1c93341c597382b479d039b
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1849
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoAllow "tcl_port" to be run after config to simply display the port. 57/1857/2
Robert P. J. Day [Wed, 8 Jan 2014 16:43:25 +0000 (11:43 -0500)]
Allow "tcl_port" to be run after config to simply display the port.

To be consistent with gdb_port and telnet_port, allow tcl_port
to be run to display the configured port number, while still
not allowing the user to change it after configuration.

Change-Id: Ibe6aedb3bd447f2985e42dd8246358481a047dd6
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-on: http://openocd.zylin.com/1857
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoUpdate URLs and names in amdm37x.cfg, no functional changes. 56/1856/2
Robert P. J. Day [Wed, 8 Jan 2014 16:22:01 +0000 (11:22 -0500)]
Update URLs and names in amdm37x.cfg, no functional changes.

* openocd.berlios.de -> openocd.sourceforge.net
* Update link to AM/DM37x Technical Reference Manual (ver R)
* "ICEpick" is properly spelled "ICEPick" according to TI

Change-Id: Ie04458e82c97ef766ec03bd9b9f27edadf5d1cb2
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-on: http://openocd.zylin.com/1856
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoNumerous pedantic fixes to the User's Guide, including typo fixes, 55/1855/2
Robert P. J. Day [Wed, 8 Jan 2014 15:17:56 +0000 (10:17 -0500)]
Numerous pedantic fixes to the User's Guide, including typo fixes,
grammar fixes and so on.

Change-Id: Iaeb603447ecd9f77f1d49ce77044431442f4f219
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-on: http://openocd.zylin.com/1855
Reviewed-by: Bill Traynor <btraynor@gmail.com>
Tested-by: jenkins
Reviewed-by: Francois Lorrain <francois.lorrain@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agojtag_vpi: make the server address configurable 40/1840/5
Franck Jullien [Sun, 29 Dec 2013 15:18:51 +0000 (16:18 +0100)]
jtag_vpi: make the server address configurable

Change-Id: I58e89c789b79ffb0b54ef94d208be876c271ddf7
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-on: http://openocd.zylin.com/1840
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotarget/image: allow for comments in IHEX files 42/1842/2
Franck Jullien [Tue, 24 Dec 2013 09:07:14 +0000 (10:07 +0100)]
target/image: allow for comments in IHEX files

This is not in the Intel hex file format specification but
some hex files may include comments (i.e. Altera USB-Blaster II
firmware) starting with '#'.

This patch makes image_ihex_buffer_complete_inner to skip
comment lines.

Change-Id: Id1f57d84d75da45e592f1c72b2b8c29193bc14e3
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-on: http://openocd.zylin.com/1842
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotopic: Added Spansion S25FL128S and S25FL256S spifi devices. 44/1844/2
Steve Moorby [Sat, 28 Dec 2013 15:23:41 +0000 (15:23 +0000)]
topic: Added Spansion S25FL128S and S25FL256S spifi devices.

S25FL256S device tested on mbest LPC4357 EVM, S25S128S untested but
from the same data sheet.

Change-Id: Idf58416aab08671fe29d22c3c34c2118b25a9d45
Signed-off-by: Steve Moorby <steve.moorby60@gmail.com>
Reviewed-on: http://openocd.zylin.com/1844
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
5 years agokinetis : Add timeouts to flash status checking in dap_syssec_kinetis_mdmap(). 19/1819/2
Per Ekman [Fri, 29 Nov 2013 07:11:44 +0000 (08:11 +0100)]
kinetis : Add timeouts to flash status checking in dap_syssec_kinetis_mdmap().

Change-Id: Ifc8fe7aa4c2a40a78fa0655435e82418f549bad3
Signed-off-by: Per Ekman <pekenator@gmail.com>
Reviewed-on: http://openocd.zylin.com/1819
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agostlink: remove stlink_api command 60/1760/4
Mathias K [Sun, 10 Nov 2013 08:13:53 +0000 (09:13 +0100)]
stlink: remove stlink_api command

Remove stlink_api command.

Change-Id: I8f7885d3756fec462f9ebbee2ed285a98a51366c
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/1760
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agokinetis : Detect MCU flash parameters based on the SDID register. 23/1823/2
Per Ekman [Fri, 29 Nov 2013 10:30:07 +0000 (11:30 +0100)]
kinetis : Detect MCU flash parameters based on the SDID register.

Try to detect the flash parameters based on the MCU SDID register. The hope
is that this works for K and KL series MCUs but it has only been tested on
a K21. YMMV.

Change-Id: Idfe71383a449065267f393b09ee3c3b24ac6a803
Signed-off-by: Per Ekman <pekenator@gmail.com>
Reviewed-on: http://openocd.zylin.com/1823
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoAdd %APPDATA%\OpenOCD to script search path on win 97/1797/2
Andreas Fritiofson [Tue, 30 Jul 2013 20:56:57 +0000 (22:56 +0200)]
Add %APPDATA%\OpenOCD to script search path on win

Change-Id: I01e9715fe064f3ff41e41a59a4764d6474f82183
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1797
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoRemove special handling of script search path on Windows 96/1796/2
Andreas Fritiofson [Sat, 27 Jul 2013 15:27:01 +0000 (17:27 +0200)]
Remove special handling of script search path on Windows

On all platforms, search for scripts in
$HOME/.openocd
${run_prefix}${pkgdatadir}/site
${run_prefix}${pkgdatadir}/scripts

On Windows, set run_prefix to the runtime path of the executable, minus
${bindir}. This is to enable the install dir to be moved anywhere, as long
as the structure of the install dir is kept intact. On all other platforms,
run_prefix is empty.

The script paths can now be adjusted on Windows builds the normal way; by
overriding pkgdatadir at build time. For example, to create a Windows
package layout of

bin/openocd.exe
scripts/interface/...
scripts/target/...

you can do
configure --prefix= --enable-... and then
make pkgdatadir= DESTDIR=/some/path clean all install

Also, remove the unused PKGLIBDIR define.

Change-Id: If2c8228fc80c598d763efad21c5f51695ff9b6cf
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1796
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotarget/imx6: Fix typo in setting _SJC_TAPID from SJC_TAPID variable 11/1811/2
Alex Murray [Tue, 19 Nov 2013 22:47:04 +0000 (09:17 +1030)]
target/imx6: Fix typo in setting _SJC_TAPID from SJC_TAPID variable

The set command was missing the $ prefix on the SJC_TAPID variable
and so would fail if SJC_TAPID was set

Change-Id: Ib9af58f5188bd8a2bc3f888309f203d624476c27
Signed-off-by: Alex Murray <alex.murray@cohdawireless.com>
Reviewed-on: http://openocd.zylin.com/1811
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoAvoid 'may be used uninitialized' warning from FreeBSD base GCC 35/1835/2
Ed Maste [Wed, 18 Dec 2013 16:18:14 +0000 (11:18 -0500)]
Avoid 'may be used uninitialized' warning from FreeBSD base GCC

Change-Id: Ice2472bf7a467652485a5a8c36880c6a47d64c6c
Signed-off-by: Ed Maste <emaste@freebsd.org>
Reviewed-on: http://openocd.zylin.com/1835
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agobuild: remove hard coded ftdi and usb libraries 59/1759/13
Mathias K [Wed, 30 Oct 2013 15:52:10 +0000 (16:52 +0100)]
build: remove hard coded ftdi and usb libraries

This patch remove the hardcoded libraries. Also a check for
libftdi1 installations was added. This check fix an issue
with gentoo and maybe other systems.

Change-Id: Ieff9ec4d66ee0f3e6b22261a10e4cab9f26b6b51
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/1759
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agojtag_vpi: fix build errors under MinGW 39/1839/2
Franck Jullien [Sat, 21 Dec 2013 20:54:40 +0000 (21:54 +0100)]
jtag_vpi: fix build errors under MinGW

Change-Id: Ic13f9982014ead811e2f2d737ca1621e0e85577e
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-on: http://openocd.zylin.com/1839
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotarget: add kl25z HLA (stlink) config 03/1803/2
Paul Fertser [Thu, 7 Nov 2013 19:26:45 +0000 (23:26 +0400)]
target: add kl25z HLA (stlink) config

Based on Nemuisan Tokusei's. Untested, but original config was reported
to work ok.

Change-Id: Ic991dce55bfca266880081fe2bbd9e6e263b0fc0
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1803
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoat91sam7sx.cfg: fix use $_TARGETNAME as target identifier, not '0' warning 12/1812/2
Sergey A. Borshch [Fri, 22 Nov 2013 10:16:41 +0000 (12:16 +0200)]
at91sam7sx.cfg: fix use $_TARGETNAME as target identifier, not '0' warning

all other at91 cfg files already has this fix.
It also fix "No flash at address 0x...." error when JTAG chain consist of
more than one at91sam7sx cores during attempt to flash other than first mcu
in chain.

Change-Id: I7785d9103d0fc494b6a823e2c73f850373ffe112
Signed-off-by: Sergey A. Borshch <sb-sf@users.sourceforge.net>
Reviewed-on: http://openocd.zylin.com/1812
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agocfg: Add new BSTAPID for STM32F42xxx and STM32F43xxx series 08/1808/2
Nemui Trinomius [Sun, 17 Nov 2013 01:22:37 +0000 (10:22 +0900)]
cfg: Add new BSTAPID for STM32F42xxx and STM32F43xxx series

STM32F42xxx & STM32F43xxx series boudary scan TAP-ID are differ from
STM32F405xx/07xx & STM32F415xx/17xx.
And Section number was also fixed for RM0090 rev5.
Tested on a STM32F427IIT6 and STM32F429ZIT6.

Change-Id: Ie9c54c55b97b9c396ace752d94ea2ad916cc8479
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/1808
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agofix flash bank auto_probe() fail with multiple targets 13/1813/2
Sergey A. Borshch [Fri, 22 Nov 2013 15:27:40 +0000 (17:27 +0200)]
fix flash bank auto_probe() fail with multiple targets

  get_flash_bank_by_addr() iterates through all flash banks
trying to auto_probe() every bank, even if bank can belongs to
target other than requested, and this other target can be
in non-halted state, which leads to error message and
operation abort.
  Same situation in gdb_new_connection() and gdb_memory_map():
get_flash_bank_by_num() tries to auto_probe() requested bank,
so first get bank by get_flash_bank_by_num_noprobe(), check
if it belongs to current connection's target and skip
get_flash_bank_by_num() (actually autoprobing) if not.

Change-Id: I48b3f93dddcd9283394f14ad2de3248397c75ab3
Signed-off-by: Sergey A. Borshch <sb-sf@users.sourceforge.net>
Reviewed-on: http://openocd.zylin.com/1813
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
5 years agoversaloon: Finish support for serial number matching 16/1816/2
Andreas Fritiofson [Mon, 25 Nov 2013 22:50:37 +0000 (23:50 +0100)]
versaloon: Finish support for serial number matching

Add a command to specify the serial string and pass it to the find helper.
Actual matching was already supported for both serial and product but was
using hard coded string indices. Instead use the indices from the device
descriptor.

Change-Id: I17c7538e5ad301ef41eace1ee70a202adab23bb4
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1816
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotcl/target: add config for Milandr's 1986ве1т controller 18/1818/3
Paul Fertser [Tue, 26 Nov 2013 17:33:48 +0000 (21:33 +0400)]
tcl/target: add config for Milandr's 1986ве1т controller

This is a Cortex-M1 controller targetting aviation appliances.

Contributed (and live-tested) by 8daemon.

Change-Id: I133d6122cf6492b51ddbdbd800c16ba121d51bf3
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1818
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoftdi/neodb.cfg: mark as tested 14/1814/2
Paul Fertser [Mon, 25 Nov 2013 06:39:25 +0000 (10:39 +0400)]
ftdi/neodb.cfg: mark as tested

Working against openmoko gta02 target, including TRST and SRST (the
stupid samsung chip fully resets under trst, so it's actually of
little use here).

Change-Id: I831124659fc12efbccef536f07d15509c2112f92
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1814
Tested-by: jenkins
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agotopic: Support for the Xilinx BSCAN_* Virtual JTAG in Openrisc 06/1806/4
Sergio Chico [Sun, 10 Nov 2013 15:03:40 +0000 (16:03 +0100)]
topic: Support for the Xilinx BSCAN_* Virtual JTAG in Openrisc

This add support to the Xilinx BSCAN_* virtual JTAG interface.
This is the Xilinx equivalent of the Altera sld_virtual_jtag interface,
it allows a user to connect to the debug unit through the main
FPGA JTAG connection.

Change-Id: Ia438e910650cff9cbc8f810b719fc1d5de5a8188
Signed-off-by: Sergio Chico <sergio.chico@gmail.com>
Reviewed-on: http://openocd.zylin.com/1806
Tested-by: jenkins
Reviewed-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agostm32lx_dual_bank.cfg: fix typo in file path 32/1832/2
Andrey Yurovsky [Tue, 10 Dec 2013 19:59:33 +0000 (11:59 -0800)]
stm32lx_dual_bank.cfg: fix typo in file path

s/stm32l1x/stm32lx

...this makes tm32lx_dual_bank.cfg work again.

Change-Id: I04dc617523caa6b46c675fe9b700d1bbe88170e6
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/1832
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
5 years agoflash: revert incorrect stm32f1 default_padded_value 33/1833/2
Spencer Oliver [Fri, 13 Dec 2013 21:23:25 +0000 (21:23 +0000)]
flash: revert incorrect stm32f1 default_padded_value

Commit 2493671e2d9c352ea70edc8665b4c8f172ef1141 added a default flash
padded value to the wrong file, should have been stm32lx.c not stm32f1x.c.

Change-Id: Idab634a03ccb28609cc977a92ac2b138d1e8d859
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1833
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
5 years agoNULL check before dereferencing 09/1809/2
Luca BRUNO [Thu, 22 Aug 2013 14:22:31 +0000 (16:22 +0200)]
NULL check before dereferencing

Check reg_list[i]->feature for NULL pointers before checking feature->name
in order to avoid NULL access.

Change-Id: If20401a6c5aa5e1e29f0fcf9bb95585b49658832
Signed-off-by: Luca BRUNO <lucab@debian.org>
Reviewed-on: http://openocd.zylin.com/1809
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
Reviewed-by: Jens Bauer <jens@gpio.dk>
5 years ago[PATCH 1/2]support64: Add functions into types and target 00/1700/4
Dongxue Zhang [Fri, 15 Nov 2013 08:55:34 +0000 (16:55 +0800)]
[PATCH 1/2]support64: Add functions into types and target

Add functions into types.h, target.c, target.h to operate 64bits data.
Prepare for 64bits mips target.

Change-Id: I668a8a5ac12ba754ae310fa6e92cfc91af850b1c
Signed-off-by: Dongxue Zhang <elta.era@gmail.com>
Reviewed-on: http://openocd.zylin.com/1700
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
5 years agoAdd byte-swap helpers 98/1798/3
Andreas Fritiofson [Thu, 21 Nov 2013 22:07:40 +0000 (23:07 +0100)]
Add byte-swap helpers

Change-Id: I970616bb0e2bbc693165a0d311840febbd9134f1
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1798
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
Reviewed-by: Franck Jullien <franck.jullien@gmail.com>
6 years agokinetis : Add flash sector size detection for K21 MCU. 64/1764/4
Per Ekman [Thu, 24 Oct 2013 12:06:16 +0000 (14:06 +0200)]
kinetis : Add flash sector size detection for K21 MCU.

The current way of detecting the sector size of the internal
flash does not work for all Kinetis MCUs. Add support for the
K21 flash by detecting the specific model from the SDID register
and picking the correct sector size based on that.

Change-Id: I41f678353e45a44561af8a3398bdd4479dfeea4f
Signed-off-by: Per Ekman <pekenator@gmail.com>
Reviewed-on: http://openocd.zylin.com/1764
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agokinetis : Add flash read support to the kinetis nor flash driver. 63/1763/4
Per Ekman [Thu, 24 Oct 2013 11:55:58 +0000 (13:55 +0200)]
kinetis : Add flash read support to the kinetis nor flash driver.

The default_flash_read() function seems to work ok.

Change-Id: Ia34c4642405f669ff63310fa8c641098b771a401
Signed-off-by: Per Ekman <pekenator@gmail.com>
Reviewed-on: http://openocd.zylin.com/1763
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agokinetis : Fix broken check for mass erase. 62/1762/4
Per Ekman [Thu, 24 Oct 2013 09:54:32 +0000 (11:54 +0200)]
kinetis : Fix broken check for mass erase.

If the flash is not ready (MDM_STAT_FREADY is 0) then
dap_syssec_kinetis_mdmap() would act as if the MDM_STAT_SYSSEC bit was
set and erase the flash. Wait until MDM_STAT_FREADY is set before
checking the MDM_STAT_SYSSEC bit.

Change-Id: I5c3352f625599016625ed9be8787033f49bfacea
Signed-off-by: Per Ekman <pekenator@gmail.com>
Reviewed-on: http://openocd.zylin.com/1762
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agohla: Make consistent parameter naming 61/1761/3
Mathias K [Thu, 24 Oct 2013 12:11:33 +0000 (14:11 +0200)]
hla: Make consistent parameter naming

Rename fd to handle.

Change-Id: I98615aed1546976d00b0f20856d4e8e75f83c575
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/1761
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agotarget: use target_buffer_set_u32_array 83/1783/3
Spencer Oliver [Thu, 24 Oct 2013 22:26:51 +0000 (23:26 +0100)]
target: use target_buffer_set_u32_array

Attempt to use target_buffer_set_u32_array to convert to target endian
arrays rather reimplementing code.

This also removed cfi_fix_code_endian as its functionality is also
repeated.

Change-Id: I7c359dbe46ea791cd5f6fb18d8b0fb6895c599d3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1783
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
6 years agoulink: Fix libusb include changed since pkg-config merge 95/1795/2
Andreas Fritiofson [Mon, 4 Nov 2013 22:37:52 +0000 (23:37 +0100)]
ulink: Fix libusb include changed since pkg-config merge

Change-Id: I1556aaf117f99de046e3c16d5386faaaefdfefd8
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1795
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: jenkins
6 years agojtag: fix support for really long scans 92/1792/2
Paul Fertser [Sun, 3 Nov 2013 18:05:26 +0000 (22:05 +0400)]
jtag: fix support for really long scans

When programming large FPGAs the generated SVF files might contain really
long SDR scans. They won't fit in the 1MiB jtag scan page at all, so in
this case the allocated page needs to be bigger. The current code was
silently corrupting memory.

One particular example was sent by Volter targetting XC3S4000. It has an
SDR 11316992 bits long, that is 1414624 bytes.

Change-Id: I39f18d7e0654f2dbdf37df58c837c9ec1fb2aa2a
Reported-by: "Voltner, Jiří" <j.voltner@era.aero>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1792
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agostm32l flash: add another device ID 90/1790/2
Andrey Yurovsky [Fri, 1 Nov 2013 21:29:17 +0000 (14:29 -0700)]
stm32l flash: add another device ID

Add device ID 0x437, a dual-bank part with 512KB total.  This one used
the Medium+/HD flash size register to read the flash size in Kb rather
than the 0/1 code in the Medium+ parts.

Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Change-Id: I870fe3bb1b473939b7211c3b2edb44b4b3643648
Reviewed-on: http://openocd.zylin.com/1790
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoadd TI TMS570 support scripts 88/1788/4
Andrey Yurovsky [Thu, 31 Oct 2013 06:32:40 +0000 (23:32 -0700)]
add TI TMS570 support scripts

Add support for the TMS570 Cortex-R4 MCU from TI and their USB stick
development kit, TMDX570LS31USB.  Tested attaching, reset/halt/run, and
reading and writing memory and registers.

Change-Id: I12d779cef0c2b834f9bcf722307f35677cc4bd8f
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-on: http://openocd.zylin.com/1788
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agofm3: fix Fujitsu MB9Ax family support 93/1793/3
Nemui Trinomius [Mon, 4 Nov 2013 06:43:43 +0000 (15:43 +0900)]
fm3: fix Fujitsu MB9Ax family support

Some MB9Ax (especially few internal SRAM model) fails programming
because of wrong SRAM basic-address on running algorithm.
Default SRAM basic-address must be 0x20000000.
This patch is fixing default SRAM basic-address and ramcode offset.
Tested on a MB9BF618T and MB9AF112K.

Change-Id: Ibda9aceb4c317bcae0dcce9f6d0fd1c4b5d81952
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/1793
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoCorrect argument numbering in trace command 00/1800/2
Alan Bowman [Tue, 5 Nov 2013 22:25:51 +0000 (22:25 +0000)]
Correct argument numbering in trace command

The trace command was opening a file named with the source frequency.
This change correctly passes the filename that is specified.

Change-Id: Ia2eb8eda0e1e0f4f44b05c3a0ce7bef3bda51446
Signed-off-by: Alan Bowman <alan.michael.bowman@gmail.com>
Reviewed-on: http://openocd.zylin.com/1800
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agolpcspifi: Fix byte order bug 71/1771/3
Andreas Fritiofson [Thu, 31 Oct 2013 22:21:50 +0000 (23:21 +0100)]
lpcspifi: Fix byte order bug

Found by grepping for pointer casts.

Change-Id: I42ef3ebcce9fc6391154888b48601ede8377c34e
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1771
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agotarget: fix mem2array/array2mem 79/1679/3
Mathias K [Thu, 24 Oct 2013 06:31:45 +0000 (08:31 +0200)]
target: fix mem2array/array2mem

 if data size is bigger than transfer buffer, all portions are
 transferred from/to the same target address - address advance
 after successful transmission missed.

Change-Id: I79a6c388af197ac062d2807e397a2d7947400520
Signed-off-by: Sergey A. Borshch <sb-sf@users.sourceforge.net>
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/1679
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
6 years agosmp: Fix byte order bug 79/1779/2
Andreas Fritiofson [Mon, 30 Sep 2013 21:33:59 +0000 (23:33 +0200)]
smp: Fix byte order bug

Found by grepping for pointer casts.

Also rewrite to reduce scope and allocate the few bytes needed on stack
instead of on heap.

Change-Id: Ia2a369fb612e807b981ee60ebcfd9c09c2fbdf4c
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1779
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoti_icdi_usb: Remove unnecessary casts and fix byte order bugs 78/1778/2
Andreas Fritiofson [Sat, 28 Sep 2013 22:19:41 +0000 (00:19 +0200)]
ti_icdi_usb: Remove unnecessary casts and fix byte order bugs

Found by grepping for pointer casts.

Some additional cast can be removed if hexify/unhexify arguments are
changed to a more suitable type.

Change-Id: I13796b056f00976979bf0e754de3aa7648f7f321
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1778
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoioutil: Remove unnecessary casts and fix const-discarding 77/1777/2
Andreas Fritiofson [Sat, 28 Sep 2013 21:13:51 +0000 (23:13 +0200)]
ioutil: Remove unnecessary casts and fix const-discarding

Using the right parameter type, there's no need to resort to casting.

Change-Id: I8aec852431ead26e24793fd6fac8781353963bf2
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1777
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Jens Bauer <jens@gpio.dk>
6 years agobinarybuffer: Remove unnecessary cast and fix hidden "bug" 76/1776/2
Andreas Fritiofson [Sat, 28 Sep 2013 21:01:07 +0000 (23:01 +0200)]
binarybuffer: Remove unnecessary cast and fix hidden "bug"

Because of the cast, the const decoration on the parameter provided no
guarantee against modification since it was silently discarded.

Change-Id: Ib83ade955e1a61ee2175c690620437b5e19cbb6a
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1776
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agostr9x: Fix byte order bug 75/1775/2
Andreas Fritiofson [Sat, 28 Sep 2013 20:30:05 +0000 (22:30 +0200)]
str9x: Fix byte order bug

Found by grepping for pointer casts.

Change-Id: Ie2d698310b077c3849266e81df8e6a808cbc6896
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1775
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agostr7x: Fix byte order bug 74/1774/2
Andreas Fritiofson [Sat, 28 Sep 2013 20:28:57 +0000 (22:28 +0200)]
str7x: Fix byte order bug

Found by grepping for pointer casts.

Change-Id: I56d5680590e37d8c61197488067fbb0776e5e0f0
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1774
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agostm32f1x: Fix byte order bug and remove unnecessary cast 73/1773/2
Andreas Fritiofson [Sat, 28 Sep 2013 20:25:52 +0000 (22:25 +0200)]
stm32f1x: Fix byte order bug and remove unnecessary cast

Found by grepping for pointer casts.

Change-Id: Ibd8f22a9e9ca71459ba0bedc8447a3623d0e4184
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1773
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agopic32mx: Fix byte order bug 72/1772/2
Andreas Fritiofson [Sat, 28 Sep 2013 20:14:49 +0000 (22:14 +0200)]
pic32mx: Fix byte order bug

Found by grepping for pointer casts.

Change-Id: If73184a16904ec2958e7253ba98f44479fdcad3f
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1772
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agolpc2900: Fix byte order bugs and remove unnecessary casts 70/1770/2
Andreas Fritiofson [Sat, 28 Sep 2013 20:01:46 +0000 (22:01 +0200)]
lpc2900: Fix byte order bugs and remove unnecessary casts

Found by grepping for pointer casts.

Change-Id: Ib94957a0c53ec7abcbd5787d8c70e20c9eedc4b7
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1770
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoaduc702x: Fix byte order bug 69/1769/2
Andreas Fritiofson [Sat, 28 Sep 2013 19:28:08 +0000 (21:28 +0200)]
aduc702x: Fix byte order bug

Found by grepping for pointer casts.

Change-Id: I00e000515cb2573130b73423eb19ba941f524b05
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1769
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoftdi: Remove unnecessary cast 68/1768/2
Andreas Fritiofson [Sat, 28 Sep 2013 21:33:59 +0000 (23:33 +0200)]
ftdi: Remove unnecessary cast

Also make sure future growth of the tap_get_tms_path() return value will
get noticed.

Change-Id: Id859b463e5fdc819a4bc3b4845bf4363fbe713af
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1768
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoRemove unnecessary casts 67/1767/2
Andreas Fritiofson [Sat, 28 Sep 2013 19:43:37 +0000 (21:43 +0200)]
Remove unnecessary casts

Change-Id: Ia97283707282ccccdc707c969f59337313b4e291
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1767
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agonand/mx*: Remove unused host endianness flag 66/1766/2
Andreas Fritiofson [Sat, 28 Sep 2013 19:13:05 +0000 (21:13 +0200)]
nand/mx*: Remove unused host endianness flag

Probably shouldn't depend on that anyway.

Change-Id: Ic27ead4cb82cff1ab187696439da4b93941e09d8
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1766
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoRemove unnecessary (void *) 69/1669/3
Andreas Fritiofson [Sat, 28 Sep 2013 15:28:25 +0000 (17:28 +0200)]
Remove unnecessary (void *)

When pointer casts are needed, cast directly to the correct type, instead
of going via void*.

Don't explicitly cast to void* if it would have been done implicitly.

Change-Id: I4093209200051c5eb62847d00a4b9c8567480068
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1669
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoClean up const usage to avoid excessive casting 68/1668/3
Andreas Fritiofson [Mon, 30 Sep 2013 21:16:20 +0000 (23:16 +0200)]
Clean up const usage to avoid excessive casting

Don't use const on pointers that hold heap allocated data, because that
means functions that free them must cast away the const.

Do use const on pointer parameters or fields that needn't be modified.

Remove pointer casts that are no longer needed after fixing the constness.

Change-Id: I5d206f5019982fd1950bc6d6d07b6062dc24e886
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1668
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoftdi/tumpa.cfg: enable proper output buffer control, add another USB ID 89/1789/2
Paul Fertser [Thu, 31 Oct 2013 11:16:15 +0000 (15:16 +0400)]
ftdi/tumpa.cfg: enable proper output buffer control, add another USB ID

The schematics used for writing the config file were incorrect, real
hardware needs ACBUS3 _low_ as it's connected directly to the output
buffer's !OE pin.

Also apparently sometimes TUMPA comes with default FTDI IDs.

Real-life tested (including TRST and SRST) with a custom stm32f103
board, thanks to Mike Wang for the adapter sample.

Change-Id: Iab566e6d14f8392030f6ff2c8d976e1b57cf5ce6
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1789
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoClean up many C99 integer types format specifiers 74/1674/4
Paul Fertser [Mon, 30 Sep 2013 09:31:57 +0000 (13:31 +0400)]
Clean up many C99 integer types format specifiers

This eliminates most of the warnings reported when building for
arm-none-eabi (newlib).

Hsiangkai, there're many similar warnings left in your nds32 files, I
didn't have the nerve to clean them all, probably you could pick it
up.

Change-Id: Id3bbe2ed2e3f1396290e55bea4c45068165a4810
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1674
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agocheckpatch: correct false positives reporting instructions 86/1786/2
Paul Fertser [Sat, 26 Oct 2013 07:34:22 +0000 (11:34 +0400)]
checkpatch: correct false positives reporting instructions

Change-Id: Ib45d3db4436a5df5215f2c2d8b8f9a6d48d5f348
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1786
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agocheckpatch: treat jenkins as valid email 85/1785/2
Paul Fertser [Sat, 26 Oct 2013 07:24:43 +0000 (11:24 +0400)]
checkpatch: treat jenkins as valid email

This is needed to avoid checkpatch barking on already committed patches.

Change-Id: Ic2b4cfa04c8230d45c68bbf6b370841f682b32d6
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1785
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agocortex_m: set fpb_enabled on enabling fpb 34/1634/4
Spencer Oliver [Wed, 25 Sep 2013 13:43:08 +0000 (14:43 +0100)]
cortex_m: set fpb_enabled on enabling fpb

If the fpb_enabled is not set then as part of cortex_m3_set_breakpoint we
enable the fpb, however we do not signal the fpb as being enabled.

This issue only effects the hla target as the current cortex_m code enables
the fpb during cortex_m3_endreset_event.

Change-Id: I44d3fc65916c131b7a226869dd16aed5afb441b4
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1634
Tested-by: jenkins
6 years agohla/stlink: Re-order trace parameters to allow trace output file to be optional 60/1660/3
James G. Smith [Thu, 26 Sep 2013 11:08:05 +0000 (12:08 +0100)]
hla/stlink: Re-order trace parameters to allow trace output file to be optional

Re-order the "trace" parameters to allow the raw capture (log) file to
be an optional feature. The clock frequency for calculating the "Async
Clock Prescalar" is always required when enabling trace processing and
is now the first "required" parameter.

The ST-Link driver is updated to use the (required parameter)
"trace_source_hz" non-zero value as the indicator of trace being
required, rather than the now optional output file descriptor being
non-NULL.

Background: This patch is groundwork for extending the OpenOCD SWO
capture to implement other (OpenOCD built-in) ITM/DWT processing where
the core trace support is required, but there is no requirement to
store raw trace data to a configured host file. By itself this patch
is almost a functional NOP, since without the other processing in
place there is no reason NOT to specify a capture file.

Change-Id: Ibc385dd0a7adaf9bd652bceded27262fef35fd59
Signed-off-by: James G. Smith <jsmith@ecoscentric.com>
Reviewed-on: http://openocd.zylin.com/1660
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agosam4s flash: fix PLLA frequency calculation if diva > 1 65/1765/2
Thomas Schmid [Thu, 24 Oct 2013 15:32:35 +0000 (09:32 -0600)]
sam4s flash: fix PLLA frequency calculation if diva > 1

The code didn't address the case where diva is bigger than 1.

Change-Id: I15d8c47aa7b5cf80df1f29e067f30575f5d60a90
Signed-off-by: Thomas Schmid <thomas.schmid@gmail.com>
Reviewed-on: http://openocd.zylin.com/1765
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agotcl: add memory testing functions for board diagnostics 55/1455/4
Paul Fertser [Fri, 21 Jun 2013 21:16:41 +0000 (01:16 +0400)]
tcl: add memory testing functions for board diagnostics

This is a tcl implementation of public domain tests by Michael Barr,
http://www.barrgroup.com/Embedded-Systems/How-To/Memory-Test-Suite-C

The initial porting is done by Shane Volpe and posted to the mailing
list:
http://www.mail-archive.com/openocd-development@lists.berlios.de/msg16676.html

This patch includes some cosmetic amendments plus hardcodes 32bit word
size (as the code depends on memread32/memwrite32 anyway) which fixes
original code's issue of testing only the first quarter of the
specified nBytes.

Change-Id: I5f3a66f1f16fc4082c7a5a6aba338430646ed21c
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1455
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
6 years agoRemove jtag_rclk from target configs 95/1695/2
Paul Fertser [Sun, 13 Oct 2013 15:15:24 +0000 (19:15 +0400)]
Remove jtag_rclk from target configs

Some boards might have RCLK omitted from the JTAG connector and if the
interface claims support for it, OpenOCD will end up trying to use
RCLK while it's actually impossible.

This is a "cd tcl/target; sed -i s/jtag_rclk/adapter_khz/g *" patch.

Change-Id: Iee7337107bc1457966b104389ba9db75a9c860b4
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1695
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
6 years agohla_interface: init trst, srst variables. 98/1698/2
Sergey A. Borshch [Fri, 18 Oct 2013 15:13:03 +0000 (18:13 +0300)]
hla_interface: init trst, srst variables.

  There is an remark in jtag_srst and jtag_trst variables declaration:
  /*
   * JTAG adapters must initialize with TRST and SRST de-asserted
   * (they're negative logic, so that means *high*).  But some
   * hardware doesn't necessarily work that way ... so set things
   * up so that jtag_init() always forces that state.
   */

  but in hla_target such forsing is missed and both variables remains
  uninitialized until "reset" command issued, It prevents target polling
  when connecting to running target.

Change-Id: Ia620d8794cca8ba1403f5c5f24767e730033748a
Signed-off-by: Sergey A. Borshch <sb-sf@users.sourceforge.net>
Reviewed-on: http://openocd.zylin.com/1698
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
6 years agolpc2000: Fix flash programming fail on LPC4300 internal flash 84/1784/2
Nemui Trinomius [Sat, 26 Oct 2013 03:17:04 +0000 (12:17 +0900)]
lpc2000: Fix flash programming fail on LPC4300 internal flash

LPC43xx with internal flash parts model needs "IAP Init(49)"Command
before erase & write internal flash.Tested on a LPC4337 and LPC4357.

Change-Id: I48620ce12e578c61a3ca1adcd48815c1f71c35bb
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/1784
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoarmada370: initial support for Marvell Armada 370 family 90/1690/3
Greg Ungerer [Wed, 9 Oct 2013 13:15:07 +0000 (23:15 +1000)]
armada370: initial support for Marvell Armada 370 family

Initial support for using the jtag interface to the Marvell Armada 370
family of SoCs.

Change-Id: Id823a567e8805ac622c3c330bc111297c1dae37e
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Reviewed-on: http://openocd.zylin.com/1690
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoFix ULINK driver dependencies in configure.ac 99/1699/3
Martin Schmölzer [Mon, 21 Oct 2013 05:23:16 +0000 (07:23 +0200)]
Fix ULINK driver dependencies in configure.ac

Commit dd6274deed65c47ba2ef46e14259167d393399d8 (see
http://openocd.zylin.com/#/c/1475/ for futher information) adds the wrong
libusb dependency for the ULINK driver (libusb-0.1), when in fact the ULINK
driver uses the libusb-1.0 API since commit
f684252b2530d86f3a8330940105b86c770231f1.

Change-Id: I6946f1fdc0e26bfc7bdcff27a721e05a05b464a5
Signed-off-by: Martin Schmölzer <martin.schmoelzer@student.tuwien.ac.at>
Reviewed-on: http://openocd.zylin.com/1699
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agoflash: mxc nfc(v1) : fix incorrect address in spare area for biswap command 92/1692/3
Gaëtan Carlier [Sat, 12 Oct 2013 19:09:21 +0000 (21:09 +0200)]
flash: mxc nfc(v1) : fix incorrect address in spare area for biswap command

For NFC v1 (i.MX27), swapping must be done between offset 464 of Main
buffer and offset 4 of Spare buffer.

Change-Id: I09c2036e88770032da87d5846cd2094847f47b46
Signed-off-by: Gaetan Carlier <gcembed@gmail.com>
Reviewed-on: http://openocd.zylin.com/1692
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
6 years agocfg: add STM32F429 discovery board config 91/1691/2
Spencer Oliver [Thu, 10 Oct 2013 19:56:26 +0000 (20:56 +0100)]
cfg: add STM32F429 discovery board config

Change-Id: I4ee7a8185a02fac9d1f6079ab34d6a9f7047193a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1691
Tested-by: jenkins