]> git.sur5r.net Git - openocd/log
openocd
10 years agodrivers/ftdi: warn the user if he tries to use undefined reset signals
Paul Fertser [Sat, 15 Feb 2014 18:43:38 +0000 (22:43 +0400)]
drivers/ftdi: warn the user if he tries to use undefined reset signals

It is really an error to try to use a reset_config that doesn't match
adapter's capabilities, however OpenOCD has no way to specify them.

Using wrong reset_config might lead to very confusing behaviour, so I
think LOG_ERROR is justified here.

Change-Id: I1c6dcfa7c0d78829229a850189cad646b565dd66
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1948
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoft2232: warn about lack of TRST on "turtle" adapter
Paul Fertser [Sat, 15 Feb 2014 18:28:49 +0000 (22:28 +0400)]
ft2232: warn about lack of TRST on "turtle" adapter

This patch fixes a build error (assigning a variable to itself) with
clang.

Since this adapter lacks trst, trying to use it in reset_config will
fail silently. Warn the user accordingly.

Change-Id: I16fd20936f00d7ff82962f4fcc629ff434aa4dce
Reported-by: Rainer Müller <raimue@codingfarm.de>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1946
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agocfg: Make stm32f4x usable with SWD transport
Fatih Aşıcı [Sun, 16 Feb 2014 09:13:53 +0000 (10:13 +0100)]
cfg: Make stm32f4x usable with SWD transport

Change-Id: Ib8f3b414ec3c31cf8a112e75efe003e2237c59bb
Signed-off-by: Fatih Aşıcı <fatih.asici@gmail.com>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1951
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
10 years agostm32f1x: Fix option byte flag parsing
Andreas Fritiofson [Fri, 21 Feb 2014 16:17:32 +0000 (17:17 +0100)]
stm32f1x: Fix option byte flag parsing

Change-Id: Ifa04e1f215ac5790db3d432cc0d7d532660459f2
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1963
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoarm926ejs: fix write memory operations with caches enabled
Paul Fertser [Thu, 30 Jan 2014 10:11:13 +0000 (14:11 +0400)]
arm926ejs: fix write memory operations with caches enabled

Perform proper ICache flush operations on memory writes. This should fix
inability to use software breakpoints for debugging with caches
enabled.

This patch is only compile-time tested.

Commit 1137eaedaf6498f3448cdedf6f93076d9b3fd58a fixed the same issue
for arm920t. Among all the arm7_9_common targets only arm926ejs seems
to be broken in the same way.

Change-Id: I575306ac4319a69fc637b42f7c958f4595c5e81f
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1912
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agoquark_x10xx: add new target quark_x10xx
Adrian Burns [Thu, 6 Feb 2014 17:11:15 +0000 (17:11 +0000)]
quark_x10xx: add new target quark_x10xx

Intel Quark X10xx SoC debug support added
Lakemont version 1 (LMT1) is the x86 core in Quark X10xx SoC
Generic x86 32-bit code is in x86_32_common.c/h

Change-Id: If2bf77275cd0277a82558cd9895b4c66155cf368
Signed-off-by: adrian.burns@intel.com
Reviewed-on: http://openocd.zylin.com/1829
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agodoc: update README.Windows with new Zadig download URL
Pete Batard [Thu, 6 Feb 2014 19:47:46 +0000 (19:47 +0000)]
doc: update README.Windows with new Zadig download URL

As the old SF repository indicates, newer downloads have been moved to an
alternate server, and 3 new releases of Zadig have already occurred there.

Change-Id: I8ff967fd834e9c8dd2cce9dcbbe07e03d2b33e4a
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-on: http://openocd.zylin.com/1940
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
10 years agointerface/ftdi/xds100v2.cfg: default to reset state and ask user to release it later
Paul Fertser [Sat, 18 Jan 2014 16:24:24 +0000 (20:24 +0400)]
interface/ftdi/xds100v2.cfg: default to reset state and ask user to release it later

This adapter is special and needs a reset sequence to be performed
before operation. Since there're no suitable hooks to do that, we have
no choice but to ask the user to manually add the necessary commands
to his or her config file.

