Commit Graph

5152 Commits

Author SHA1 Message Date
Paul Fertser 42881f95ce target: add CoreSight PMU and an unidentified component to "dap info"
Change-Id: I705eae46b190dbd89ab01bc086c49eb04368d9b3
Reported-by: Brad Riensche <brad.riensche@gmail.com>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1928
Tested-by: jenkins
Reviewed-by: Brad Riensche <brad.riensche@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-03-07 18:50:55 +00:00
Brad Riensche 77aecd5376 target: "dap info" command cosmetic output changes
This makes the listing easier to read, imho. The tab indentation
technique causes the base address to precess as the parser proceeds
through the subtables, and can easily wrap.

Change-Id: Iea5e678255e6314a9d532e4b222a2572b5394390
Signed-off-by: Brad Riensche <brad.riensche@gmail.com>
Reviewed-on: http://openocd.zylin.com/1518
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-03-07 18:50:35 +00:00
Chris Johns 623eb336cf targets: Print nested ROM tables with the 'dap info' command.
Move the ROM table printing into a separate function to allow
recursive calls with nested tables. ROM tables can nest. The
printing is limited to 16 levels.

Update the types of tables printed. When an entry can't be read, print
a warning and continue.

Change-Id: Ib134edd9e987af2f5f606071521885b17af4d70f
Signed-off-by: Chris Johns <chrisj@rtems.org>
Reviewed-on: http://openocd.zylin.com/1427
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-03-07 18:47:29 +00:00
Andreas Fritiofson 3560c8e06b gdb_server: Fix segfault in (and rewrite) decode_xfer_read
Introduced by 537b06a81 (free non-malloced memory).

Rewrite to use standard C string routines and make returning annex
optional since it's not currently used.

Change-Id: Idf3698a482dfeff7fa5ea1660fd89122eb80b68d
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2023
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-07 11:40:55 +00:00
Spencer Oliver 35fdbdcecd gdbserver: fix duplicate declaration
commit da0d1e37 did not merge correctly, causing the build to fail.

Change-Id: I3f525054bb38b7ee29bf27309bb2e6a5bb8329c7
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2020
Tested-by: jenkins
2014-03-04 22:22:37 +00:00
Andrey Yurovsky 8e44a9663d Add support for the Atmel SAMG53
flash: at91sam4: add support for the SAMG53 family (this also covers the
SAMG51).  The SAMG5x parts have an EEFC (enhanced embedded flash controller)
which seems to be identical to the EFC that the sam4 driver supports.

Add a script for the Xplained Pro G53 board, this has the onboard CMSIS-DAP
debugger and a SAMG53N19.  Tested on this board and chip combination.

Change-Id: I12af50402cd2069b3c7380d92e6fe54816d6c045
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/1974
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04 20:18:37 +00:00
Jens Bauer d585c1627a CMSIS-DAP: Fix build errors on Mac OS X
Rename the argument variable 'wait' to 'delay', as 'wait'
conflicts with an API function declared in system header
/usr/include/sys/wait.h on Mac OS X.

Change-Id: I5742da6e5def6e5ec197e774c3844e4bf0424569
Signed-off-by: Jens Bauer <jens@gpio.dk>
Reviewed-on: http://openocd.zylin.com/1973
Tested-by: jenkins
Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04 20:18:17 +00:00
Christian Eggers da0d1e374b gdb_server: fix memory leaks in users of get_reg_features_list()
v4:
- changed first line of commit message
v3:
- added extra LOG_ERROR() message
v2:
- Added missing "goto error"
- free also the on extra element of features[]

In contrast to target_get_gdb_reg_list(), the list returned by
get_reg_features_list() consists of items which are itself
malloc'ed.
--> Free the list items prior freeing the list itself.

Additionally:
- gdb_generate_target_description():
  o Do error handling similar as gdb_get_target_description_chunk() does.
- gdb_get_target_description_chunk()
  o **features must be initialised prior an "goto error" can happen

