aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2014-03-07stlink: Use callback to increase frequency of trace data samplingAndreas Fritiofson3-4/+20
The ST-LINK/V2 has limited internal buffering, such that trace data can be missed if the target is generating data at a rate quicker than the OpenOCD trace sampling. The issue of lost data is compounded since individual TPIU packets may be split across individual STLINK_TRACE_EP reads, and misleading results can occur if mid-packet loss occurs. This patch increases the frequency of checking for pending trace data with the aim of minimising such losses. Note: With the limited (I/O and memory) bandwidth of the ST-LINK/V2 there cannot, however, be a guarantee against trace data loss. The timer callback is only added when enabling tracing, and is removed when tracing is disabled. Change-Id: Ibde9794b77793d3068f88cb5c1a26f9ceadcbd8a Signed-off-by: James G. Smith <jsmith@ecoscentric.com> Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1661 Tested-by: jenkins
2014-03-07nrf51: Fix format string bugs in nrf51_infoAndrey Smirnov1-8/+12
Additional information string appended to the 'flash info' output used incorrect offsets and was missing a couple of fields. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Change-Id: If131be021295cab6adfca7da03c2f0fb8dca7d42 Reviewed-on: http://openocd.zylin.com/2011 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-07cortex_a: Fix endianess issues in cortex_a8_*_apb_ab_memoryKamal Dasu1-41/+43
Make the APB-AB memory read routines handle endianess order when running on big endian host. cortex_a8_read_apb_ab_memory is also called by cortex_a8_write_apb_ab_memory and was breaking both APB-AB read and write functions. Also fixed bug in write function in calculating the offset of end of buffer data. The change aslo fixes the read issues with all combinations of aligned unaligned memory access found by 'test_mem_access' cmd. Tested with target "test_mem_access 4000", also size 1-9, 'mdb/h/w' 'mwb/h/w' cmds and equivalent gdb 'x' 'set' cmds. Change-Id: Ia927c60c4837617f5342a9beb6fdab1f061855fe Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com> Reviewed-on: http://openocd.zylin.com/1781 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2014-03-07target: add CoreSight PMU and an unidentified component to "dap info"Paul Fertser1-0/+8
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-07target: "dap info" command cosmetic output changesBrad Riensche1-18/+15
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-07targets: Print nested ROM tables with the 'dap info' command.Chris Johns1-344/+382
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-07gdb_server: Fix segfault in (and rewrite) decode_xfer_readAndreas Fritiofson1-30/+18
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-04gdbserver: fix duplicate declarationSpencer Oliver1-1/+0
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-04Add support for the Atmel SAMG53Andrey Yurovsky1-0/+39
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-04CMSIS-DAP: Fix build errors on Mac OS XJens Bauer1-8/+8
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-04gdb_server: fix memory leaks in users of get_reg_features_list()Christian Eggers1-13/+25
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-04Constify received GDB packetChristian Eggers8-46/+46
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-04gdb_server: Don't modify "buf" argument in decode_xfer_read()Christian Eggers1-8/+21
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-04Remove unneeded zero termination of received packetChristian Eggers1-3/+2
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-04gdb-server/rtos: Send correct answer to "qfThreadInfo" packetChristian Eggers1-1/+1
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-04RTOS: Unify wipe-out of thread listChristian Eggers7-91/+24
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-02-24mips32: build register cache in a more clear wayAntony Pavlov1-50/+46
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-24fm3: fix erase flash fail on using High Level Adapters.Nemui Trinomius1-46/+151
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-24drivers/jtag: usb_blaster: make command handlers more strictAntony Pavlov1-15/+13
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-24nrf51: Implement the support for Nordic's nRF51 devicesAndrey Smirnov3-1/+794
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-24EFM32 Wonder Gecko Family supportJoerg Fischer1-1/+22
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-24tcl/drscan: handle invalid syntax with a conditional, not assertPaul Fertser1-1/+4
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-24usb_blaster: ublast_access.h: add guard macroAntony Pavlov1-0/+5
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-24drivers/ftdi: warn the user if he tries to use undefined reset signalsPaul Fertser1-4/+10
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-24ft2232: warn about lack of TRST on "turtle" adapterPaul Fertser1-1/+2
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-24stm32f1x: Fix option byte flag parsingAndreas Fritiofson1-4/+4
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-11arm926ejs: fix write memory operations with caches enabledPaul Fertser1-0/+1
Perform proper ICache flush operations on memory writes. This should fix inability to use software breakpoints for debugging with caches enabled. This patch is only compile-time tested. Commit 1137eaedaf6498f3448cdedf6f93076d9b3fd58a fixed the same issue for arm920t. Among all the arm7_9_common targets only arm926ejs seems to be broken in the same way. Change-Id: I575306ac4319a69fc637b42f7c958f4595c5e81f Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1912 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-02-11quark_x10xx: add new target quark_x10xxAdrian Burns7-1/+3087
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-11nor/flash/stm32f1x: add stm32f07x supportKuldeep Singh Dhaka1-4/+39
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-06cortex_a: do not try to use MMU for translation if it wasn't enabled on ↵Paul Fertser1-33/+36
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-06gdb_server: Fix confusing warning when entering noack modeAnton Kolesov1-5/+15
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-06flash: declare fixed arrays constSpencer Oliver13-32/+32
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-04flash/nor/mdr.c: fix uninitialised variable warningPaul Fertser1-5/+7
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-04flash/nor/stm32f1x: fix format specifiers warningPaul Fertser1-2/+2
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-04target/nds32_disassembler: fix format specifiers warningsPaul Fertser1-13/+13
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-04server/gdb_server: fix uninitialised variable warningPaul Fertser1-1/+1
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-04rtos: fix uninitialised variable warningPaul Fertser1-1/+1
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-04doc: add missing reg command argument 'force'Spencer Oliver1-3/+3
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-04kinetis : improve kinetis flash driver.Nemui Trinomius1-35/+51
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-01-24arm920t: fix write memory operations with caches enabledPaul Fertser1-0/+1
Commit ff5ec942d80a34e20b5a3ca3328f7e6a55fb309b made this target always use generic arm7_9 memory write routines for software breakpoints which resulted in inability to debug and single-step sources in Gdb when icache is active as generic routine doesn't invalidate it. This should fix it (and is real-life tested against Samsung S3C2442). I expect other arm7-9 targets to be affected as well. Change-Id: Id7980e370ae4db47ac6b1490321d81ffe85711c0 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1817 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-01-23Add GDB remote target description support for ARM4Luca BRUNO1-52/+141
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-23CMSIS-DAP: auto-detect CMSIS-DAP USB VID:PIDPeter Lawrence1-8/+43
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-20flash: samd: declare const dataAndrey Yurovsky1-7/+7
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-20gdb_server: check for invalid read memory requestsPaul Fertser1-0/+6
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-20Retire jtag_add_dr_outAndreas Fritiofson12-271/+59
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-20jtag/drivers: add USB-Blaster IIFranck Jullien5-13/+347
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-19target: fix typosSpencer Oliver2-10/+9
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-19cortexm: use Cortex-M rather than cortex-m3 for dwt registersSpencer Oliver1-1/+1
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-15Conform to C99 integer types format specifiersHsiangkai Wang21-556/+784
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-15Atmel samd: add support for SAMD21Andrey Yurovsky1-0/+22
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>