Change-Id: I48fb4276e77529768266840221b68c3ae26801e1
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1884
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agonor/flash/stm32f1x: add stm32f07x support
Kuldeep Singh Dhaka [Mon, 3 Feb 2014 16:27:33 +0000 (21:57 +0530)]
nor/flash/stm32f1x: add stm32f07x support

Added configuration to work with stm32f07x.
Tested on stm32f072discovery with libopencm3 stm32f0 blink example.

Change-Id: I63cdc9bf1f28f5951d6b4faac871cfde331c9c78
Signed-off-by: Kuldeep Singh Dhaka <kuldeepdhaka9@gmail.com>
Reviewed-on: http://openocd.zylin.com/1921
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agocortex_a: do not try to use MMU for translation if it wasn't enabled on target stop
Paul Fertser [Tue, 29 Oct 2013 09:45:07 +0000 (13:45 +0400)]
cortex_a: do not try to use MMU for translation if it wasn't enabled on target stop

On a target where AHB AP memory access is unavailable, care should be
taken to avoid treating addresses as virtual if the MMU was disabled
at the time the target was stopped.

Without this it's impossible to peek memory with Gdb when debugging
e.g. a bootloader because cortex_a8_read_memory() unconditionally
tried (and failed because of a sanity check in cortex_a8_mmu_modify)
to enable MMU.

Change-Id: Id7c63f4912920fb71a6104226ec6428d18c96a56
Reported-by: mbm@openwrt.org
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1787
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agogdb_server: Fix confusing warning when entering noack mode
Anton Kolesov [Wed, 22 Jan 2014 16:18:56 +0000 (20:18 +0400)]
gdb_server: Fix confusing warning when entering noack mode

Comment in gdb_server code mistakenly attributed constant warnings
about unexpected acknowledgement to the ACK packet sent by GDB when
establishing connection. However that is not the case, OpenOCD
gdb_server is handling this packet correctly without an warnings. This
warning instead was caused by the ACK packet which GDB sends right after
going into noack mode. Because OpenOCD gdb_server is already in noack
mode at this state, it emits warning about it. This is a documented GDB
behaviour
(https://sourceware.org/gdb/onlinedocs/gdb/Packet-Acknowledgment.html)
so there is no reason to scare users with warnings in this case.

This patch basically introduces two-level noack mode: after receiving
QStartNoAckMode gdb_server will set noack_mode to 1, then it will
receive this last ACK packet, but instead of printing a warning,
noack_mode will be increased to 2. Should there be any other ACK packets
after that, they will be properly reported by warning. All other code
that relies on noack_mode checks it for "!= 0", so there will be no
difference if it is 1 or 2.

Change-Id: I0e9c57fd93293bfe010390db2f3f161528b11d86
Signed-off-by: Anton Kolesov <anton.kolesov@synopsys.com>
Reviewed-on: http://openocd.zylin.com/1895
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoflash: declare fixed arrays const
Spencer Oliver [Mon, 20 Jan 2014 15:03:24 +0000 (15:03 +0000)]
flash: declare fixed arrays const

Change-Id: Id06b8b53ec59a7b3182f60f51dde5b16563aaeef
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1887
Tested-by: jenkins
10 years agoflash/nor/mdr.c: fix uninitialised variable warning
Paul Fertser [Fri, 17 Jan 2014 10:06:51 +0000 (14:06 +0400)]
flash/nor/mdr.c: fix uninitialised variable warning

Caught (actually, it's breaking the build) by clang 3.3.

Change-Id: Ife6fabf8a57e6c90ab45aaaf75557c984ac6772c
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1875
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoflash/nor/stm32f1x: fix format specifiers warning
Paul Fertser [Fri, 17 Jan 2014 11:17:14 +0000 (15:17 +0400)]
flash/nor/stm32f1x: fix format specifiers warning

Caught by clang on OS X. Reported by Steffanx on IRC.

Change-Id: Id77c7297c58e58c4e2aa8e5dafcb3a29a1f33f3d
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1879
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotarget/nds32_disassembler: fix format specifiers warnings
Paul Fertser [Fri, 17 Jan 2014 10:11:55 +0000 (14:11 +0400)]
target/nds32_disassembler: fix format specifiers warnings

According to the standard every operation returns at least an integer,
so PRIu8 format specifier is not suitable for these values as is.

This breaks build on OS X (x86_64-apple-darwin13.0.0) with "Apple LLVM
version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)".

Fix by adding appropriate casts. In fact there's plenty of room (and
I'd say necessity) for factoring out common code in there, but it's
too invasive for a non-maintainer.

Change-Id: I7d2182eb1d2f86fa22c882fbbaa6cfadf1c3e8fc
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1878
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Hsiangkai Wang <hsiangkai@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoserver/gdb_server: fix uninitialised variable warning
Paul Fertser [Fri, 17 Jan 2014 10:10:57 +0000 (14:10 +0400)]
server/gdb_server: fix uninitialised variable warning

Caught (breaks build) with clang 3.3.

Change-Id: I5978fe34e82122f62e3d587bcdc45ad12f5e55ca
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1877
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agortos: fix uninitialised variable warning
Paul Fertser [Fri, 17 Jan 2014 10:08:07 +0000 (14:08 +0400)]
rtos: fix uninitialised variable warning

Breaks build with clang 3.3. This "addr" variable is actually always
ignored by next_symbol() when cur_symbol is an empty string but clang
can't (and probably shouldn't) prove that automatically.