Change-Id: Iad07824618c51084e0aa0499ee6fc96198b320f0
Signed-off-by: Christian Eggers <ceggers@gmx.de>
Reviewed-on: http://openocd.zylin.com/1917
Tested-by: jenkins
Reviewed-by: Trevor Woerner <trevor.woerner@linaro.org>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04 20:17:53 +00:00
Christian Eggers 9b2577742c Constify received GDB packet
v2:
- Split work into separate patches

The received packet will not be altered in any of the processing functions.
Some it can be made "const".

Change-Id: I7bb410224cf6daa74a6c494624176ccb9ae638ac
Signed-off-by: Christian Eggers <ceggers@gmx.de>
Reviewed-on: http://openocd.zylin.com/1919
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04 20:17:34 +00:00
Christian Eggers 537b06a810 gdb_server: Don't modify "buf" argument in decode_xfer_read()
Make a temporary copy of argument "buf" before modifying it.
This requires also returning annex as copy of "buf".

This change is necessary in order to make packet[] "const".

Change-Id: I41eddc2edba1a88384aa7f5591fe50f6ee6a135c
Signed-off-by: Christian Eggers <ceggers@gmx.de>
---
Changelog:
v4:
- Initialize annex to NULL
v3:
- Return "annex" as copy instead of removing it.
Reviewed-on: http://openocd.zylin.com/1924
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04 20:16:47 +00:00
Christian Eggers 6fcaa4ae8f Remove unneeded zero termination of received packet
v2:
  removed curly braces around single statement if-block

packet[] has already been zero terminated in gdb_input_inner()
This change is necessary in order to make packet[] "const".

Change-Id: I978bbe52d151a63574db77fb747f596da256d377
Signed-off-by: Christian Eggers <ceggers@gmx.de>
Reviewed-on: http://openocd.zylin.com/1922
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04 20:15:36 +00:00
Christian Eggers d0507207ab gdb-server/rtos: Send correct answer to "qfThreadInfo" packet
Even if no RTOS is configured, "qfThreadInfo" must be answered with "l"
instead of "". Otherwise GDB will switch to the older thread packet ("qL"),
which is not supported by OpenOCD.

Change-Id: Iead045bdf8268bac2378c8f70829b17c37834e44
Signed-off-by: Christian Eggers <ceggers@gmx.de>
Reviewed-on: http://openocd.zylin.com/1925
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04 20:15:03 +00:00
Christian Eggers d36889e692 RTOS: Unify wipe-out of thread list
Each RTOS implementation uses it's own (similar) code to free
the thread list. There are some additional issues:

<--->
if (pointer != NULL)
	free(pointer);
<--->
This is not necessary, free(NULL) is perfectly ok.

<--->
free(rtos->thread_details);
rtos->thread_details = NULL;
rtos->thread_count = 0;
<--->
The 3rd line has been missing for all RTOS but ChibiOs. There are paths
in the code where rtos->thread_count is never set to NULL, which can
lead to null pointer dereference of rtos->thread_details.

Change-Id: I6f7045c3d4518b925cb80dd5c907a566536b34ad
Signed-off-by: Christian Eggers <ceggers@gmx.de>
---
Changelog:
v7:
- rtos_wipe_threadlist() --> rtos_free_threadlist()
- removed non related changes in gdb_server.c from this patch
v3:
- Removed world "topic" from first line of commit message
v2:
- typo: "whipe" --> "wipe"
Reviewed-on: http://openocd.zylin.com/1916
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04 20:13:58 +00:00
Antony Pavlov bc1340cf0b mips32: build register cache in a more clear way
This commit is inspired by armv7m_build_reg_cache().

Change-Id: I62b51b2a5f0fed788af167b6f8e60c09b53181be
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/1943
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24 12:10:29 +00:00
Nemui Trinomius 5fcfe5cfea fm3: fix erase flash fail on using High Level Adapters.
This fix can "erase flash" on using High Level Adapters by running algorithm.
Because fm3 flash commands must need true 16-bit memory access,
but High Level Adapters(ST-Link/TI-ICDI) can 8/32bit access only.
Tested on MB9BF618T and MB9AF112K with STLink/V2.

