]> git.sur5r.net Git - openocd/log
openocd
10 years agoquark_x10xx: cleanup of LOG format specifiers
Ivan De Cesaris [Wed, 21 May 2014 13:20:08 +0000 (15:20 +0200)]
quark_x10xx: cleanup of LOG format specifiers

Fix for LOG format specifiers, this is a superset of those
exposed by the arm-none-eabi build.

Add 0x prefix for all values printed in hex.

Add LOG messages for error cases when enabling or disabling
paging.

Change-Id: I070c556e0ad31204231a2b572e7b93af22a9bc61
Signed-off-by: Ivan De Cesaris <ivan.de.cesaris@intel.com>
Reviewed-on: http://openocd.zylin.com/2149
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agolpcspifi: setup a valid stack pointer before calling ROM code using stack
Aurelien Jacobs [Wed, 18 Dec 2013 23:17:49 +0000 (00:17 +0100)]
lpcspifi: setup a valid stack pointer before calling ROM code using stack

The spifi_init_code blob is calling the spifi_init() function from the ROM.
This ROM function is making use of the stack. So if the stack pointer is
invalid, trying to execute this code leads to a double fault and the
target_run_algorithm() call return with an error.
This patch simply ensure that the stack pointer is properly setup before
calling the spifi_init() ROM function.

Change-Id: I42a2163cfc2c6dfe5ada97ae8eb2bb6d2e283ff7
Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
Reviewed-on: http://openocd.zylin.com/1836
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agoKS869x: add new target
Yegor Yefremov [Mon, 5 May 2014 15:36:27 +0000 (17:36 +0200)]
KS869x: add new target

This patch adds Micrel's KS869x target. The configuration was taken from
http://www.mmnt.net/db/0/0/www.micrel.com/ethernet/8695 - Micrel's
FTP server i.e. their OpenOCD 7.0 package.

The only change compared to the original file is the removal of
reset configuration, as it belongs to the board configuration.

Change-Id: Ic8509aa5fe5ce3166a3129e1c055280a3b2b9312
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Reviewed-on: http://openocd.zylin.com/2125
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agokinetis: Revise CPU un-securing code
Andrey Smirnov [Sat, 8 Mar 2014 22:42:28 +0000 (14:42 -0800)]
kinetis: Revise CPU un-securing code

Old version of the code had several problems, among them are:
 * Located in a generic ADI source file instead of some Kinetis
   specific location
 * Incorrect MCU detection code that would read generic ARM ID
   registers
 * Presence of SRST line was mandatory
 * There didn't seem to be any place where after SRST line assertion
   it would be de-asserted.
 * Reset was asserted after waiting for "Flash Controller Ready" bit
   to be set, which contradicts official programming guide AN4835
 * Mass erase algorithm implemented by that code was very strange:
   ** After mass erase was initiated instead of just polling for the
      state of "Mass Erase Acknowledged" bit the code would repeatedly
      initiate mass erase AND poll the state of the "Mass Erase
      Acknowledged"
   ** Instead of just polling for the state of "Flash Mass Erase in
      Progress"(bit 0 in Control register) to wait for the end of the
      mass erase operation the code would: write 0 to Control
      register, read out Status register ignoring the result and then
      read Control register again and see if it is zero.
 * dap_syssec_kinetis_mdmap assumed that previously selected(before
   it was called) AP was 0.

This commit moves all of the code to kinetis flash driver and
introduces three new commands:

o "kinetis mdm check_security" -- the intent of that function is to be used as
  'examine-end' hook for any Kinetis target that has that kind of
  JTAG/SWD security mechanism.

o "kinetis mdm mass_erase""  -- This function removes secure status from
  MCU be performing special version of flash mass erase.

o "kinetis mdm test_securing" -- Function that allows to test securing
  fucntionality. All it does is erase the page with flash security settings thus
  making MCU 'secured'.

New version of the code implements the algorithms specified in AN4835
"Production Flash Programming Best Practices for Kinetis K-
and L-series MCUs", specifically sections 4.1.1 and 4.2.1.
It also adds KL26 MCU to the list of devices for which this security
check is performed. Implementing that algorithm also allowed to simplify
mass command in kinetis driver, since we no longer need to write security
bytes. The result that the old version of mass erase code can now be
acheived using 'kinetis mdm mass_erase'

Tested on accidentally locked FRDM-KL26Z with KL26 Kinetis MCU.

Change-Id: Ic085195edfd963dda9d3d4d8acd1e40cc366b16b
Signed-off-by: Andrey Smrinov <andrew.smirnov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2034
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agomips32: new code for pracc exec
Salvador Arroyo [Tue, 3 Dec 2013 22:25:20 +0000 (23:25 +0100)]
mips32: new code for pracc exec

This is only the basic code proposed for mips32_pracc_exec() function.
It checks every pracc address against the expected address when
reading (instruction fetch).
The code expects to start at PRACC_TEXT and any subsequent read address
is obtained by adding 4 to the previous one.
After shifting out all the instructions the code executes a final check.
It checks now for the first pass trough PRACC_TEXT and shift out
only NOP instructions.
A mips core does not need an additional NOP and after the first check
it exits if there is no store access pending.
After shifting out one NOP the core must be reading at pracc text or the
code exits with error.
The code continues shifting out NOPs until all store accesses have
been performed.
After shifting out 10 NOPs it exits with error.
No assumption is made about the number of store instruction shifted out or
the ordering of the store accesses. It only checks that the number of
store accesses is the same as the number of store instructions at dmseg
after execution.
mips32_pracc_read_ctrl_addr() and mips32_pracc_finish() are added to
simpify a bit the code. Fields pa_ctrl and pa_addr are added
in ejtag_info for storing values of pracc control and address.

Change-Id: If6322d5c8cbeadcd4acd3972c0f72c8490f53c34
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1827
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agomips32: cleanups in legacy pracc code
Salvador Arroyo [Sun, 1 Dec 2013 09:40:34 +0000 (10:40 +0100)]
mips32: cleanups in legacy pracc code
This is the first patch intended to make a more precise pracc check
when running in legacy mode (code executed by mips32_pracc_exec()).
It only makes some cleanups, mostly due to unnecessary code.
With the last cache optimizations for processor access (pa for short)
all the pracc functions generate the code following some rules that
make pa more easily to check:
There are no load instructions from dmseg. All the read pas are
instruction fetches. PARAM_IN related stuff is not needed.
Registers are restored either from COP0 DeSave or from ejtag
info fields. PRACC_STACK related stuff is not needed any more.
The code starts execution at PRACC_TEXT and there are no branch or jump
instruction in the code, apart from the last jump to PRACC_TEXT.
The fetch address is ever known.
For every store instruction to dmseg the function code sets
the address of the write/store pa.
The address of every store pa is known.
Current code ends execution when reading a second pass through PRACC_TEXT.
This approach has same inconveniences:
If the code starts in the delay slot of a jump it makes a jump
to PRACC_TEXT after executing the first instruction. A second pass
through PRACC_TEXt is read and the function exits without any warning.
This seems to occur sometimes when a 24kc core is halted in the delay
slot of a branch.
If a debug mode exception is triggered during the execution of a
function the core restarts execution at PRACC_TEXT. Again the function
exits without any warning.
If for whatever reason the core starts fetching  at an unexpected
address the code now sends a jump instruction to PRACC_TEXT, but due
to the delay slot the core continues fetching at whatever address + 4
and a second jump instruction will be send for execution. The result
of a jump instruction in the delay slot of another jump is
UNPREDICTABLE. It may work as expected (ar7241), or let the core in
the delay slot of a jump to PRACC_TEXT for example. This means the
function called next may also fail (pic32mx).