Change-Id: Id030f1aa34b9d40b5fa20a422031511520e52669
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1876
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agodoc: add missing reg command argument 'force'
Spencer Oliver [Fri, 24 Jan 2014 12:43:41 +0000 (12:43 +0000)]
doc: add missing reg command argument 'force'

The argument 'force' enables a user to bypass the internal cache and read
a target register directly. However it is missing from the user guide.

Change-Id: I26f689eec20b38a0dc5294626b25df566b554446
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1897
Tested-by: jenkins
10 years agointerface/ftdi: add TUMPA Lite config
Paul Fertser [Sun, 2 Feb 2014 09:04:41 +0000 (13:04 +0400)]
interface/ftdi: add TUMPA Lite config

TUMPA Lite is a cheap FT232H-based breakout board, without any
buffering. It also lacks series resistors so for some targets
(especially when not using ridiculously short wires) one needs to add
about 47 Ohms in series on every high-speed line.

The SRST line is connected directly to the FT232H too.

Real-life tested (including SRST and TRST).

Change-Id: I5ed4f88d8d20384e9c52efe2ff0c290e2650d43e
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1918
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agokinetis : improve kinetis flash driver.
Nemui Trinomius [Wed, 22 Jan 2014 14:46:32 +0000 (23:46 +0900)]
kinetis : improve kinetis flash driver.

Kinetis K-series have different guranuarity for each frequency model.
This patch adding more minute guranuarity detection.
And adopted mass erase command not only L-series but also K-series.
Tested on MK20DX32VLF5,MK10DX32VLF5,and MKL25Z128VLK4.

Change-Id: Iffef850d4b388463756a13faf02c3890bfc19acf
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/1894
Tested-by: jenkins
Reviewed-by: Per Ekman <pekenator@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Mateusz Kaduk <mateusz.kaduk@gmail.com>
10 years agodoc: update CMSIS-DAP info to match default driver behaviour
Spencer Oliver [Mon, 27 Jan 2014 14:21:25 +0000 (14:21 +0000)]
doc: update CMSIS-DAP info to match default driver behaviour

By default the driver will now auto detect attached adapters, it does not
use an internal list any more. Update docs to match this.

Change-Id: I62a9d243cd236a8cf54cbd9d088c4837a8df31bf
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1902
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agocfg: LPC17xx default to using SYSRESETREQ to reset target
Spencer Oliver [Wed, 22 Jan 2014 11:04:26 +0000 (11:04 +0000)]
cfg: LPC17xx default to using SYSRESETREQ to reset target

Originally the LPC17xx user guide (UM10360 Rev 2) stated that SYSRESETREQ
was not supported, so this was the default cortex_m reset mode.

Rev 3 of the same user guide states that it is now supported.
This has been verified on a LPC1768 mbed platform, previously I have not
tested this functionality.

Change-Id: I4858248903981a1c93ce75016e67c9e02702fcc5
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1892
Tested-by: jenkins
Reviewed-by: Jörg Fischer <turboj@gmx.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agotop .gitignore: ignore .dirstamp files
Antony Pavlov [Sat, 25 Jan 2014 07:07:53 +0000 (11:07 +0400)]
top .gitignore: ignore .dirstamp files