Change-Id: I849a8a8e8ae2b3e77717de04f7522cf718c915d7
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/1944
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24 12:10:01 +00:00
Antony Pavlov b27c53354d drivers/jtag: usb_blaster: make command handlers more strict
If user used wrong argument number for some usb_blaster_* commands
then openocd show just warning message.
This commit makes command handler's behaviour more strict and
openocd treats wrong argument number as an error.

In addition we already have 'help' and 'usage' information in
struct command_registration ublast_command_handlers[],
so we can drop redundancy messages in command handlers.

Change-Id: I73b8c75ec60a18e5258a4bdffe972e8a1afc1066
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/1942
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24 12:09:15 +00:00
Andrey Smirnov 7e4fb97559 nrf51: Implement the support for Nordic's nRF51 devices
Add support for Nordic's nRF51 chip series. Tested with nRF51822.

Change-Id: Id70f6fd76888cc595a353aefb84d25c4cd325d7d
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-on: http://openocd.zylin.com/1945
Tested-by: jenkins
Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24 12:09:04 +00:00
Joerg Fischer de4a2189a5 EFM32 Wonder Gecko Family support
Add support for EFM32 Wonder Gecko family to flash driver.
This family has Cortex M4F core.

Change-Id: If71511015403069e3e30cb9f19df12cd97ac49e8
Signed-off-by: Joerg Fischer <turboj@gmx.de>
Reviewed-on: http://openocd.zylin.com/1968
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24 12:08:26 +00:00
Paul Fertser bb0ef230ca tcl/drscan: handle invalid syntax with a conditional, not assert
When "drscan" command is used improperly, such as in:
drscan stm32f1x.cpu -endstate drpause
there're no fields to scan, and so the assert leads to a
segfault. This should be treated like any other syntax error instead.