Change-Id: I9516a5146ee9c8c694d741331edc7daec9bde4e3
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1825
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agomips: use cp0 DeSave to cache $15 / t7
Salvador Arroyo [Sun, 25 Aug 2013 10:21:18 +0000 (12:21 +0200)]
mips: use cp0 DeSave to cache $15 / t7

Near all pracc functions store $15 in DeSave and
restore it when exiting.
There is no need to save it, if mips32_pracc_read_regs()
save this register in Desave when entering debug mode.
mips32_pracc_write_regs() needs to update it when
exiting debug mode.
Other pracc functions must not modify DeSave.
The jump code in the fastdata transfer function needs also
some little modifications.
Remark:
Like in current code the user can read/modify $15
with the cp0 31 commands.

Change-Id: I5b7dfc1b6169da846f5d2dd3ad4209a9da2c3fad
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1565
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agomips: load fast data transfer handler code with mips32_pracc_write_mem()
Salvador Arroyo [Sat, 24 Aug 2013 12:18:09 +0000 (14:18 +0200)]
mips: load fast data transfer handler code with mips32_pracc_write_mem()

Currently the code is loaded calling mips32_pracc_write_mem_generic().
Cache synchronization is not performed.
If configured as write back cache there is no chance to execute the
handler. If configured as write through cache and the cache
lines written to are not cache resident (I-side cache miss) may work.
The patch makes possible to execute the handler in a cached active
memory segment (mainly from KSEG0), but nothing else. The data
is still loaded without performing cache synchronization, code loaded
may not be executable.
Performance may not be faster. At start, for example, the code resides in
main memory, not in cache, and the core must transfer code from
memory. We can really modify the code to force a wait for the first
transfer like we do with start and end addresses, making sure the code
is cache resident for the rest of the queued transfers.
This can also may happen if we execute code (greater than the I cache size)
and the handler code is evicted from the cache.
Code tested on ar7241.

Change-Id: Iffdb4dae108b872fef0e7bacc5ea99649cdc1630
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1564
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agomips: load code in buffer mode
Salvador Arroyo [Fri, 23 Aug 2013 16:50:43 +0000 (18:50 +0200)]
mips: load code in buffer mode

Currently the functions mips32_checksum_memory() and mips32_blank_check_memory()
load the code word by word.
The bug in cache code is a good reason for doing so.
If there is no other reason we can load the code as a buffer to save time.
mips_m4k_write_memory() expect a buffer in target endianness, this is done by
target_buffer_set_u32_array().
Cleaned up exit code.
Tested on ar7241 big endian and pic32mx little endian with verify_image.
Flash erase check only tested in pic32mx.

Change-Id: Ib63ed98732b2e23b058e7349a0a57934b7604905
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1562
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agomips32: optimized cache code for pracc access
Salvador Arroyo [Sat, 18 Jan 2014 22:21:16 +0000 (23:21 +0100)]
mips32: optimized cache code for pracc access

Follows the the same rules of optimization used by all pracc functions.
Solves some bugs in previous code and adds support for write through caches.

Change-Id: If88c6738ca8c8197f327f22b766120a24f71b567
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1557
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoUpdate to the current Jim Tcl
Paul Fertser [Mon, 28 Apr 2014 10:34:47 +0000 (14:34 +0400)]
Update to the current Jim Tcl

This is a post-release version but hopefully some fixes that went in
are worth it; also the changes here make OpenOCD compatible with stock
0.75 version if a distro maintainer decides to use it.

Change-Id: I7ad1814c7c4868198475cdca4750c3d0ee4f5f8b
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2121
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoREADME.OSX: recommend XCode 5 as that's the current version
Paul Fertser [Thu, 8 May 2014 13:56:23 +0000 (17:56 +0400)]
README.OSX: recommend XCode 5 as that's the current version

Using current "Command Line Tools" with XCode 4 is known to provoke
issues (the build "hangs"), see e.g.

http://stackoverflow.com/questions/18667916/xcrun-lipo-freezes-with-os-x-mavericks-and-xcode-4-x

This fixes https://sourceforge.net/p/openocd/tickets/70/ .

Change-Id: I511b347b9388e0e3f1d136b566915021c4b5fbde
Reported-by: n321203 <n321203@users.sf.net>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2128
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agoftdi: Optimize GPIO toggling
Andreas Fritiofson [Thu, 27 Feb 2014 21:23:58 +0000 (22:23 +0100)]
ftdi: Optimize GPIO toggling

Only send the new I/O state for the bytes that changed.

Change-Id: I930edc9518e6019331e68e4756acc5e92dda25a4
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1999
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agosvf: Fix debug and error messages that print hex buffer
Kamal Dasu [Tue, 3 Dec 2013 21:15:42 +0000 (16:15 -0500)]
svf: Fix debug and error messages that print hex buffer

Added SVF_BUF_LOG macro to properly print the hex buffer of parsed
string for SIR, SDR, TDI, TDO and MASK. The original debug and error
logs with respect to printing real values were misleading and also
had endianess issues. All the bits are printed now instead of just
u32 values.

Change-Id: Ie89902403bdb61ff458418446c2ca1253ea2a63f
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Reviewed-on: http://openocd.zylin.com/1964
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
10 years agodoc: document [start end] parameters of "profile" command
Paul Fertser [Wed, 16 Apr 2014 10:37:36 +0000 (14:37 +0400)]
doc: document [start end] parameters of "profile" command

Change-Id: I56561b08304e5b854a67b06ab6b9cee7a24919b2
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2115
Tested-by: jenkins
10 years agogeneralplus: Add configuration file for General Plus GP326XXXA series
Andrey Smirnov [Fri, 21 Mar 2014 02:00:24 +0000 (19:00 -0700)]
generalplus: Add configuration file for General Plus GP326XXXA series