Just after succesfull build you can see some untracked files
in the 'git status' output:

src/jtag/drivers/versaloon/.dirstamp
src/jtag/drivers/versaloon/usbtoxxx/.dirstamp

This commit fixes the problem.

Change-Id: I1674eb4423e97c5f0a47f216981eaffdc351f784
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/1898
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoarm920t: fix write memory operations with caches enabled
Paul Fertser [Tue, 26 Nov 2013 15:46:09 +0000 (19:46 +0400)]
arm920t: fix write memory operations with caches enabled

Commit ff5ec942d80a34e20b5a3ca3328f7e6a55fb309b made this target
always use generic arm7_9 memory write routines for software
breakpoints which resulted in inability to debug and single-step
sources in Gdb when icache is active as generic routine doesn't
invalidate it. This should fix it (and is real-life tested against
Samsung S3C2442). I expect other arm7-9 targets to be affected as
well.

Change-Id: Id7980e370ae4db47ac6b1490321d81ffe85711c0
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1817
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agoAdd GDB remote target description support for ARM4
Luca BRUNO [Thu, 22 Aug 2013 14:41:38 +0000 (16:41 +0200)]
Add GDB remote target description support for ARM4

This commit adds support for passing the ARM4 target description to GDB
when enabling gdb_target_description, in order to expose all banked
registers.

Change-Id: Id618bc6226f00fe83397ea28888a84b64b09cafd
Signed-off-by: Luca BRUNO <lucab@debian.org>
Reviewed-on: http://openocd.zylin.com/1810
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoCMSIS-DAP: auto-detect CMSIS-DAP USB VID:PID
Peter Lawrence [Tue, 21 Jan 2014 00:08:58 +0000 (17:08 -0700)]
CMSIS-DAP: auto-detect CMSIS-DAP USB VID:PID

The current OpenOCD implementation requires CMSIS-DAP adapter USB
VID:PID values to either be hard-coded in the source or manually
supplied by the user's configuration files.  The CMSIS-DAP
specification stipulates that all compliant adapters should have
"CMSIS-DAP" in the product string.  This should obviate the need
for hard-coding.

This patch was previously submitted as changes 1882, 1883, and 1886
but amendments failed to be registered by the server.  The
functionality was changed from 1886 in response to comments so that
user-supplied VID:PID values overrided the CMSIS-DAP auto-detect.

Change-Id: Ifb2dc217248359f448e0a42bd1527dd744c434b0
Signed-off-by: Peter Lawrence <majbthrd@gmail.com>
Reviewed-on: http://openocd.zylin.com/1888
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoflash: samd: declare const data
Andrey Yurovsky [Wed, 15 Jan 2014 16:10:35 +0000 (08:10 -0800)]
flash: samd: declare const data

Make the chip information lookup tables const (thanks to Spencer Oliver for
pointing this out).  Also fix spacing on one macro.  No functional changes.

Change-Id: I053c4951c2626b8aa4541a79673b500394ef08e8
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/1874
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agodoc: Add Gerrit to the Developer resources section
Andreas Fritiofson [Sat, 18 Jan 2014 17:16:42 +0000 (18:16 +0100)]
doc: Add Gerrit to the Developer resources section