Change-Id: Id1743f5d641038e1e3754c6f3097aabc5d1916b9
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1927
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24 12:01:52 +00:00
Antony Pavlov 98b808923f usb_blaster: ublast_access.h: add guard macro
Change-Id: I10f6e2048cf88f64f5dce275a273783365afd65c
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/1941
Tested-by: jenkins
Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-02-24 12:01:34 +00:00
Paul Fertser 1f35e124d3 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>
2014-02-24 11:57:07 +00:00
Paul Fertser 6d46ad11b5 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>
2014-02-24 11:56:54 +00:00
Andreas Fritiofson 829e532c33 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>
2014-02-24 11:55:45 +00:00
Paul Fertser 6c74255ee2 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 1137eaedaf 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>
2014-02-11 13:38:39 +00:00
Adrian Burns 1338cf60b9 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>
2014-02-11 13:07:29 +00:00
Kuldeep Singh Dhaka 7b9b4a0d28 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>
2014-02-11 11:05:44 +00:00
Paul Fertser ddef36905c 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>
2014-02-06 22:21:57 +00:00
Anton Kolesov e4125d136c 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>
2014-02-06 22:20:29 +00:00
Spencer Oliver 32c4c18045 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
2014-02-06 22:17:51 +00:00
Paul Fertser facd0e7827 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>
2014-02-04 21:38:40 +00:00
Paul Fertser da9bee3ede 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>
2014-02-04 21:18:30 +00:00
Paul Fertser 279878ccd7 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>
2014-02-04 21:18:27 +00:00
Paul Fertser 3e0f34b198 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>
2014-02-04 21:18:24 +00:00
Paul Fertser 164c543799 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>
2014-02-04 21:17:24 +00:00
Spencer Oliver 47d4224d48 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
2014-02-04 20:53:49 +00:00
Nemui Trinomius 3feac9a740 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>
2014-02-04 13:17:31 +00:00
Paul Fertser 1137eaedaf arm920t: fix write memory operations with caches enabled
Commit ff5ec942d8 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>
2014-01-24 12:48:43 +00:00
Luca BRUNO 2efb1f14f6 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>
2014-01-23 21:39:13 +00:00
Peter Lawrence 3271e6d4d5 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>
2014-01-23 21:32:46 +00:00
Andrey Yurovsky 0b263763f5 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>
2014-01-20 14:25:54 +00:00
Paul Fertser 245e8fff3b 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>
2014-01-20 13:29:01 +00:00
Andreas Fritiofson 63fa73169b 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>
2014-01-20 13:28:26 +00:00
Franck Jullien 87e91f4db9 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>
2014-01-20 13:28:02 +00:00
Spencer Oliver 009f5c2af0 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>
2014-01-19 19:26:12 +00:00
Spencer Oliver c46dd490d1 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>
2014-01-19 19:24:34 +00:00
Hsiangkai Wang 94d64ccaeb 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>
2014-01-15 12:40:42 +00:00
Andrey Yurovsky 32eea3f68e 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>
2014-01-15 11:38:25 +00:00
Andreas Fritiofson 178b5d072e 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>
2014-01-11 22:22:25 +00:00
Andreas Fritiofson bd0fbef5c8 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>
2014-01-11 22:22:18 +00:00
Andreas Fritiofson 6647131ff5 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>
2014-01-11 22:21:35 +00:00
Andreas Fritiofson e65817653f 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>
2014-01-11 22:21:04 +00:00
Nemui Trinomius cb6836f923 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>
2014-01-11 22:19:57 +00:00
Andrey Yurovsky 215c41c017 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>
2014-01-09 15:23:27 +00:00
Andrey Yurovsky 9cabe333e1 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>
2014-01-09 15:23:15 +00:00
Spencer Oliver 4dc8cd201c 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
2014-01-09 15:20:51 +00:00
Andreas Fritiofson 4bff54ccf4 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>
2014-01-09 13:21:51 +00:00
Robert P. J. Day 436f66b463 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>
2014-01-08 22:17:59 +00:00
Franck Jullien bc256b17d5 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>
2013-12-31 12:00:49 +00:00
Franck Jullien f4947e8b88 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>
2013-12-30 15:49:15 +00:00
Steve Moorby 3d73c0bb51 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>
2013-12-30 15:48:36 +00:00
Per Ekman 624e74ec40 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>
2013-12-22 20:25:10 +00:00
Mathias K 963214c83d 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>
2013-12-22 20:24:56 +00:00
Per Ekman 1ab86419d7 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>
2013-12-22 20:24:42 +00:00
Andreas Fritiofson 537b75aa45 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>
2013-12-22 20:24:26 +00:00
Andreas Fritiofson 619b8383e9 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>
2013-12-22 20:24:13 +00:00
Ed Maste 9b2cc2f72f 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>
2013-12-22 20:22:50 +00:00
Mathias K 23be4e435f 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>
2013-12-22 20:22:37 +00:00
Franck Jullien 0da3f66ed4 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>
2013-12-22 13:14:04 +00:00
Sergey A. Borshch 5175f8be33 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>
2013-12-17 23:04:01 +00:00
Andreas Fritiofson 255301fb50 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>
2013-12-17 22:55:31 +00:00
Sergio Chico 93a3a82e49 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>
2013-12-14 21:53:16 +00:00
Spencer Oliver 242649c81c flash: revert incorrect stm32f1 default_padded_value
Commit 2493671e2d 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>
2013-12-14 21:46:44 +00:00
Luca BRUNO bb8c0d55d4 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>
2013-12-01 12:44:09 +00:00
Dongxue Zhang 4516eebaba [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>
2013-12-01 12:39:36 +00:00
Andreas Fritiofson 3b020c5bb3 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>
2013-12-01 12:37:52 +00:00
Per Ekman 30fb9dd438 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>
2013-11-08 15:09:26 +00:00
Per Ekman b5d7889f51 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>
2013-11-08 15:09:13 +00:00
Per Ekman 88e9d0f408 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>
2013-11-08 15:09:00 +00:00
Mathias K 1e6970dafd 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>
2013-11-07 22:19:50 +00:00
Spencer Oliver edfb677d34 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>
2013-11-07 21:38:49 +00:00
Andreas Fritiofson 2ad2554e52 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
2013-11-06 13:10:16 +00:00
Paul Fertser 56d4a59548 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>
2013-11-06 13:08:38 +00:00
Andrey Yurovsky f97aafdfaf 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>
2013-11-06 13:06:49 +00:00
Nemui Trinomius 9b1eb2365e 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>
2013-11-06 12:59:18 +00:00
Alan Bowman 6adc1ced89 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>
2013-11-06 12:59:04 +00:00
Andreas Fritiofson dc15e0a295 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>
2013-11-05 09:39:43 +00:00
Mathias K a3c0f05461 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
2013-10-31 21:11:48 +00:00
Andreas Fritiofson 4f6f065201 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>
2013-10-31 20:45:55 +00:00
Andreas Fritiofson 484dbcc302 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>
2013-10-31 20:45:46 +00:00
Andreas Fritiofson e673304922 ioutil: Remove unnecessary casts and fix const-discarding
Using the right parameter type, there's no need to resort to casting.

Change-Id: I8aec852431ead26e24793fd6fac8781353963bf2
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1777
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Jens Bauer <jens@gpio.dk>
2013-10-31 20:45:34 +00:00
Andreas Fritiofson 01298ca2c8 binarybuffer: Remove unnecessary cast and fix hidden "bug"
Because of the cast, the const decoration on the parameter provided no
guarantee against modification since it was silently discarded.

Change-Id: Ib83ade955e1a61ee2175c690620437b5e19cbb6a
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1776
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:45:26 +00:00
Andreas Fritiofson 4935709484 str9x: Fix byte order bug
Found by grepping for pointer casts.

Change-Id: Ie2d698310b077c3849266e81df8e6a808cbc6896
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1775
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:45:16 +00:00
Andreas Fritiofson 3d064b2e21 str7x: Fix byte order bug
Found by grepping for pointer casts.

Change-Id: I56d5680590e37d8c61197488067fbb0776e5e0f0
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1774
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:45:04 +00:00
Andreas Fritiofson bee7836b6a stm32f1x: Fix byte order bug and remove unnecessary cast
Found by grepping for pointer casts.

Change-Id: Ibd8f22a9e9ca71459ba0bedc8447a3623d0e4184
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1773
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:44:55 +00:00
Andreas Fritiofson 4831236af4 pic32mx: Fix byte order bug
Found by grepping for pointer casts.

Change-Id: If73184a16904ec2958e7253ba98f44479fdcad3f
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1772
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:44:47 +00:00
Andreas Fritiofson b310881e38 lpc2900: Fix byte order bugs and remove unnecessary casts
Found by grepping for pointer casts.

Change-Id: Ib94957a0c53ec7abcbd5787d8c70e20c9eedc4b7
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1770
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:43:53 +00:00
Andreas Fritiofson 97153e4fca aduc702x: Fix byte order bug
Found by grepping for pointer casts.

Change-Id: I00e000515cb2573130b73423eb19ba941f524b05
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1769
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:43:44 +00:00
Andreas Fritiofson 582c8b0147 ftdi: Remove unnecessary cast
Also make sure future growth of the tap_get_tms_path() return value will
get noticed.

Change-Id: Id859b463e5fdc819a4bc3b4845bf4363fbe713af
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1768
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:43:35 +00:00
Andreas Fritiofson ba2fbe2247 Remove unnecessary casts
Change-Id: Ia97283707282ccccdc707c969f59337313b4e291
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1767
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:43:27 +00:00
Andreas Fritiofson 704082443d nand/mx*: Remove unused host endianness flag
Probably shouldn't depend on that anyway.

Change-Id: Ic27ead4cb82cff1ab187696439da4b93941e09d8
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1766
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:43:15 +00:00