Add configuration file for General Plus GP326XXXA series. Tested on
GP326833A on GPC-1737B board.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Change-Id: I1ad0e22598b01317bbc823870a7a262e9192c595
Reviewed-on: http://openocd.zylin.com/2058
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoarmv7a: fix typo in cache_config help text
Spencer Oliver [Tue, 15 Apr 2014 14:24:32 +0000 (15:24 +0100)]
armv7a: fix typo in cache_config help text

Change-Id: I48cb83bf56b2f6841c3add68ed94b9f92037357d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2114
Tested-by: jenkins
10 years agoFix some C99 format specifiers
Paul Fertser [Mon, 28 Apr 2014 11:05:02 +0000 (15:05 +0400)]
Fix some C99 format specifiers

As exposed by arm-none-eabi build, fix the wrong modifiers.

Change-Id: Ia6ce7c5c1d40e95059525c3e5d81b752df2fea7c
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2122
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoAdd support for Gumstix AeroCore device
Ash Charles [Thu, 17 Apr 2014 00:32:23 +0000 (17:32 -0700)]
Add support for Gumstix AeroCore device

The Gumstix AeroCore board [1] contains a STM32F427 microcontroller.
Schematics for this board will also be made available [2].
The JTAG interface for this chip can be accessed via a USB connection
provided by an FTDI chip (0403:6011).

[1] https://store.gumstix.com/index.php/products/585/
[2] https://pubs.gumstix.com/boards/AEROCORE

Change-Id: I0bf3bb525f51528bedd807b1f7210b09ef2e1015
Signed-off-by: Ash Charles <ashcharles@gmail.com>
Reviewed-on: http://openocd.zylin.com/2117
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoRestore normal development cycle
Paul Fertser [Sun, 27 Apr 2014 11:07:08 +0000 (15:07 +0400)]
Restore normal development cycle

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
10 years agoThe openocd-0.8.0 release v0.8.0
Paul Fertser [Sun, 27 Apr 2014 10:28:21 +0000 (14:28 +0400)]
The openocd-0.8.0 release

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
10 years agonrf51: remove dereference of null pointer
Spencer Oliver [Tue, 22 Apr 2014 19:53:50 +0000 (20:53 +0100)]
nrf51: remove dereference of null pointer

found by clang 3.4.

Change-Id: Id499b546f65acd7a719498bc97e33b21d1ba565a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2119
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
10 years agoquark_x10xx: fix IO r/w operations with paging enabled
Ivan De Cesaris [Fri, 18 Apr 2014 09:19:40 +0000 (11:19 +0200)]
quark_x10xx: fix IO r/w operations with paging enabled

Paging checking and disabling wasn't present for IO r/w,
so the commands were successful only when paging wasn't
enabled (e.g. EFI boot phase).

Change-Id: I41366c0fadff3ea1eb8a153291f20a46cd9ddec1
Signed-off-by: Ivan De Cesaris <ivan.de.cesaris@intel.com>
Reviewed-on: http://openocd.zylin.com/2118
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoRestore -dev suffix
Paul Fertser [Tue, 15 Apr 2014 05:54:32 +0000 (09:54 +0400)]
Restore -dev suffix

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
10 years agoThe openocd-0.8.0-rc2 release candidate v0.8.0-rc2
Paul Fertser [Tue, 15 Apr 2014 04:58:20 +0000 (08:58 +0400)]
The openocd-0.8.0-rc2 release candidate

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
10 years agoNEWS: minor fixes for rc2
Paul Fertser [Mon, 14 Apr 2014 18:28:16 +0000 (22:28 +0400)]
NEWS: minor fixes for rc2

Change-Id: Iba04baae4f3278db8b36283574a82c077d28bb4a
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2113
Tested-by: jenkins
10 years agosvf: try to reallocate buffers if they're not enough
Paul Fertser [Wed, 9 Apr 2014 05:58:07 +0000 (09:58 +0400)]
svf: try to reallocate buffers if they're not enough

On larger FPGAs the default buffer size is not nearly enough;
automatically reallocate it as needed.

Change-Id: Ic8071e8cceddeef897ce76996c029250fd22662b
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2099
Tested-by: jenkins
Reviewed-by: Kenneth Lorthioir <ibelimb@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agocortex_a: fix endiannes issues on TI TMS570
Seth LaForge [Tue, 1 Apr 2014 17:26:32 +0000 (10:26 -0700)]
cortex_a: fix endiannes issues on  TI TMS570

The TI TMS470 and TMS570 series of processors are BE-32 processors,
despite BE-32 not being supported by ARM in the Cortex-R4 core. TI
hacked in BE-32 support, which requires odd swizzling in OpenOCD to
make memory reads and writes function correctly. In particular,
without this change, OpenOCD word reads and writes had the bytes
reversed, and halfword and byte packed reads were reading garbage.
In my testing, this change fixes these problems.

Change-Id: I21dd30f4b9003f20fcc85f674ab833407bb61f74
Signed-off-by: Seth LaForge <sethml@google.com>
Reviewed-on: http://openocd.zylin.com/2064
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agousb_blaster: fix warning: array subscript has type ‘char’
Spencer Oliver [Wed, 9 Apr 2014 14:08:30 +0000 (15:08 +0100)]
usb_blaster: fix warning: array subscript has type ‘char’

caught by clang 3.4 running on cygwin.

Change-Id: I59f652337334e557fb50374f5270ba9c30392b6e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2100
Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
10 years agomips32, dsp563xx: fix segfault on Gdb attach
Paul Fertser [Sat, 12 Apr 2014 13:22:00 +0000 (17:22 +0400)]
mips32, dsp563xx: fix segfault on Gdb attach

Since c6216201b249e6a97fcc085e413e3d34e0de6fb7 gdb target description
generation support is enabled by default and it counts on checking
"feature" pointer in reg_list. Both mips32 and dsp563xx neither used
calloc nor explicitly set feature (as it was a newly introduced struct
field).

This patch changes all targets to use calloc for consistency.

Change-Id: I9eceadef8b04aacb108e24ae23cb51ca3009586f
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2102
Tested-by: jenkins
Reviewed-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoconfigure: presto ftdi driver requires libftdi
Paul Fertser [Thu, 10 Apr 2014 03:29:11 +0000 (07:29 +0400)]
configure: presto ftdi driver requires libftdi

Change-Id: I4b04eec5084d4b8129e2aff8f3411c6d92e84431
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2101
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
10 years agojtag/drivers/remote_bitbang: use sizeof to determine maximum unix socket path length
Paul Fertser [Sun, 6 Apr 2014 04:36:37 +0000 (08:36 +0400)]
jtag/drivers/remote_bitbang: use sizeof to determine maximum unix socket path length

Different *nix systems use different constants, so sizeof should be
used instead. This fixes the build on OS X (as sun_path length is
hardcoded to 104 on Darwin).