Change-Id: Icbf2050967cea06b05a09574a6a91ce1407a489f
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1885
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoAdd CMSIS-DAP information to the READMEs.
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>
10 years agogdb_server: check for invalid read memory requests
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>
10 years agoRetire jtag_add_dr_out
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>
10 years agojtag/drivers: add USB-Blaster II
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>
10 years agocfg: add Freescale FRDM-KL46Z Board
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>
10 years agotarget: fix typos
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>
10 years agocortexm: use Cortex-M rather than cortex-m3 for dwt registers
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>
10 years agoConform to C99 integer types format specifiers
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>
10 years agoGrammatical cleanup to Tcl Scripting chapter of User's Guide
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>
10 years agoAtmel samd: add support for SAMD21
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>
10 years agocortex_m: Avoid unnecessary saving and restoring of DCRDR
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>
10 years agoadi_v5: Remove unnecessary MEM-AP access functions
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>
10 years agocortex_m: Fix possible endianness problem in emulated DCC channel
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>
10 years agotarget: Add test bench for memory access functions
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>
10 years agolpc2000: fix LPC810 programming support
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>
10 years agoA few more grammar and typo fixes from the User's Guide.
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>
10 years agoRemove obsolete tip referring to 2010 removal of TAP numbers.
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>
10 years agoProofreading, typo and grammar fixes to Ch 10 User's Guide.
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>
10 years agoSome minor URL fixes and typo fixes, no functional changes.
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>
10 years agoadd support for Atmel SAMD NOR Flash
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>
10 years agoadd support for Atmel SAM4L NOR Flash
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>
10 years agocfg: add initial Atmel xplained kit support
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
10 years agocfg: add stm32 cmsis-dap compliant config
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
10 years agocmsis-dap: add initial cmsis-dap support
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
10 years agocommand: Fix formatting for empty usage string
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>
10 years agotcl/netgear-dg834v3.cfg: add to easy firmware recovery list
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>
10 years agotools: add firmware recovery helpers
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>
10 years agotcl/board: add Linksys WRT54GL v1.1 board config
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>
10 years agotcl: add bcm47xx config and Asus RT-N16 board using it
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>
10 years agoAllow "tcl_port" to be run after config to simply display the port.
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>
10 years agoUpdate URLs and names in amdm37x.cfg, no functional changes.
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>
10 years agoNumerous pedantic fixes to the User's Guide, including typo fixes,
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>
10 years agojtag_vpi: make the server address configurable
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>
10 years agotarget/image: allow for comments in IHEX files
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>
10 years agotopic: Added Spansion S25FL128S and S25FL256S spifi devices.
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>
10 years agokinetis : Add timeouts to flash status checking in dap_syssec_kinetis_mdmap().
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>
10 years agostlink: remove stlink_api command
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>
10 years agokinetis : Detect MCU flash parameters based on the SDID register.
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>
10 years agoAdd %APPDATA%\OpenOCD to script search path on win
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>
10 years agoRemove special handling of script search path on Windows
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>
10 years agotarget/imx6: Fix typo in setting _SJC_TAPID from SJC_TAPID variable
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>
10 years agoAvoid 'may be used uninitialized' warning from FreeBSD base GCC
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>
10 years agobuild: remove hard coded ftdi and usb libraries
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>
10 years agojtag_vpi: fix build errors under MinGW
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>
10 years agotarget: add kl25z HLA (stlink) config
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>
10 years agoat91sam7sx.cfg: fix use $_TARGETNAME as target identifier, not '0' warning
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>
10 years agocfg: Add new BSTAPID for STM32F42xxx and STM32F43xxx series
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>
10 years agofix flash bank auto_probe() fail with multiple targets
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>
10 years agoversaloon: Finish support for serial number matching
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>
10 years agotcl/target: add config for Milandr's 1986ве1т controller
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>
10 years agoftdi/neodb.cfg: mark as tested
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>
10 years agotopic: Support for the Xilinx BSCAN_* Virtual JTAG in Openrisc
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>
10 years agostm32lx_dual_bank.cfg: fix typo in file path
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>
10 years agoflash: revert incorrect stm32f1 default_padded_value
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>
10 years agoNULL check before dereferencing
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>
10 years ago[PATCH 1/2]support64: Add functions into types and target
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>
10 years agoAdd byte-swap helpers
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>
11 years agokinetis : Add flash sector size detection for K21 MCU.
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>
11 years agokinetis : Add flash read support to the kinetis nor flash driver.
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>
11 years agokinetis : Fix broken check for mass erase.
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>
11 years agohla: Make consistent parameter naming
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>
11 years agotarget: use target_buffer_set_u32_array
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>
11 years agoulink: Fix libusb include changed since pkg-config merge
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
11 years agojtag: fix support for really long scans
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>
11 years agostm32l flash: add another device ID
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>
11 years agoadd TI TMS570 support scripts
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>
11 years agofm3: fix Fujitsu MB9Ax family support
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>
11 years agoCorrect argument numbering in trace command
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>
11 years agolpcspifi: Fix byte order bug
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>
11 years agotarget: fix mem2array/array2mem
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
11 years agosmp: Fix byte order bug
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>
11 years agoti_icdi_usb: Remove unnecessary casts and fix byte order bugs
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>