Change-Id: I1df611383dedcfc6d153ec59b453a895c7d84e94
Reported-by: Xiaofan Chen <xiaofanc@gmail.com>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2095
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
10 years agotarget: fix incorrect arm cpu monitor mode encoding
Tim Sander [Mon, 31 Mar 2014 20:21:44 +0000 (21:21 +0100)]
target: fix incorrect arm cpu monitor mode encoding

According to the "Arm Arch Ref Manual ARMv7-a and ARMv7-R edition" the
CPSR encoding for Monitor mode is 0b10110 (22) not 0b11010 (26) as is
currently used.

Change-Id: I73373a0029a81abc92febf518b88bf0dd4dec1fa
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2081
Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Tested-by: jenkins
Reviewed-by: Younes REGAIEG <y.regaieg@gmail.com>
Reviewed-by: Tim Sander <tim@krieglstein.org>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
10 years agotcl: bcm6348 target config, BT HomeHub v1 board config
Lee Bowyer [Sun, 6 Apr 2014 16:06:14 +0000 (20:06 +0400)]
tcl: bcm6348 target config, BT HomeHub v1 board config

Also add the board to the firmware recovery script.

Change-Id: I4f9c895dae171df7249e3b1c0563b288518b9fe0
Signed-off-by: Lee Bowyer <lee@sodnpoo.com>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2097
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agocontrib/rpc_examples: add example for python3
Andreas Ortmann [Fri, 28 Feb 2014 11:09:40 +0000 (12:09 +0100)]
contrib/rpc_examples: add example for python3

Halt, resume, memory read/write are used in various ways.

Change-Id: Ia6727678bfc19cc764f822b739bddaae56e9dc70
Signed-off-by: Andreas Ortmann <ortmann@finf.uni-hannover.de>
Reviewed-on: http://openocd.zylin.com/2000
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoopenocd.rules: match CMSIS DAP devices by product string
Paul Fertser [Tue, 1 Apr 2014 17:04:48 +0000 (21:04 +0400)]
openocd.rules: match CMSIS DAP devices by product string

Since the standard requires to have "CMSIS-DAP" somewhere in product
string, use that to automatically match all the compliant adapters.

Change-Id: I1e2ac088333a7d69a136af825248914339debdd8
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2082
Tested-by: jenkins
Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoparport: add "aspo" hotpluggable adapter config
Karl Hammar [Sat, 5 Apr 2014 06:47:14 +0000 (10:47 +0400)]
parport: add "aspo" hotpluggable adapter config

This adds a new adapter config.

Design files are available from:

http://turkos.aspodata.se/git/openhw/isp/pp_jtag_arm20.sch
http://turkos.aspodata.se/git/openhw/isp/pp_jtag_arm20.pcb

No need to document it anywhere as only a single device was ever
built.

Change-Id: If031fdb9dedb1e544401747bfb7fbc5afc4d5407
Signed-off-by: Karl Hammar <karl@aspodata.se>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2094
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotarget/cortex_a: check gdb_service before dereferencing in update_halt_gdb
Paul Fertser [Mon, 7 Apr 2014 08:33:53 +0000 (12:33 +0400)]
target/cortex_a: check gdb_service before dereferencing in update_halt_gdb

If gdb was disconnected by the moment the target entered halted state,
update_halt_gdb would segfault.

Change-Id: I67477e9199c1df097be83a49e38602f975c083f5
Reported-by: Younes REGAIEG <younes.regaieg@imag.fr>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2098
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoREADME.OSX: add 10.9 specific hints
Paul Fertser [Mon, 31 Mar 2014 17:23:22 +0000 (21:23 +0400)]
README.OSX: add 10.9 specific hints

Change-Id: I8c684f2964262fb0670ed74fded26676833aee10
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2080
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
10 years agoMakefile.am: fix build for libftdi1, pass CFLAGS where appropriate
Paul Fertser [Sun, 30 Mar 2014 19:15:42 +0000 (23:15 +0400)]
Makefile.am: fix build for libftdi1, pass CFLAGS where appropriate

Change-Id: I9d8afa6ae32fc01e69ec434b5bc9d71524d386a2
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2079
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
10 years agojtag/aice/aice_usb: remove unused constants
Paul Fertser [Sun, 30 Mar 2014 14:25:52 +0000 (18:25 +0400)]
jtag/aice/aice_usb: remove unused constants

Those are breaking the build with clang 3.4 (current default compiler
on OS X 10.9.2).

Change-Id: I9f2fbfbb6d544498cb8d6a62565e4ebe7223e784
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2077
Tested-by: jenkins
Reviewed-by: Hsiangkai Wang <hsiangkai@gmail.com>
10 years agoflash/nor/at91sam3: remove sam3_page_write_opcodes
Paul Fertser [Sun, 30 Mar 2014 07:23:51 +0000 (11:23 +0400)]
flash/nor/at91sam3: remove sam3_page_write_opcodes

Apparently this helper was never actually used, and current clang
produces an unused const variable warning, so it's breaking the build.

Change-Id: Ib088bef5e9c0a48942c1d417d46f738469ee7e28
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2076
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
10 years agoRestore -dev suffix
Paul Fertser [Sun, 30 Mar 2014 06:10:29 +0000 (10:10 +0400)]
Restore -dev suffix

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
10 years agoThe openocd-0.8.0-rc1 release candidate v0.8.0-rc1
Paul Fertser [Sat, 29 Mar 2014 17:29:16 +0000 (21:29 +0400)]
The openocd-0.8.0-rc1 release candidate

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
10 years agoDon't cast return value of [cm]alloc
Andreas Fritiofson [Fri, 28 Mar 2014 19:00:21 +0000 (20:00 +0100)]
Don't cast return value of [cm]alloc

Change-Id: I0028a5b6757b1ba00031893d9a2a1725f915a0d5
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2069
Tested-by: jenkins
Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoMakefile.am: fix adding contrib directory for dist
Paul Fertser [Sat, 29 Mar 2014 19:05:19 +0000 (23:05 +0400)]
Makefile.am: fix adding contrib directory for dist

With extra / the directory was getting added as a subdirectory of
itself.

Change-Id: I5a3d5635f3c949f39d88b34a2ddab8244643f560
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2070
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoNEWS: add release highlights
Paul Fertser [Fri, 17 Jan 2014 19:08:26 +0000 (23:08 +0400)]
NEWS: add release highlights

Change-Id: Ifa4459b3b7b58b639d6c885a2ea88cefbfac2680
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1881
Tested-by: jenkins
10 years agoat91smad: Fixes to 'samd_protect'
Andrey Smirnov [Mon, 10 Feb 2014 16:06:04 +0000 (08:06 -0800)]
at91smad: Fixes to 'samd_protect'

Some fixes to 'samd_protect' including:
     - Fix a bug in which the value of 'set' parameter passed into the
     function was ignored so it was impossible to remove flash
     protection once it was set.
     - Check the protection status of the sector via 'is_protected'
     field of the  corresponding 'flash_sector' structure to see if
     any actual HW manipulations needs to be done.
     - Change the way the errors during protection activation are
     handled. Now even in the case of error in the middle of
     protecting a number of sectors the subroutine would still update
     the state of the sector protection in sectors array so as to
     avoid cases where openocd thinks that the sector is not protected
     while it actually is.

Change-Id: I4cc6445a98ec13bdd94c89f0711c17840738a215
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2027
Tested-by: jenkins
Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoat91samd: Bail early if trying to erase protected sector
Andrey Smirnov [Sat, 8 Feb 2014 19:58:22 +0000 (11:58 -0800)]
at91samd: Bail early if trying to erase protected sector

Bail early if trying to erase protected sector and also do not double-erase already
erased sectors.

Change-Id: Ic2d39af48c3b8e10e78d52dd978b9bc01f671c6a
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2026
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoat91samd: Bail early if trying to write to protected sector
Andrey Smirnov [Sat, 8 Feb 2014 20:23:45 +0000 (12:23 -0800)]
at91samd: Bail early if trying to write to protected sector

Bail early if trying to write to protected sector also mark the sector
we are writing to as dirty.

Change-Id: I892f83461792e1cc2dcccade7aa65717831a6805
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2025
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoat91samd: Remove 'first' and 'last' checks in 'samd_erase'
Andrey Smirnov [Sat, 8 Feb 2014 19:51:40 +0000 (11:51 -0800)]
at91samd: Remove 'first' and 'last' checks in 'samd_erase'

Remove 'first' and 'last' checks in 'samd_protect' since those
parameters are checked in 'handle_flash_erase_command'.

Change-Id: I30e5598a9ab656d81055f26cc63e291377605300
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2024
Tested-by: jenkins
Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agotcl: introduce init_target_events and use it for gdb flashing events
Paul Fertser [Sat, 22 Mar 2014 12:47:37 +0000 (16:47 +0400)]
tcl: introduce init_target_events and use it for gdb flashing events

This introduces a new global Tcl procedure that is run just after
init_targets and before init_boards.

Its default behaviour is to assign gdb-flash-erase-start and
gdb-flash-write-end to reasonable defaults.

The rationale for doing "reset init" before gdb erases and flashes
memory is that all flash drivers are written in assumption that they
can safely be used only after chip reset (plus chip-specific
configuration in the init handler if any). The need to use "reset
halt" after flashing is because a user expects running firmware after
loading to be the same as running it from power-on-reset.

Change-Id: I9ddc4047611904ca4ca779b73376d2739611948a
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2062
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotcl/target: make milandr configs swd-compatible
Paul Fertser [Fri, 21 Feb 2014 11:28:49 +0000 (15:28 +0400)]
tcl/target: make milandr configs swd-compatible

Change-Id: Ibb34f0d7829b205341bcce511ffc2624bdfe2c75
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1962
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotarget: remove memory leaks
Spencer Oliver [Fri, 28 Mar 2014 11:27:48 +0000 (11:27 +0000)]
target: remove memory leaks

Found by clang.

Change-Id: Ifb25dca52f8d9e8e46a35f0947a7239f26eb3757
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2067
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
10 years agotarget: fix handle_profile_command variable typo
Spencer Oliver [Fri, 28 Mar 2014 11:11:57 +0000 (11:11 +0000)]
target: fix handle_profile_command variable typo

Change-Id: I5d476aecb4622731890e168b1be3173718151e95
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2066
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agotarget: remove handle_profile_command memory leak
Spencer Oliver [Fri, 28 Mar 2014 11:11:13 +0000 (11:11 +0000)]
target: remove handle_profile_command memory leak

COMMAND_PARSE_NUMBER may return, thus any memory allocated may not be
freed, simple reorder fixes the issue.

Change-Id: I0ce444a5b032f5c49b6d33a03a8c0b71cad49c8c
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2065
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agoAdd xscale debug helper sources and everything related to dist
Paul Fertser [Mon, 27 Jan 2014 18:25:42 +0000 (22:25 +0400)]
Add xscale debug helper sources and everything related to dist

GPL requires providing sources for any derived work. I do not see any
reason to not include the xscale stuff into release tarballs.

Wildcard matching is used because plain directory name matches
implicit rule for executables and xscale.c built is errorneously
attempted, and directory name with a slash duplicates a directory
(xscale/xscale) in dist.

Change-Id: Ie0266470dcb97be87a09ba2dda9b3957f7cbc2fa
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1911
Tested-by: jenkins
Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoAdd all of contrib/ to dist, not just loaders
Paul Fertser [Mon, 27 Jan 2014 18:28:04 +0000 (22:28 +0400)]
Add all of contrib/ to dist, not just loaders

Change-Id: I467e21de6805ea9f23ae483317d602e9d81e1148
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1909
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoAdd usb_blaster cheap clone notes to dist
Paul Fertser [Mon, 27 Jan 2014 18:27:15 +0000 (22:27 +0400)]
Add usb_blaster cheap clone notes to dist

Change-Id: Ie9569634415ef76e88d5ca58bae6184838cf7114
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1908
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoAdd rlink speed table sources and everything related to dist
Paul Fertser [Mon, 27 Jan 2014 18:21:16 +0000 (22:21 +0400)]
Add rlink speed table sources and everything related to dist

GPL requires providing sources for any derived work. I do not see any
reason to not include the rlink stuff into release tarballs.

Change-Id: I686ab88994030312aca5bdfe731a72f10803b5c3
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1907
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoMove xsvf_tools and remote_bitbang to contrib/
Paul Fertser [Mon, 27 Jan 2014 18:07:16 +0000 (22:07 +0400)]
Move xsvf_tools and remote_bitbang to contrib/

It looks like tools/ should be used only for build tools, and contrib/
is a suitable place for everything else.

Change-Id: Iddaebba0acb6d66404912ec96749b46e4be643d8
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1906
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoAdd previous NEWS* files to dist
Paul Fertser [Mon, 27 Jan 2014 18:04:05 +0000 (22:04 +0400)]
Add previous NEWS* files to dist

Change-Id: I2f814e01c7b5aa9cd76e8e63c9c4a1ebbf3dd2ea
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1905
Tested-by: jenkins
Reviewed-by: Luca Bruno <lucab@debian.org>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoMove ocl (at91sam7x flash loader) sources to contrib
Paul Fertser [Mon, 27 Jan 2014 18:00:15 +0000 (22:00 +0400)]
Move ocl (at91sam7x flash loader) sources to contrib

Change-Id: Ib5c3c505a067d0e285a7b074cb6fddebfa6dda1e
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1904
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agodoc: add "manual/" directory in its entirety to dist
Paul Fertser [Mon, 27 Jan 2014 16:38:27 +0000 (20:38 +0400)]
doc: add "manual/" directory in its entirety to dist

Change-Id: I750c2938ab207012a6488bf34f55d784e5e26b6e
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1903
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoarmv7m: remove magic numbers for number of core registers
Spencer Oliver [Mon, 17 Mar 2014 14:04:25 +0000 (14:04 +0000)]
armv7m: remove magic numbers for number of core registers

Change-Id: I4296b812f0211011ccf3da8d203545dfba493903
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2053
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agortos: fix xml register support regression
Spencer Oliver [Mon, 17 Mar 2014 14:15:41 +0000 (14:15 +0000)]
rtos: fix xml register support regression

Seems that when xml register support was added the rtos code was not
updated to match. This then caused gdb to return the following error when
rtos support was enabled - "Remote 'g' packet reply is too long".

Change-Id: I7429c4b1efed120e2e690678d55f3d6e87ee1ff1
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2054
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agonrf51: Fix incorrect flash writing sequence
Andrey Smirnov [Sat, 15 Mar 2014 17:40:23 +0000 (10:40 -0700)]
nrf51: Fix incorrect flash writing sequence

nRF51 doesn't have any sort of flash page cache so we need to write
all of the data on the word-by-word basis and poll for "Flash Ready"
bit each time.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Change-Id: I8caffbf69ebf9a69915724704ddbe270d1bb8d92
Reviewed-on: http://openocd.zylin.com/2050
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agonrf51: Remove unnecessary explicit type casting
Andrey Smirnov [Mon, 17 Mar 2014 22:04:09 +0000 (15:04 -0700)]
nrf51: Remove unnecessary explicit type casting

Change-Id: I523e81645434760649ea2c00e6f80c2b08d08d94
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2055
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agonrf51: Add UICR writing support
Andrey Smirnov [Sat, 1 Mar 2014 21:40:08 +0000 (13:40 -0800)]
nrf51: Add UICR writing support

SoftDevice stack ihex binary, provided by Nordic expects being able to
write data necessary for its correct operation at the adresses inside UICR.
This patch exposes UICR region of flash as a second bank on the MCU to
facilitate that.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Change-Id: Idbc140b8de027f60655f78043877b7c054eb06f9
Reviewed-on: http://openocd.zylin.com/2013
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agonrf51: Add a known devices table and simple chip type detection code
Andrey Smirnov [Fri, 28 Feb 2014 19:35:16 +0000 (11:35 -0800)]
nrf51: Add a known devices table and simple chip type detection code

Unfortunately due to my oversight, the original version of the
nrf51_probe function contained useless code that read the contents of
DEVICEID[0] an DEVICEID[1] registers and did nothing about it(those
registers had nothing to do with the device type information anyway).

This commit fixes that code by changing its behavior to read the HWID
field of CONFIGID register and looking up the corresponding device
information in the know devices table. This information is useful
when choosing the versions of SDK and SoftDevice for the chip
using "nRF51822 compatibility matrix".

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Change-Id: Ibd80b35460df4278e86e0c2500b7dcc876eec10c
Reviewed-on: http://openocd.zylin.com/2012
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agocfg: or1k_generic: allow TAP_TYPE override
Franck Jullien [Tue, 18 Mar 2014 19:04:30 +0000 (20:04 +0100)]
cfg: or1k_generic: allow TAP_TYPE override

This patch allows users to specify TAP_TYPE from
the command line when using or1k_generic.cfg.

Change-Id: I9f4b7d8e4867658fa34bb4e92fc3a5f25227df11
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-on: http://openocd.zylin.com/2056
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agoarmv7m: Do not ignore 'value' parameter in armv7m_write_core_reg
Andrey Smirnov [Wed, 19 Mar 2014 15:20:36 +0000 (08:20 -0700)]
armv7m: Do not ignore 'value' parameter in armv7m_write_core_reg

Ignoring the value parameter in that function makes its code rather
misleading. Also the only caller of it, armv7m_restore_context already
does the whole "buf_get_u32" conversion business, so using
'value' also removes the waste of doing the conversion twice.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Change-Id: I515979c314d9b59ee1065c55b5bb5747c7e93f01
Reviewed-on: http://openocd.zylin.com/2057
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotcl: add Zynq-7000 target and Zedboard board configs
Tim Sander [Fri, 21 Mar 2014 16:43:04 +0000 (17:43 +0100)]
tcl: add Zynq-7000 target and Zedboard board configs

Change-Id: Ia7f2a57d1b32dda9936ad87e22635f7749ff3ce1
Signed-off-by: Tim Sander <tim@krieglstein.org>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2061
Tested-by: jenkins
10 years agoAT91SAM4L: Fix bug when writing to flash at a non-zero offset, add debug
Angus Gratton [Wed, 12 Feb 2014 11:32:47 +0000 (22:32 +1100)]
AT91SAM4L: Fix bug when writing to flash at a non-zero offset, add debug
output for flash page writes

The offset wasn't being considered in the "full page" write codepath, so any
writes at an offset were actually written out starting from page 0.

Change-Id: I5e70a1f35f144b3edd1ce6d9df9af9b5da6cf194
Signed-off-by: Angus Gratton <gus@projectgus.com>
Reviewed-on: http://openocd.zylin.com/1965
Tested-by: jenkins
Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agojlink: add support for Jlink-OB (0x0105) devices
Andrey Yurovsky [Sat, 8 Mar 2014 01:16:52 +0000 (17:16 -0800)]
jlink: add support for Jlink-OB (0x0105) devices

The JLink-OB (onboard) devices work the same way as the normal JLink
except that their PID is 0x0105 (and that's the only one we know of so
far) and their endpoint addresses are different due to there being a
CDC-ACM interface as well.  These JLink-OB devices show up on a lot of
vendors' development kits as an integrated debugger.

This change simply checks whether the adapter we opened has a JLink-OB
PID and, if it does, uses the JLink-OB endpoints rather than the
default.  To do this, we add a new routine, jtag_libusb_get_pid() to the
libusb adapter layer, it in turn just calls
libusb_get_device_descriptor(), which previously had no wrapper.

Also, checkpatch.pl doesn't like the VID/PID macros as defined so I
moved them to the array itself.  This should have no effect on the code.

This change adds the 0102 through 0104 PIDs to openocd.rules as well as this
new 0105 PID.

Tested on an Atmel SAM4S Xplained board which has a JLink-OB, also
regression tested by using a 0x0101 PID normal JLink adapter.

Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Change-Id: I121d30e57729cda3adb66e2a5dc72e1fcb7ef8b1
Reviewed-on: http://openocd.zylin.com/2031
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoSupport for sam3n0a sam3n0b sam3n00a sam3n00b
Andreas Fritiofson [Thu, 13 Mar 2014 21:18:29 +0000 (22:18 +0100)]
Support for sam3n0a sam3n0b sam3n00a sam3n00b

Change-Id: I70a04f5f9b0b20d42a677ea8781130e44be758d3
Signed-off-by: Stefan Arnold <sarnold@sh-sw.de>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2042
Tested-by: jenkins
Reviewed-by: Stian Skjelstad <stian@nixia.no>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agotop .gitignore: ignore ctags tag files
Antony Pavlov [Tue, 25 Feb 2014 20:10:12 +0000 (00:10 +0400)]
top .gitignore: ignore ctags tag files

Change-Id: I64538525626688b0cd1eda579294e547a2e40b30
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/1971
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agocfg: add TI am43xx devices
Felipe Balbi [Sat, 1 Mar 2014 00:22:38 +0000 (18:22 -0600)]
cfg: add TI am43xx devices

This adds support for the am43xx SoC and the AM437x GP EVM and AM438x
ePOS EVM.

Change-Id: I09cbb09072f38e0e08fdd520dedb6e67d45056be
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tom Rini <trini@ti.com>
Reviewed-on: http://openocd.zylin.com/2047
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoflash/nor/tcl: fix segfault on write_image misuse
Paul Fertser [Tue, 25 Feb 2014 17:22:11 +0000 (21:22 +0400)]
flash/nor/tcl: fix segfault on write_image misuse

"flash write_image (unlock|erase)" (without filename) was causing
segmentation fault in strcmp(). This patch fixes it.

Change-Id: Ia3b8c796f4107621d78605c02d2b8e123b1b207b
Reported-by: ajkroll][ <ajkroll][@irc.freenode.net>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1970
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agomips_ejtag.c: disable DMA for all platforms
Oleksij Rempel [Mon, 27 Jan 2014 09:07:38 +0000 (10:07 +0100)]
mips_ejtag.c: disable DMA for all platforms

DMA seems to be broken in many ways. Don't trust it!

Change-Id: I7e28608f299abdf78d02a967c62849b6b2ce5985
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/1936
Tested-by: jenkins
Reviewed-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agoft2232: Mark interface driver as deprecated
Andreas Fritiofson [Sat, 22 Mar 2014 13:09:06 +0000 (14:09 +0100)]
ft2232: Mark interface driver as deprecated

Change-Id: I5ebc924ab66c86f1902942bebc203a34d97abc64
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1899
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agocfg: Added st nucleo board configs.
Jens Hoffmann [Wed, 5 Mar 2014 21:49:14 +0000 (22:49 +0100)]
cfg: Added st nucleo board configs.

This patch adds board configs for Nucleo FXXX boards.

Change-Id: I25bfd7d63f734bad710917efa67bc6096aa60ef8
Signed-off-by: Jens Hoffmann <jehoffma@gmail.com>
Reviewed-on: http://openocd.zylin.com/2022
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotcl: target: icepick: add icepick_d_tapenable procedure
Felipe Balbi [Sat, 1 Mar 2014 00:22:35 +0000 (18:22 -0600)]
tcl: target: icepick: add icepick_d_tapenable procedure

instead of replicating icepick_d_tapenable in many of TI's newer
platforms, we can move to icepick.cfg and just call it from board TCL
configuration file.  This is similar to the C but has a few changes we
need to make.

Change-Id: I0ab48005ccd66cd5b67b919fb5e3b462288f211d
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tom Rini <trini@ti.com>
Reviewed-on: http://openocd.zylin.com/2030
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
10 years agotcl/interface/ftdi: add Digilent JTAG-SMT2 config
Paul Fertser [Thu, 6 Mar 2014 12:55:13 +0000 (16:55 +0400)]
tcl/interface/ftdi: add Digilent JTAG-SMT2 config

Tested on ZedBoard by Tim Sander.

Change-Id: I4316d9b4d36f01bbe91a46c78ea8bca22efb1a5a
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2029
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agocfg: change default SAM4L cortex_m reset_config
Spencer Oliver [Thu, 27 Feb 2014 20:44:19 +0000 (20:44 +0000)]
cfg: change default SAM4L cortex_m reset_config

From testing this target does not seem to support using SYSRESETREQ, change
the default to the safe VECTRESET.

This target also has other reset issues (srst not working) that will be
addressed in another patch.

Change-Id: Icfc78347dc71aa3a062ddea63190a818d7fbc760
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1995
Tested-by: jenkins
Reviewed-by: Angus Gratton <gus@projectgus.com>
10 years agoCMSIS-DAP: print a debug message when the USB product string cannot be read
Jörg Wunsch [Fri, 14 Mar 2014 13:41:51 +0000 (14:41 +0100)]
CMSIS-DAP: print a debug message when the USB product string cannot be read

As suggested by Stian Skjelstad in a comment in:

http://openocd.zylin.com/#/c/2044/

if the USB product string cannot be read, provide a debug message so
users might get aware of a potential permission problem when looking
at the debug output.

Fix style bug found by Jenkins.

Change-Id: I6acb1c6261fec6f2bee80e4be513a5c5e29eff79
Signed-off-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-on: http://openocd.zylin.com/2048
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoMake the Atmel SAM3 family SWD-aware
Jörg Wunsch [Fri, 14 Mar 2014 10:29:24 +0000 (11:29 +0100)]
Make the Atmel SAM3 family SWD-aware

Atmel's SAM3 and SAM4 processor families are very close to each other
in many respects.  However, so far, only the SAM4 target script
contained the magic to allow using SWD, while SAM3 was tied to JTAG
only.  This e.g. prevented the CMSIS-DAP driver from accessing SAM3
devices as it only uses SWD transport (by now).

The patch pulls all the things from the SAM4 target script that are
also applicable to SAM3 devices.  With the patch, an Atmel CMSIS-DAP
debugger (Atmel-ICE) was proven to be able to successfully attach to a
SAM3S-EK evaluation kit.  I also cross-checked that accessing through
a SAM-ICE (Segger J-Link) still works with the patch.

Change-Id: I20dafbff8e1e9f967da950e48a56205586eeef8d
Signed-off-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-on: http://openocd.zylin.com/2046
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoAll Atmel-provided CMSIS-DAP devices use 512 byte packet size
Jörg Wunsch [Fri, 14 Mar 2014 10:00:54 +0000 (11:00 +0100)]
All Atmel-provided CMSIS-DAP devices use 512 byte packet size

The existing CMSIS-DAP driver matches the USB VID/PID against 0x3eb
(Atmel VID) and 0x2111 (Atmel EDBG embedded CMSIS-DAP debugger), and
then bumps the packet size from its default of 64 to 512.  However, it
turned out that *all* Atmel-provided CMSIS-DAP devices (EDBG with PID
0x2111; JTAGICE3 with firmware version 3.x, PID 0x2140; new Atmel-ICE
[successor of JTAGICE3], PID 0x2141) require a 512-byte packet size.
Obviously, all run the same USB implementation inside their custom
microcontroller.  Thus, it seems best to simply assume that *all*
Atmel CMSIS-DAP devices use this packet size, and don't check the PID
at all.

This has also been filed as Trac bug #68:

https://sourceforge.net/apps/trac/openocd/ticket/68

Change-Id: I942af93060fdf265fca3961841638caa6182f877
Signed-off-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-on: http://openocd.zylin.com/2045
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
10 years agoPrevent segfault when the USB product string cannot be retrieved
Jörg Wunsch [Fri, 14 Mar 2014 09:50:36 +0000 (10:50 +0100)]
Prevent segfault when the USB product string cannot be retrieved

In the CMSIS-DAP driver, if nothing has been specified by the user, an
attempt is made to find the first device with the (mandatory)
substring "CMSIS-DAP" in any USB device's product string.  However,
while (usually) all devices can be traversed, devices the user does
not have permission for cannot be read the product string from,
resulting in a NULL pointer.  Trying to find the substring "CMSIS-DAP"
causes a segementation fault then.

This has also been filed as Trac bug #67:

https://sourceforge.net/apps/trac/openocd/ticket/67

Change-Id: Idfc9f072e34152e9af99fe1c8ec88c99dea4624c
Signed-off-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-on: http://openocd.zylin.com/2044
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agostm32f2x.c: Add STM32F401xE device id.
Jens Hoffmann [Sun, 9 Mar 2014 09:42:09 +0000 (10:42 +0100)]
stm32f2x.c: Add STM32F401xE device id.

Nucleo F401 board uses STM32F401RE chip with new device id and
got more flash than existing devices (512K). This patch adds
new the identifier to probe functions so flashing will now work.

Change-Id: Ibe9c047c79244db0cfbb06610da9d84987b9f85a
Signed-off-by: Jens Hoffmann <jehoffma@gmail.com>
Reviewed-on: http://openocd.zylin.com/2037
Tested-by: jenkins
Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoflash: Constify write buffer
Andreas Fritiofson [Mon, 10 Mar 2014 21:23:07 +0000 (22:23 +0100)]
flash: Constify write buffer

Change-Id: Ic812098d3ed5a2992c26bb57d08ae350e2c5d5d8
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2040
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoflash/kinetis: Fix bug in odd byte count padding
Andreas Fritiofson [Mon, 10 Mar 2014 21:20:16 +0000 (22:20 +0100)]
flash/kinetis: Fix bug in odd byte count padding

Change-Id: Ic5cfd880f2b49e3a96c408cf868db622bfe698a1
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2039
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoflash/efm32: Fix bug in odd byte count padding
Andreas Fritiofson [Mon, 10 Mar 2014 21:18:57 +0000 (22:18 +0100)]
flash/efm32: Fix bug in odd byte count padding

Change-Id: I7fcd152a8501f399c6ac5a85fd62a84c82b030a0
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2038
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agotarget: Don't poll until the target is examined.
Andreas Fritiofson [Tue, 11 Mar 2014 06:59:51 +0000 (07:59 +0100)]
target: Don't poll until the target is examined.

The timer callback is started on target init, but it makes no sense to
poll until the target is fully setup.

Change-Id: I118201e125e39be3d0a920e3ef9a3f68a2035f39
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2041
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agoopenocd.texi: document Tcl RPC and add an example client
Paul Fertser [Fri, 31 Jan 2014 18:59:38 +0000 (22:59 +0400)]
openocd.texi: document Tcl RPC and add an example client

This should provide enough information to start using OpenOCD RPC.

I've seen some other example clients in different languages but I
can't find them anymore, and their legal status was unclear.

Change-Id: I3a95fe361d773040d1e52a62f9cc0cc655019a9f
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1915
Tested-by: jenkins
Reviewed-by: Andreas Ortmann <ortmann@finf.uni-hannover.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agotcl/board: add config for DP Bus Blaster reconfiguration
Paul Fertser [Sun, 9 Mar 2014 05:54:08 +0000 (09:54 +0400)]
tcl/board: add config for DP Bus Blaster reconfiguration

Reported and tested by Gracana on IRC.

Change-Id: If0524d2d627d566e8b5e1d00784dd7556f44b125
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2036
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agogdb_server: do not copy feature names for tdesc generation
Paul Fertser [Fri, 7 Mar 2014 06:45:31 +0000 (10:45 +0400)]
gdb_server: do not copy feature names for tdesc generation

We always have feature names defined by string literals and the
standard guarantees static storage duration for them. Hence, there's
no need duplicating and then freeing them.

Valgrind-tested.

Change-Id: I1b77f966c548e3694141c63bd8680735f0f47505
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2028
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agostlink_usb.c: add support for STLink V2-1
Bartosz Bielawski [Tue, 4 Mar 2014 21:19:16 +0000 (22:19 +0100)]
stlink_usb.c: add support for STLink V2-1

The new version of STLink (V2-1) has a different USB endpoint layout.
As the PID of the device also changed it's possible to change EPs used
by OpenOCD in runtime. The patch adds three new fields to stlink_usb_handle_s
and assigns right EP numbers in stlink_usb_open().
Parts of the code inspired by and used with consent of Jens Hoffmann.

Change-Id: I93b69fb889f15317e9bf864905f435905db39745
Signed-off-by: Bartosz Bielawski <bartosz.bielawski@gmail.com>
Reviewed-on: http://openocd.zylin.com/2019
Tested-by: jenkins
Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
10 years agobcm281xx: Add bcm281xx SoC and bcm28155_ap board
Tim Kryger [Sun, 2 Feb 2014 21:26:26 +0000 (13:26 -0800)]
bcm281xx: Add bcm281xx SoC and bcm28155_ap board

Add support for Broadcom's dual A9 mobile SoC and its reference board.

Change-Id: Ia145b120043bddc89c44726066023154ae390788
Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-on: http://openocd.zylin.com/1926
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
10 years agointerface/ftdi/xds100v2.cfg: Add another VID/PID, drop desc
Tom Rini [Mon, 3 Mar 2014 20:14:47 +0000 (15:14 -0500)]
interface/ftdi/xds100v2.cfg: Add another VID/PID, drop desc

The XDS100v2 is often embedded in a number of platforms using the
VID/PID of 0x0403/0x6010 and a generic FTDI device description.  Add
this VID/PID combination and remove the description line.

Change-Id: I370e6199ac24f802426e9541e19ee38f18f1209a
Signed-off-by: Tom Rini <trini@ti.com>
Reviewed-on: http://openocd.zylin.com/2016
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>