openocd.git
7 years agotcl/board: add Marsohod3 FPGA board config 06/3606/2
Antony Pavlov [Sun, 27 Sep 2015 23:04:46 +0000 (02:04 +0300)]
tcl/board: add Marsohod3 FPGA board config

Marsohod3 is a cheap FPGA Development and Education board.
Please see http://www.marsohod.org/plata-marsokhod3 for details.

Sample usage:

  openocd -f board/marsohod3.cfg -c init -c "svf -tap 10m50.tap project.svf" -c shutdown

Change-Id: Ie5f43e696bbd1f3be2710c3916e808359f6e8d18
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/3606
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agotcl/fpga: add config file for Altera 10M50 FPGA (MAX10 family) 05/3605/2
Antony Pavlov [Sun, 27 Sep 2015 23:04:20 +0000 (02:04 +0300)]
tcl/fpga: add config file for Altera 10M50 FPGA (MAX10 family)

Change-Id: I1a9cfa14e5127226af4e4b4bf30e1b5d6feedc34
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/3605
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agotcl/board: add Marsohod2 FPGA board config 90/2890/3
Antony Pavlov [Mon, 27 Jul 2015 21:44:52 +0000 (00:44 +0300)]
tcl/board: add Marsohod2 FPGA board config

Marsohod2 is a very cheap FPGA Development and Education board.
Please see http://www.marsohod.org/prodmarsohod2 for details.

Sample usage:

  openocd -f board/marsohod2.cfg -c init -c "svf -tap ep3c10.tap project.svf" -c shutdown

Change-Id: Ibf39a5d463eeda9d4031fa626f01ea2599396ff2
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2890
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
7 years agointerface: Add XDS100v3 support. 32/3632/5
Remco Bloemen [Tue, 9 Aug 2016 11:30:12 +0000 (12:30 +0100)]
interface: Add XDS100v3 support.

XDS100v3 is software compatible with the XDS100v2, but has a
different usb pid. This commit adds `xds100v3.cfg` that sources
the v2 one and changes the usb pid.

Change-Id: Ie29d325e8992d2de2f97d70862beeb63932ffa80
Signed-off-by: Remco Bloemen <openocd-gerrit@xn--2-umb.com>
Reviewed-on: http://openocd.zylin.com/3632
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agotcl/interface/ftdi: add config for the MBFTDI adapter 04/3604/2
Antony Pavlov [Sat, 26 Sep 2015 22:34:09 +0000 (01:34 +0300)]
tcl/interface/ftdi: add config for the MBFTDI adapter

MBFTDI is a very cheap FT2232-based JTAG adapter
for programming Marsohod FPGA board.

Please see http://www.marsohod.org/prodmbftdi for details.

Change-Id: I35f758b49d1566098dc27f9581829cccad93ceeb
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/3604
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agodoc: correct and standardize instructions for disabling TCP servers 38/3638/2
Peter A. Bigot [Wed, 10 Aug 2016 21:58:07 +0000 (16:58 -0500)]
doc: correct and standardize instructions for disabling TCP servers

The instructions to set the port to zero to disable a service has not
worked for several years: the effect of doing so is to start the service
on a port randomly selected by the bind(2) system call.

Update the documentation to reflect the new standard way of disabling
network services.

Change-Id: Ic5315a80f9956ea195f63e05d30d604a980bbc8f
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Reviewed-on: http://openocd.zylin.com/3638
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agogdb_server: support disabling server 37/3637/2
Peter A. Bigot [Wed, 10 Aug 2016 21:54:00 +0000 (16:54 -0500)]
gdb_server: support disabling server

Although the documentation suggested this worked, and it is implemented
for tcl_port and telnet_port, the directive was not recognized for
gdb_port.

Change-Id: I38d95ee879ec3f6d551603b7313749a21e0e498e
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Reviewed-on: http://openocd.zylin.com/3637
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoFlash handling for STM32F76x/77x and F446 added 26/3526/5
Andreas Bolsch [Mon, 20 Jun 2016 19:02:29 +0000 (21:02 +0200)]
Flash handling for STM32F76x/77x and F446 added

- added ids for various parts
- rewrite of sector allocation to deal with dual-bank F76x/77x
- single- / dual-bank mode for F76x/77x
- sector protection adapted for F76x/77x in dual-bank mode
- handling of additional option bits (28-31) in FLASH_OPTCR
  in options_read and options_write for F42x/43x/469/479/7xx,
  options bits 0-1 masked out
- check for sensible value of user_options in options_write

- some #defines clarified, non-needed ones removed

- docs updated (options read, options write)

Change-Id: Ie4db80e60baa7d2663e024ab1f278640b1ce901b
Signed-off-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-on: http://openocd.zylin.com/3526
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agortos: remove display_str member 58/3558/4
Steven Stallion [Wed, 20 Jul 2016 19:05:12 +0000 (14:05 -0500)]
rtos: remove display_str member

This patch removes the display_str member in the thread_detail struct.
This member was not being used and provides no additional benefit over
the thread_name_str and extra_info_str members. This change is made in
preparation of support for the qXfer:threads:read packet, which will
modernize how thread information is shared with GDB.

Change-Id: I1f8bc6325e6aa790e02ea6caee9d6f44c5fedf36
Signed-off-by: Steven Stallion <stallion@squareup.com>
Reviewed-on: http://openocd.zylin.com/3558
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
7 years agotarget/stm32f4x.cfg: Add STM32F410/F412/F469. 77/3377/3
Uwe Bonnes [Wed, 2 Mar 2016 12:29:47 +0000 (13:29 +0100)]
target/stm32f4x.cfg: Add STM32F410/F412/F469.

Taken from git://git.ac6.fr/openocd commit e8ed67c42227b7072a1e7

Change-Id: Iac106d4823123eaa96f16a975e7ecbcb24189924
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3377
Tested-by: jenkins
Reviewed-by: Stian Skjelstad <stian@nixia.no>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoflash/nor/tcl.c: Less verbose output of flash erase_check. 01/3501/5
Uwe Bonnes [Sat, 21 May 2016 13:50:49 +0000 (15:50 +0200)]
flash/nor/tcl.c: Less verbose output of flash erase_check.

Only report non-erased or unknown sectors or if bank is fully erased.

Change-Id: I94f0bc2a0d6529d1ea5f66b284cefd6a2c61fe39
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3501
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
7 years agostm32l4: Handle failing flash_size read like on other devices. 03/3503/2
Uwe Bonnes [Sun, 22 May 2016 14:51:34 +0000 (16:51 +0200)]
stm32l4: Handle failing flash_size read like on other devices.

Change-Id: I54d7cd3a8c80d0e4663c3c09457a4ff338a6f1a0
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3503
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
7 years agoboard: add configuration for freescale imx6q sabresd board 57/3357/4
Matthias Welwarsky [Tue, 9 Feb 2016 14:05:44 +0000 (15:05 +0100)]
board: add configuration for freescale imx6q sabresd board

This configuration file contains jtag, reset and init functions
for the Freescale SabreSD board variant with iMX6Q SoC.

Change-Id: I2366af6da1d82550eb485f36ad61469305c59ffb
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3357
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agojlink: fix jlink regression introduced by ae8cdc commit 94/3394/2
Sergey A. Borshch [Tue, 5 Apr 2016 16:50:12 +0000 (19:50 +0300)]
jlink: fix jlink regression introduced by ae8cdc commit

1) wrong last bit was shifted out in the end of IRSHIFT/DRSHIFT in
   jlink_execute_scan()
2) TDI buffer was not cleared in jlink_tap_init(), results in wrong
data shifted out to the TDI and "Bad value '00000000' captured
during DR or IR scan" error message.
3) sizeof(tdi_buffer) was used in memset() to clean tms buffer. It
is the same as sizeof(tms_buffer), but shoud be fixed to make source
code consistent

Change-Id: I13f26d1c3e88eefc3856fe2b8542fb0ccea6acb1
Signed-off-by: Sergey A. Borshch <sb-sf@users.sourceforge.net>
Reviewed-on: http://openocd.zylin.com/3394
Tested-by: jenkins
Reviewed-by: Harry Zhurov <harry.zhurov@gmail.com>
Reviewed-by: Anton Gusev
Reviewed-by: Михаил Цивинский <mtsivinsky@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agotcl/target/stm32f4x.cfg: Use Workareasize of smallest possible device. 78/3378/2
Uwe Bonnes [Wed, 2 Mar 2016 12:36:54 +0000 (13:36 +0100)]
tcl/target/stm32f4x.cfg: Use Workareasize of smallest possible device.

Increase workareasize when it is know we have a larger device.

Change-Id: Ieaee92e7cd25cc201989f14de122349698871412
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3378
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agopsoc4: Corrected Silicon IDs 19/3619/3
George Ioakimedes [Sun, 7 Aug 2016 01:23:50 +0000 (18:23 -0700)]
psoc4: Corrected Silicon IDs

Corrected 2 Silicon IDs that were swapped.
I've tested with a CY8C4125AXI-483 and  confirmed
that the device is recognized correctly now.

Change-Id: I6fcbee33558d8feec9abf6052df3f15523379c48
Signed-off-by: George Ioakimedes <georgeioak@gmail.com>
Reviewed-on: http://openocd.zylin.com/3619
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agotarget: check late abort from target in async_algorithm 60/3560/2
Tomas Vanek [Thu, 21 Jul 2016 07:27:00 +0000 (09:27 +0200)]
target: check late abort from target in async_algorithm

target_run_flash_async_algorithm() ignored abort from target
(rp set to 0) when raised after all data have been written in fifo.
I could result e.g. in not reported error during flash write.

The change adds rp test after target algorithm has finished.

Change-Id: Iadd93371e4a4602737be10079479285d81ae41b2
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3560
Tested-by: jenkins
Reviewed-by: Steven Stallion <stallion@squareup.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoat91samd: Add Atmel SAMD09 family support 28/3428/3
Olaf Lüke [Wed, 27 Apr 2016 15:23:05 +0000 (17:23 +0200)]
at91samd: Add Atmel SAMD09 family support

Change-Id: I0ee3bb92aa168ed070863ac09e3c457a4b2e2220
Signed-off-by: Olaf Lüke <olaf@tinkerforge.com>
Reviewed-on: http://openocd.zylin.com/3428
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Liviu Dudau <liviu@dudau.co.uk>
7 years agotcl/target/stm32l4x.cfg: Reduce adapter speed before reset. 66/3366/5
Uwe Bonnes [Sun, 28 Feb 2016 18:20:43 +0000 (19:20 +0100)]
tcl/target/stm32l4x.cfg: Reduce adapter speed before reset.

Change-Id: I200286c0b980369f74e8f1e497bc5e565ddb616d
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3366
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agortos: removed chSysInit from detection of ChibiOS (#121) 81/3381/4
Andy Pomfret [Tue, 8 Mar 2016 13:52:36 +0000 (13:52 +0000)]
rtos: removed chSysInit from detection of ChibiOS (#121)

Using the presence of the 'chSysInit' symbol for detection of
ChibiOS is dangerous because this symbol may not be available
if link-time optimisation is used.

This patch removes this reliance, so the symbols 'ch' and 'ch_debug'
are the only things required for ChibiOS detection.

If 'ch' is present but 'ch_debug' is not, an info message suggests
that Chibios might be present without its registry being enabled.
This message has been reworded a little to make it slightly more
equivocal because the chances of a false positive message are
increased.

Addresses bug #121, "ChibiOS rtos detection fails with LTO enabled".

Change-Id: I5ef224735c06446751adee010ce75be4f30f0403
Signed-off-by: Andy Pomfret <cooperised@gmail.com>
Reviewed-on: http://openocd.zylin.com/3381
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agokinetis_ke: Switch to standard build variables 05/3505/2
Andreas Färber [Sun, 22 May 2016 17:12:20 +0000 (19:12 +0200)]
kinetis_ke: Switch to standard build variables

Instead of using ARM_ prefixed variables and an "arm" target,
use CROSS_COMPILE, AS, OBJCOPY. This requires to switch from ?= to =
to avoid the host assembler getting invoked.

This allows to handle kinetis_ke subdirectory like fm4 and xmc1xxx.

Change-Id: I7ea0bf119f6c4716f4d6002794004730af49eef4
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3505
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agocontrib/loaders: Add umbrella Makefile 04/3504/4
Andreas Färber [Sun, 22 May 2016 14:57:16 +0000 (16:57 +0200)]
contrib/loaders: Add umbrella Makefile

Add a Makefile that orchestrates the other loader Makefiles.
It assumes that the clean target can be run without cross toolchain.

at91sam7x does not successfully build and is not really needed either,
therefore left out.

Add an exception to .gitignore for any contrib/loaders Makefile.

Change-Id: I74456b768472f3190a1721bcf41a777bb8daf973
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3504
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agopsoc4.cfg: fixed typo in message, add a hint 17/3617/2
Tomas Vanek [Sat, 6 Aug 2016 06:28:04 +0000 (08:28 +0200)]
psoc4.cfg: fixed typo in message, add a hint

PSoC4 design prevents reset halt/init with standard/low level
SWD adapter if hw reset line configured. Give user hint
to use 'reset_config none' in such case.

Change-Id: I0ca2c46b8575829b0013fd151f2eb63963d66653
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3617
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoCortex-M7 handling. 31/3531/2
Andreas Bolsch [Sun, 26 Jun 2016 11:21:46 +0000 (13:21 +0200)]
Cortex-M7 handling.

- FPU detection and FPU register support added for Cortex-M7.
  There is no apparent difference between FPv4 and FPv5_SP but ...

- Autoincrement range for MEM-AP added for Cortex-M7

This patch together with #3526 replaces #3123 except for stm32f7x.cfg.

Change-Id: I5ed5392e3835674160563ff37d67622a7bf2c877
Signed-off-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-on: http://openocd.zylin.com/3531
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoxilinx-xc7: correct Artix7 15T IDCODE 33/3633/2
Felix Held [Wed, 10 Aug 2016 01:09:02 +0000 (03:09 +0200)]
xilinx-xc7: correct Artix7 15T IDCODE

The IDCODE of Artix7 15T in the UG470 is wrong; Artix7 35T and 15T don't have the same IDCODE.
I've tested this on real hardware.

Change-Id: Iac267dc449c23454dd119126749dbeb8267c18ac
Signed-off-by: Felix Held <felix-openocd@felixheld.de>
Reviewed-on: http://openocd.zylin.com/3633
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
7 years agoadi_v5_jtag: clear sticky overrun condition in WAIT timeout 76/3476/5
Matthias Welwarsky [Wed, 13 Jul 2016 09:48:48 +0000 (11:48 +0200)]
adi_v5_jtag: clear sticky overrun condition in WAIT timeout

If WAIT recovery fails (times out), an ABORT command is issued to the
DAP but under some conditions the SSTICKYORUN bit in CTRL/STAT is not
cleared as well, which renders the DP unusable. This happens when
trying to access e.g. the ROM table of powered-down cores, on many
targets.

Change-Id: Id0a7ba6180069eee562871314f520f938df9718f
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3476
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agotarget: add "phys" argument to mem2array, array2mem 87/3387/2
Matthias Welwarsky [Wed, 2 Mar 2016 12:52:52 +0000 (13:52 +0100)]
target: add "phys" argument to mem2array, array2mem

Allow using physical addresses with mem2array and array2mem. In order
to minimize the impact on existing scripts, "phys" is added as an
optional 5th parameter to both commands.

This patch also adds "phys" variants to the memwrite/memread commands
in memory.tcl.

Change-Id: Ia6307f9d861789e7f3ccf1f98961d666bf8d85d6
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3387
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoFix resume when core state has been modified 86/3386/7
Matthias Welwarsky [Wed, 29 Jun 2016 13:39:11 +0000 (15:39 +0200)]
Fix resume when core state has been modified

Sometimes it is necessary to resume into a different state (ARM/Thumb)
than at debug state entry. According to the documentation this should
be possible with "arm core_state arm|thumb" before the resume command,
however the original code also restores the original CPSR, which
overrides whatever state the core was set to. This seems to work on some
cores (e.g. Cortex-A5) but not on others (e.g. Cortex-A9). Using the "BX"
instruction to set resume PC and core state works on Cortex-A9 and
ARM11, but is not sufficient on Cortex-A5, where an explicit write to
the PC (MOV pc, r0) is required additionally.

Change-Id: Ic03153b4b250fbb8cf6c75f8e329fb34829aa35f
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3386
Tested-by: jenkins
Reviewed-by: Alexander Stein <alexanders83@web.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoflash: nor: mdr: fix verification problem with 1986VE1T or 1986VE3T 09/3509/3
Andrey Skvortsov [Wed, 25 May 2016 10:11:18 +0000 (13:11 +0300)]
flash: nor: mdr: fix verification problem with 1986VE1T or 1986VE3T

1986VE1T and 1986VE3T have issue with flash acceleration engine described
in their errata (issue 0007).
After programming flash acceleration engine's buffer contains old data,
and therefore first read data are wrong. Because of this verification after
programming fails always. Recommended workaround for the issue is to flush
flash accelerator's buffer. To do so it's necessary to read at least 64
bytes of flash through accelerator.

Reading bytes through JTAG using default_flash_read doesn't help.
It seems that reading should be done by uC itself.

Change-Id: I18ef464a68ad5c5b16d3933f31ca61f8e2e7cca3
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Reviewed-on: http://openocd.zylin.com/3509
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
7 years agoFix usage of timeval_ms() 99/3499/2
Andreas Färber [Sun, 22 May 2016 02:34:04 +0000 (04:34 +0200)]
Fix usage of timeval_ms()

First, fix the timeval_ms() implementation to not have K&R but ANSI
argument semantics by adding a missing void.

timeval_ms() returns an int64_t, not uint64_t or long long. Consistently
use int64_t for variables and PRI*64 as format string.

While at it, change a few related variables to bool for clarity.

Note that timeval_ms() may return a negative error code, but not a
single caller checks for that.

Change-Id: I27cf83e75b3e9a8913f6c43e98a281bea77aac13
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3499
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agoarm_adi_v5: add dap apreg command for AP register read/write 77/2777/6
Tomas Vanek [Fri, 24 Apr 2015 05:33:50 +0000 (07:33 +0200)]
arm_adi_v5: add dap apreg command for AP register read/write

A developer tool: Direct access to AP registers can be useful
for handling vendor specific AP like Freescale Kinetis MDM or Atmel SMAP.

Change-Id: Ie2c7160fc6b2e398513eb23e1e52cbb52b88d9bd
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/2777
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
7 years agotcl: add mrb command to mem_helper.tcl 42/3542/3
Matthias Welwarsky [Mon, 11 Jul 2016 13:23:42 +0000 (15:23 +0200)]
tcl: add mrb command to mem_helper.tcl

add "mrb" command to read a byte of memory into a variable

Change-Id: I5ddc9fbcc55958a249548627bd15824df6dc0d61
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3542
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoserver: support binding to arbitrary interfaces 34/3534/10
Steven Stallion [Mon, 11 Jul 2016 19:18:54 +0000 (14:18 -0500)]
server: support binding to arbitrary interfaces

Some installations of OpenOCD are used in restricted environments that
do not permit binding to public interfaces.

This patch does not affect the default behavior to listen on all
interfaces, however it does give the option to restrict services by way
of the bindto command.

Change-Id: Id51bd64b376a8c62dd47b08b4d834872925e6af2
Signed-off-by: Steven Stallion <stallion@squareup.com>
Reviewed-on: http://openocd.zylin.com/3534
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agoswd: Add support for connect_assert_srst for SWD. 18/3018/5
Fredrik Hederstierna [Thu, 15 Oct 2015 04:49:58 +0000 (06:49 +0200)]
swd: Add support for connect_assert_srst for SWD.

Today the reset option for connect_assert_srst is not done for SWD.
This patch adds this to SWD and make it possible to connect to targets which might disable JTAG interface when running.

Change-Id: Ib89f7cf59b628e8f0b5fca9dd9e362e383c4b99f
Signed-off-by: Fredrik Hederstierna <fredrik@hederstierna.com>
Reviewed-on: http://openocd.zylin.com/3018
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
7 years agocfi: Add support for strangely endianness broken SoC implementations 09/3109/5
Esben Haabendal [Fri, 27 Nov 2015 08:13:36 +0000 (09:13 +0100)]
cfi: Add support for strangely endianness broken SoC implementations

This adds the 'data_swap' parameter to the CFI driver, which enables
swapping of data bytes when writing/programming words to the flash.
Note, that this specifically means that bytes are not swapped when
writing command words to the flash chip.  Unless you are using the SAP
in an LS102x chip to program an attached 16-bit NOR flash, you hopefully
do not need this!

Change-Id: I1e6f7169da36f373c880d1756d9c21c9957acc50
Signed-off-by: Esben Haabendal <esben@haabendal.dk>
Reviewed-on: http://openocd.zylin.com/3109
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
7 years agoSupport for Freescale LS102x SAP 96/3096/9
Esben Haabendal [Tue, 10 Nov 2015 10:44:29 +0000 (11:44 +0100)]
Support for Freescale LS102x SAP

The SAP in LS102x SoC's from Freescale is able to read and write to all
physical memory locations, independently of CPU cores and DAP.

This implementation is 100% based on reverse-engineering of JTAG
communication with an LS1021A SAP using a JTAG debugger with SAP support.

And as such, this code is for now "works-for-me", pending verification
by other OpenOCD users, or even better, actual information from Freescale
on the SAP interface.

Change-Id: Ibb30945e017894da5c402f9f633fc513bed4e68c
Signed-off-by: Esben Haabendal <esben@haabendal.dk>
Reviewed-on: http://openocd.zylin.com/3096
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
7 years agostm32f7x.cfg: Fix expected JTAG id. 12/3512/2
Uwe Bonnes [Tue, 31 May 2016 14:31:11 +0000 (16:31 +0200)]
stm32f7x.cfg: Fix expected JTAG id.

Change-Id: Icd21b9ac5f50094262f30db431d8a775a0d263ca
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3512
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoMake #include guard naming consistent 56/2956/5
Marc Schink [Mon, 21 Sep 2015 19:07:46 +0000 (21:07 +0200)]
Make #include guard naming consistent

Change-Id: Ie13e8af0bb74ed290f811dcad64ad06c9d8cb4fa
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/2956
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoRemove FSF address from GPL notices 88/3488/3
Marc Schink [Mon, 16 May 2016 20:41:00 +0000 (22:41 +0200)]
Remove FSF address from GPL notices

Also make GPL notices consistent according to:
https://www.gnu.org/licenses/gpl-howto.html

Change-Id: I84c9df40a774958a7ed91460c5d931cfab9f45ba
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/3488
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoarmv4_5: Integrate build of checksum code 73/3473/8
Andreas Färber [Sun, 8 May 2016 18:12:12 +0000 (20:12 +0200)]
armv4_5: Integrate build of checksum code

Add rules to build armv4_5_crc.inc, and convert the code to target
endianness the least intrusive way.

Change-Id: I7452b2c7e679dae14f9cda5f89bc81c16fc12cad
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3473
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
7 years agoarmv4_5: Integrate build of erase check code 35/3135/10
Andreas Färber [Sun, 29 Nov 2015 03:15:57 +0000 (04:15 +0100)]
armv4_5: Integrate build of erase check code

Add rules to build armv4_5_erase_check.inc, and convert the code to
target endianness the least intrusive way.

Drop an unused word from the assembler sources to make the ARM bytecode
fully match that of armv4_5.c and to not break ARMv4 assumptions.

This completes the build rules for contrib/loaders/erase_check directory.

Change-Id: I36be7a944e26142088195fa3fb072d4e577bf328
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3135
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoarmv7m: Integrate build of checksum code 74/3474/7
Andreas Färber [Sun, 8 May 2016 18:41:51 +0000 (20:41 +0200)]
armv7m: Integrate build of checksum code

Add rules to build armv7m_crc.inc and include it via preprocessor.

Change-Id: I4482c7acb8454de28bdf210d9f06c0720ada490a
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3474
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoarmv4_5: Improve arm_checksum_memory() error handling 72/3472/7
Andreas Färber [Sun, 8 May 2016 18:18:49 +0000 (20:18 +0200)]
armv4_5: Improve arm_checksum_memory() error handling

Clean up the working area in case writing fails.
Change the error handling paradigm to avoid duplication.

Change-Id: Ie3f95f992a98a1325428e4032a1c17346d4c9977
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3472
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoarmv4_5: Improve arm_blank_check_memory() error handling 71/3471/7
Andreas Färber [Sun, 8 May 2016 15:40:18 +0000 (17:40 +0200)]
armv4_5: Improve arm_blank_check_memory() error handling

Clean up the working area in case writing fails.
Change the error handling paradigm to avoid duplication.

Change-Id: I95bb12fbe7c80b594e178468bcd4f6387c682c93
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3471
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agotcl/target: Add PSoC 5LP config 10/3410/10
Andreas Färber [Sat, 16 Apr 2016 22:18:44 +0000 (00:18 +0200)]
tcl/target: Add PSoC 5LP config

Tested with CY8CKIT-059 and soldered-on J5 connector.

Change-Id: I687786179f2df354321a18d26330c60908461e0b
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3410
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoFix comment that limits num_bits to 32. 91/3491/2
Tim Newsome [Thu, 19 May 2016 02:39:52 +0000 (19:39 -0700)]
Fix comment that limits num_bits to 32.

Andreas Fritiofson says "If any adapter driver does not work with
arbitrary lengths of individual fields, it's a bug."
https://sourceforge.net/p/openocd/mailman/message/35091945/

Note also that lengths of at least 96 bits are already in use, eg. in
mips_ejtag_add_scan_96().

Change-Id: I62a150adc75c0ef78827683ca8d0a8e90310a982
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: http://openocd.zylin.com/3491
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoxmc4500: Disable SRST for SDRAM App Kit 16/3416/2
Andreas Färber [Tue, 16 Feb 2016 12:24:57 +0000 (13:24 +0100)]
xmc4500: Disable SRST for SDRAM App Kit

Just like observed with the General App Kit earlier, it now started to
fail halting:

  SWD IDCODE 0x2ba01477
  TARGET: xmc4500.cpu - Not halted
  in procedure 'reset'
  in procedure 'ocd_bouncer'

  SWD IDCODE 0x2ba01477
  Halt timed out, wake up GDB.

Rely on the target's default sysresetreq behavior to allow flashing to
work seemlessly again.

Change-Id: Ib9ce5f2c0ab99dca6d0fc74435fe26a58437fae5
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3416
Tested-by: jenkins
Reviewed-by: Jeff Ciesielski <jeffciesielski@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoconfigure.ac: support MSYS with newer config.guess 68/3468/2
Paul Fertser [Sat, 7 May 2016 16:35:22 +0000 (19:35 +0300)]
configure.ac: support MSYS with newer config.guess

Upstream commit
http://git.savannah.gnu.org/gitweb/?p=config.git;a=commitdiff;h=f4ebd3ed097771a729b68e688236aea665e7c1f3
makes both i386 and amd64 MSYS (and MSYS2) systems be detected as
*-pc-msys .

With this patch OpenOCD builds without any additional tweaks on MSYS2
with the latest config.guess.

Change-Id: I1ae4154f76125a84078926b425fa989904639ce0
Reported-by: "Stevens, Kelly E. M." <Kelly.Stevens@gtri.gatech.edu>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3468
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agolpcspifi: Fix SWD support for LPC43xx 89/3089/5
Andreas Färber [Sun, 12 Jul 2015 13:45:20 +0000 (15:45 +0200)]
lpcspifi: Fix SWD support for LPC43xx

When using SWD rather than JTAG transport, the lpcspifi driver complains:

  Error: Device ID 0x0 is not known as SPIFI capable
  Error: auto_probe failed

This is because target's JTAG tap->idcode is zero for SWD.

Drop this check completely and hardcode the addresses for now. Neither
the JTAG TAPID nor the SWD IDCODE are unique enough to detect the exact
chip model and thereby its memory map.

Change-Id: Ic230e3e989a3e1f1a5b3bae68bdb34e5ef55d392
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3089
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agotcl/target: Add config for TI MSP432P4xx 85/3485/2
Andreas Färber [Mon, 16 May 2016 01:05:44 +0000 (03:05 +0200)]
tcl/target: Add config for TI MSP432P4xx

Tested with TI MSP-EXP432P401R LaunchPad, via both on-board XDS110-ET (swd)
and external J-Link (jtag).

Change-Id: Ic0caa8516a155754b1c88a04acc8d3c511d9a5f7
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3485
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoboard/efm32: Disable SRST 20/3420/3
Marc Schink [Sun, 17 Apr 2016 12:53:25 +0000 (14:53 +0200)]
board/efm32: Disable SRST

The current configuration leads to the following error when trying to
program the target:

  SWD IDCODE 0x2ba01477
  timed out while waiting for target halted
  TARGET: efm32.cpu - Not halted
  in procedure 'program'
  in procedure 'reset' called at file "embedded:startup.tcl", line 478
  in procedure 'ocd_bouncer'

Use the default reset handling of the target (SYSRESETREQ) to reset the
system rather than SRST to fix the problem.

Tested on EFM32GG, EFM32TG and EZR32WG STK.

Change-Id: I788c41baf08b20814cbe0934b563424c4bc144b8
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/3420
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoFix spelling of ARM Cortex 83/3483/4
Andreas Färber [Sat, 14 May 2016 18:21:49 +0000 (20:21 +0200)]
Fix spelling of ARM Cortex

It's Cortex-Xn, not Cortex Xn or cortex xn or cortex-xn or CORTEX-Xn
or CortexXn. Further it's Cortex-M0+, not M0plus.

Cf. http://www.arm.com/products/processors/index.php

Consistently write it the official way, so that it stops propagating.
Originally spotted in the documentation, it mainly affects code comments
but also Atmel SAM3/SAM4/SAMV, NiietCM4 and SiM3x flash driver output.

Found via:

  git grep -i "Cortex "
  git grep -i "Cortex-" | grep -v "Cortex-" | grep -v ".cpu"
  git grep -i "CortexM"

Change-Id: Ic7b6ca85253e027f6f0f751c628d1a2a391fe914
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3483
Tested-by: jenkins
Reviewed-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agonand: change use_raw to boolean 96/3496/3
Ivo Manca [Fri, 20 May 2016 09:31:39 +0000 (11:31 +0200)]
nand: change use_raw to boolean

Change type of use_raw to boolean. This parameter was already
assigned a boolean variable (in COMMAND_PARSE_ENABLE) and used
as a boolean.

Change-Id: I22f8308246cb25ec9ec2395599e406160410a2a8
Signed-off-by: Ivo Manca <pinkel@gmail.com>
Reviewed-on: http://openocd.zylin.com/3496
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agonand: fix return value 95/3495/2
Ivo Manca [Fri, 20 May 2016 08:31:03 +0000 (10:31 +0200)]
nand: fix return value

Return ERROR_NAND_DEVICE_NOT_PROBED to prevent calling functions
from segfaulting when nand device has not yet been probed (ie nand
verify)

Change-Id: Ibc4da0aad00e6cc6c83008882b054d981453dc36
Signed-off-by: Ivo Manca <pinkel@gmail.com>
Reviewed-on: http://openocd.zylin.com/3495
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agotcl: add STM32F429I-DISC1 board config 92/3492/3
Samuel Martin [Wed, 18 May 2016 23:15:52 +0000 (01:15 +0200)]
tcl: add STM32F429I-DISC1 board config

Both the STM32F429I-DISC{O,1} boards are equipped with the same MCU, but
differ by the debugging chip:
- the STM32F429I-DISCO uses the ST-LINK/V2 chip;
- the STM32F429I-DISC1 uses the ST-LINK/V2-B chip (which matches the USB
  VID/PID set in stlink-v2-1.cfg).

Change-Id: I07d637f72d26cf5d714472638da974eb6ca02325
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-on: http://openocd.zylin.com/3492
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agocortex_a: Rename APB-AP to CPU in memory contexts 16/3216/4
Andreas Fritiofson [Wed, 13 Jan 2016 19:33:36 +0000 (20:33 +0100)]
cortex_a: Rename APB-AP to CPU in memory contexts

Memory accesses are not made through the APB-AP, they are made through
the CPU (which happens to be controlled over the APB-AP). Rename all
irrelevant uses of the APB-AP term. And fix the long standing typo in
the function names...

Change-Id: Ide466fb2728930968bdba698f0dd9012cc9dbdf9
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3216
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agostm32l1/Cat.3: Devices have only one bank. 90/3490/2
Uwe Bonnes [Wed, 18 May 2016 14:31:17 +0000 (16:31 +0200)]
stm32l1/Cat.3: Devices have only one bank.

Change-Id: I02ce243c228ea20be6d5f01fee705a671747ebad
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3490
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agostm32l4x.cfg: Fix RCC_CR address. 89/3489/2
Uwe Bonnes [Wed, 18 May 2016 08:59:29 +0000 (10:59 +0200)]
stm32l4x.cfg: Fix RCC_CR address.

Change-Id: I7a63d24a495e28bc01b5e6603f15b88e075878b8
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3489
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agokinetis: Fix typo in variable names 87/3487/2
Andreas Färber [Mon, 16 May 2016 03:54:41 +0000 (05:54 +0200)]
kinetis: Fix typo in variable names

It's security, not securtiy.

Change-Id: Idb10d7e0a1ca47d2d93b496d12cd4ec7ad116f22
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3487
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agoarm_adi_v5: Add part number for TI MSP432P401R 86/3486/2
Andreas Färber [Mon, 16 May 2016 02:52:37 +0000 (04:52 +0200)]
arm_adi_v5: Add part number for TI MSP432P401R

According to the MSP432P4xx Family TRM (SLAU356A) Figure 4-7,
0x9AF is the part number for MSP432P401xx devices.

Verified on TI MSP-EXP432P401R LaunchPad.

Change-Id: I22b57c42f2a0dc8263fab6b480cf8c169c7dc295
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3486
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoarm_adi_v5: Add part numbers for Infineon XMC4000 family 82/3482/3
Andreas Färber [Sat, 14 May 2016 13:02:44 +0000 (15:02 +0200)]
arm_adi_v5: Add part numbers for Infineon XMC4000 family

This was found on multiple XMC4500:

Valid ROM table present
Component base address 0xe00ff000
Peripheral ID 0x00001c11db
Designer is 0x0c1, Infineon (Siemens)
Part is 0x1db, Unrecognized
Component class is 0x1, ROM table
MEMTYPE system memory present on bus

On multiple XMC4700 and an XMC4800 this was found instead:

Valid ROM table present
Component base address 0xe00ff000
Peripheral ID 0x00001c11df
Designer is 0x0c1, Infineon (Siemens)
Part is 0x1df, Unrecognized
Component class is 0x1, ROM table
MEMTYPE system memory present on bus

Name them "XMC4500 ROM" and "XMC4700/4800 ROM" respectively.

Change-Id: If369a6d16524004ba439b878f090a313a9f3a760
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3482
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoarm_adi_v5: Add part number for Infineon XMC1000 family 81/3481/4
Andreas Färber [Sat, 14 May 2016 12:55:38 +0000 (14:55 +0200)]
arm_adi_v5: Add part number for Infineon XMC1000 family

Not documented in the Reference Manuals but found on multiple XMC1100/1202:

Valid ROM table present
Component base address 0xf0000000
Peripheral ID 0x00001c11ed
Designer is 0x0c1, Infineon (Siemens)
Part is 0x1ed, Unrecognized
Component class is 0x1, ROM table
MEMTYPE system memory present on bus

Name it "XMC1000 ROM", since it didn't differ between XMC1100 and XMC1200.

Change-Id: I98a5a524c0d0836f395400fbac24fd496b2ec141
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3481
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agojtag ulink: dont compile function when not required 41/3241/3
Alexander Kurz [Sun, 14 Feb 2016 09:04:51 +0000 (10:04 +0100)]
jtag ulink: dont compile function when not required

ulink_calculate_frequency() is used exclusively when
_DEBUG_JTAG_IO_ is set, no need to compile this
function if it is not used.
Declaring it static in the same commit.

Change-Id: I243ffdf69a1dc3bee6d16e4bb8d78396b6ea5144
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3241
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoudev: add rule for original Keil ULink (version 1) 71/3371/2
Alexander Kurz [Tue, 1 Mar 2016 08:32:49 +0000 (09:32 +0100)]
udev: add rule for original Keil ULink (version 1)

The original ULINK adapter has been introduced by Keil in 2002 and got
replaced in 2008 by the incompatible ULINK2. It is not listed on their
website any more. For information about it, browse archive.org
for http://www.keil.com/ulink1/ or http://www.keil.com/ulink/

Change-Id: Ie52d381580acab53ddb40499594dbdc2d27ef1b6
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3371
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agoarm_adi_v5: Adjust part number column alignment 80/3480/3
Andreas Färber [Sat, 14 May 2016 12:32:55 +0000 (14:32 +0200)]
arm_adi_v5: Adjust part number column alignment

Consistently increase the space-indentation of the .full values to
nicely align with the new "Qualcomm QDSS Component v1" .type value.

Change-Id: Icd28d8f3fc7c3afcccb9dcfe138ac57d64927d1a
Suggested-by: Freddie Chopin <freddie.chopin@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3480
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
7 years agoarm_adi_v5: Update DP (Debug Port) registers defined in ADIv5.2. 44/3244/3
Andreas Fritiofson [Mon, 22 Feb 2016 22:15:52 +0000 (23:15 +0100)]
arm_adi_v5: Update DP (Debug Port) registers defined in ADIv5.2.

Note:
WCR (Wire Control Register) is replaced by DLCR (Data Link Control
Register). And only TURNROUND field is modifiable.

[andreas.fritiofson@gmail.com]:

Rename DP_IDCODE to DP_DPIDR as well.

Sort list by address and align it using spaces instead of tabs. Add
comments about supporting DP versions.

Remove non-functional wcr command completely.

Change-Id: Ic6b781b07c8eead8b0237d497846d0da060cb1ba
Signed-off-by: Alamy Liu <alamy.liu@gmail.com>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3244
Tested-by: jenkins
7 years agodoc: Fix mismerges of fm4, kinetis and kinetis_ke flash drivers 84/3484/4
Andreas Färber [Sat, 14 May 2016 18:57:55 +0000 (20:57 +0200)]
doc: Fix mismerges of fm4, kinetis and kinetis_ke flash drivers

Commit dfc6658cf98d494e066426945879b9f60bbf9678 ("Kinetis: flash
driver described in openocd.texi") inserted a kinetis section between
fm3 and lpc2000. Then commit 43ff5acd45017fd9828cc56f54b929e600956c3b
("flash: New Spansion FM4 flash driver") was merged, inserting the fm4
section between kinetis and lpc2000, instead of after fm3. Finally
kinetis_ke was added between kinetis and fm4 in commit
5396ec5dcc64354c8101f8d3f16d498ca3b10326 ("flash: Added support for
Freescale Kinetis KE family.").

Restore the alphabetical order by moving the fm4 section to before
kinetis.

Change-Id: I77e47c3cd5b2cd8570b62ff2f7be8526aaf57ad0
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3484
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Marc Schink <openocd-dev@marcschink.de>
7 years agoarm_adi_v5: Reorder Atmel part number entry 79/3479/3
Andreas Färber [Sat, 14 May 2016 11:59:40 +0000 (13:59 +0200)]
arm_adi_v5: Reorder Atmel part number entry

Instead of placing Atmel last, after ANY_ID, place it after ARM (it's
arm_adi_v5 despite 0x4BB) and sort it with the other vendors, i.e.
before ADI and Qualcomm. Adapt column alignment.

Drop the redundant "Atmel" comment to clarify that Analog is not Atmel.

Change-Id: Ic06785db079cf58d49815a639236636c180e5e17
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3479
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoarm_adi_v5: added partnumber for APQ8016 08/3408/9
Jiri Kastner [Thu, 5 May 2016 09:35:10 +0000 (11:35 +0200)]
arm_adi_v5: added partnumber for APQ8016

On APQ8016 was found a CoreSight component designed by
Qualcomm, according to db410c HRM [1] it has a partnumber
following this schema:

[11:8] is 0x4 meaning Qualcomm designed Coresight component in QDSS. Reads as 0x4.
[7:6] is Subsystem/core family ID (e.g. denote QDSS family or generation).
[5:4] is Subsystem/core configuration options (e.g. denote cache options, etc.).
[3:2] is Subsystem/core fuse options.
[1:0] is Subsystem/core future use field
Reads as 0x440.

[1] - https://developer.qualcomm.com/download/sd410/hardware-register-description-qualcomm-snapdragon-410.pdf

Change-Id: I9b4b41fd17c59d2f5ae35b53278d06d6087665f8
Signed-off-by: Jiri Kastner <cz172638@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3408
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoarm_adi_v5: added partnumbers 07/3407/12
Jiri Kastner [Sat, 16 Apr 2016 21:07:15 +0000 (23:07 +0200)]
arm_adi_v5: added partnumbers

On hi6220 'dap info' returned some unknown components from ARM.
Collected from ARM docs, mostly ROM table entries.
Typo fix for Cortex-M3 FPB.

Change-Id: I96bbf7349061937b3afc8bb8d6d1650f2609f82d
Signed-off-by: Jiri Kastner <cz172638@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3407
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agoflash/nor: Add Ambiq Micro Apollo flash driver. 30/3230/12
Rick Foos [Mon, 8 Feb 2016 21:19:30 +0000 (15:19 -0600)]
flash/nor: Add Ambiq Micro Apollo flash driver.

Initial release of Ambiq Micro Apollo flash driver
supporting our sub-threshold (low power) Cortex M4F part,
and Evaluation Kit.

We have been shipping openocd to our customers for about one year.

The EVK boards are SWD only using ftdi. We also use two of the
other COM instances to display debug information.

It takes about 15 seconds to flash 512K, and mass erase is
about 5 seconds.

Tested by internal verification group, FAE's, and customer sites.

Merged commit 'refs/changes/17/3417/1' as suggested. Makefile.am
and drivers.c follow the new format to avoid conflicts.

Removed unused fault_capture command.

Added documentation for flash driver.

Change-Id: Iae92d869369c6827244f0071f9cb522d8d91fed8
Signed-off-by: Rick Foos <rfoos@solengtech.com>
Reviewed-on: http://openocd.zylin.com/3230
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoarm_adi_v5: Add a few dap component ids, covers the atmel at91sam. 83/3383/4
James Mastros [Thu, 14 Apr 2016 12:10:48 +0000 (14:10 +0200)]
arm_adi_v5: Add a few dap component ids, covers the atmel at91sam.

Change-Id: I62473fdf3dbc30cb0e1443c3d3f37918f1d61b89
Signed-off-by: James Mastros <james@mastros.biz>
Signed-off-by: Jiri Kastner <cz172638@gmail.com>
Reviewed-on: http://openocd.zylin.com/3383
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoxmc4xxx: Improve xmc4xxx_blank_check_memory() error handling 70/3470/3
Andreas Färber [Sun, 8 May 2016 14:48:50 +0000 (16:48 +0200)]
xmc4xxx: Improve xmc4xxx_blank_check_memory() error handling

Clean up working area in case writing fails. Probably inherited from
armv7m_blank_check_memory(). Fix adapted from armv7m_checksum_memory().

Change-Id: I784bef481d1eba833ab6a9c34249fe9d43a16081
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3470
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agoarmv7m: Improve armv7m_blank_check_memory() error handling 69/3469/3
Andreas Färber [Sun, 8 May 2016 14:46:03 +0000 (16:46 +0200)]
armv7m: Improve armv7m_blank_check_memory() error handling

Clean up the working area in case writing fails.
Adapted from armv7m_checksum_memory().

Change-Id: I4e5950f568ed70a72a1dcfd77e3321110b17e1de
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3469
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agoarm7: add missing braces around an if() 77/3477/2
Aleksander Morgado [Wed, 11 May 2016 07:58:47 +0000 (09:58 +0200)]
arm7: add missing braces around an if()

Spotted by gcc:

    arm7_9_common.c: In function ‘arm7_9_unset_breakpoint’:
    arm7_9_common.c:353:4: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
        if (current_instr == arm7_9->thumb_bkpt)
        ^~
    arm7_9_common.c:356:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
         if (retval != ERROR_OK)
         ^~

The logic won't change once the braces have been added, as the new 'retval'
check only makes sense within the if().

Change-Id: I6a303e118f2150e5eb25c9268ad06de5d8a533b2
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Reviewed-on: http://openocd.zylin.com/3477
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agolibjaylink: Update to latest master branch 78/3478/2
Marc Schink [Sat, 14 May 2016 08:16:36 +0000 (10:16 +0200)]
libjaylink: Update to latest master branch

Among other things, this fixes building on Cygwin and MSYS.

Change-Id: I8bdceb49dc72b5f666388cfd97876eba8e1d2b13
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/3478
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
7 years agoHelper ioutil: cleanup: removing dead code 40/3240/3
Alexander Kurz [Sat, 13 Feb 2016 12:48:02 +0000 (13:48 +0100)]
Helper ioutil: cleanup: removing dead code

The ioutil helper functions copyfile and copydir were last and only used
in ecosboard.c which has been removed with commit 39650e22.
Removing the dead code.

Change-Id: I36c7c4c5009d755b4513a14a9f9e214d1ee500e8
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3240
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoflash/nor/spi: use only lower case hex numbers 50/3350/3
Robert Jordens [Mon, 22 Feb 2016 17:01:34 +0000 (18:01 +0100)]
flash/nor/spi: use only lower case hex numbers

Change-Id: I21ad0d3a73a60d22cb98a0350098baf8af96bebf
Signed-off-by: Robert Jordens <jordens@gmail.com>
Reviewed-on: http://openocd.zylin.com/3350
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoflash/nor/spi: fix macronix 25l1005 chip erase 49/3349/2
Robert Jordens [Mon, 22 Feb 2016 17:00:38 +0000 (18:00 +0100)]
flash/nor/spi: fix macronix 25l1005 chip erase

Change-Id: Ibc445bbe9360d0f1f41e71af8b990b96e0ae5d1f
Signed-off-by: Robert Jordens <jordens@gmail.com>
Reviewed-on: http://openocd.zylin.com/3349
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agocortex_a: fix cortex_a_assert_reset() if srst_gates_jtag 56/3356/3
Matthias Welwarsky [Tue, 9 Feb 2016 13:49:20 +0000 (14:49 +0100)]
cortex_a: fix cortex_a_assert_reset() if srst_gates_jtag

The cortex_a specific assert_reset function must only apply nSRST if
the reset configuration states that JTAG can be used while nSRST is
asserted.

Change-Id: If604a65fdea5bcb46ec723ada547a4e8d6fa8c59
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3356
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agostlink: Decode more errors. 73/3373/3
Uwe Bonnes [Wed, 2 Mar 2016 11:54:07 +0000 (12:54 +0100)]
stlink: Decode more errors.

For STLINK_SWD_AP_FAULT git://git.ac6.fr/openocd commit 657e3e885b9ee10
returns ERROR_OK with the comment:
Change in error status when reading outside RAM.
This fix allows CDT plugin to visualize memory.

Change-Id: Id8e220961b748ef9467fd84de62b1dc84ace63f8
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3373
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoCortex-M7: Give user a hint about single stepping problem up to r0p1. 67/3467/3
Uwe Bonnes [Thu, 5 May 2016 20:13:19 +0000 (22:13 +0200)]
Cortex-M7: Give user a hint about single stepping problem up to r0p1.

http://www.keil.com/support/docs/3778.htm

Change-Id: I452f76726f3bb269fa14cc785f329bfba5189489
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3467
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
7 years agoSupport for debug interface lock of EFM32 controllers 89/3389/8
Lieven Hollevoet [Fri, 25 Mar 2016 14:05:35 +0000 (15:05 +0100)]
Support for debug interface lock of EFM32 controllers

The capability to lock the debug interface on EFM32
controllers was lacking in OpenOCD.
After receiving some pointers by zapb_ and PaulFertser
on IRC (thanks guys!) I have added this capability.

This works by writing the required bits in the debug
lock word to '0'.

Note: there is currently no way to re-enable the debug
interface from OpenOCD as doing this requires specific
pin wiggling that is currently not implemented yet.

However: having the capability to lock the debug interface
is useful when building a volume programming jig.
You can flash the program code, verify and then
lock the debug interface so that the device cannot
be read when it is deployed in the field.

Change-Id: If2d562dfdb4b95519785a4395f755d9ae3d0cf12
Signed-off-by: Lieven Hollevoet <hollie@lika.be>
Reviewed-on: http://openocd.zylin.com/3389
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoAdd Altera USB Blaster udev rule. 23/3423/2
Christopher Head [Thu, 21 Apr 2016 00:31:12 +0000 (17:31 -0700)]
Add Altera USB Blaster udev rule.

This udev rule makes the Altera USB Blaster clone I have on my desk
accessible to the plugdev group.

Change-Id: Ic5e8052c66a270b6a6f89e29de49d9785f18fc1e
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/3423
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
7 years agoxmc4xxx: Fix error propagation for erase_check callback 25/3425/2
Andreas Färber [Sun, 24 Apr 2016 03:05:33 +0000 (05:05 +0200)]
xmc4xxx: Fix error propagation for erase_check callback

If an error occurs during xmc4xxx_blank_check_memory() aka .erase_check,
it would break out of the loop over flash sectors and return ERROR_OK.

Instead return the error code so that tcl.c can notify the user.

Change-Id: Ie2c1b7933eef2b240b28f8a292634fbbf5b31706
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3425
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agofm4: Set read callback 31/3431/2
Andreas Färber [Fri, 29 Apr 2016 20:46:06 +0000 (22:46 +0200)]
fm4: Set read callback

Fix a segfault for flash read_bank by adopting the default read
implementation.

Change-Id: I09e030d9a7669b848a1743aaba03875bf408c7ee
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3431
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoftdi: make ftdi_location command depend on libusb1 version 96/3396/5
Matthias Welwarsky [Wed, 6 Apr 2016 08:35:13 +0000 (10:35 +0200)]
ftdi: make ftdi_location command depend on libusb1 version

The function libusb_get_port_numbers(), required for the command
ftdi_location, is only available in recent version of libusb1.
Compilation will break if the function is not available. This patch
enables the command only if libusb1 contains the necessary function.

Change-Id: I091e72dafa4ed22eea51692751d43246a8152987
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3396
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agocheckpatch.pl: fix unescaped left brace warnings 28/3228/2
Paul Fertser [Sat, 6 Feb 2016 13:30:10 +0000 (16:30 +0300)]
checkpatch.pl: fix unescaped left brace warnings

Basically, same as upstream 4e5d56bdf892e18832a6540b63ebf709966bce2a.

Unescaped left brace in string literals is deprecated since
perl v5.21.1.

Change-Id: I0e5f23bef821d2dca6ff4909ddbb06f4992718d4
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3228
Tested-by: jenkins
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
7 years agoat91samd: Add additional "B Variant" parts from SAMD21 family 24/3424/3
Peter D. Gray [Thu, 21 Apr 2016 13:10:44 +0000 (09:10 -0400)]
at91samd: Add additional "B Variant" parts from SAMD21 family

The parts are listed in Rev I of the Datasheet

Change-Id: Icdd9108a0f1f19f666fce79de7f25df9f46de866
Signed-off-by: Peter D. Gray <peter@conalgo.com>
Reviewed-on: http://openocd.zylin.com/3424
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
7 years agoMIPS32 Fix typos 71/2271/3
Salvador Arroyo [Sun, 24 Aug 2014 18:56:05 +0000 (20:56 +0200)]
MIPS32 Fix typos

I suppose 0xff300008 is the correct value for EJTAG_V20_DBS.
20 miliseconds is too much for scan delay, 2ms is enough in mips_m4k scan_delay handler.
mips32 scan_delay has the correct value.

Change-Id: Ie9dc650065a58e845687058a4c930f85909beec9
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/2271
Tested-by: jenkins
Reviewed-by: Kent Brinkley <jkbrinkley.imgtec@gmail.com>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
7 years agoFix for BMIPS 70/2270/3
Salvador Arroyo [Sun, 24 Aug 2014 17:34:08 +0000 (19:34 +0200)]
Fix for BMIPS

BMIPS always needs 2 additional instructions to reach the core.
Seems there is a 2 instructions fifo between the tap and the core, or it behaves in this way.
No idea of the purpose of this fifo, I can only guess.
Of course function mips32_pracc_clean_text_jump() must add this additional instructions (NOPs).
Only tested on bcm3348..

Change-Id: I3183d3ce865d469d7262ba4b15446e5743a5f1df
Signed-off-by: Salvador Arroyo <salvador@telecable.es>
Reviewed-on: http://openocd.zylin.com/2270
Tested-by: jenkins
Reviewed-by: Kent Brinkley <jkbrinkley.imgtec@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
7 years agoflash/nor: Add Infineon XMC1000 flash driver 18/3418/8
Andreas Färber [Sun, 17 Apr 2016 17:26:30 +0000 (19:26 +0200)]
flash/nor: Add Infineon XMC1000 flash driver

The XMC1000 family uses a very different flash interface from XMC4000.

Tested on XMC 2Go and XMC1100 Boot Kit.

Change-Id: I3edaed420ef1c0fb89fdf221022c8b04163d41b3
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3418
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
7 years agoat91samd: Atmel SAML22 (segment LCD) family added 26/3426/2
Tomas Vanek [Mon, 25 Apr 2016 15:30:28 +0000 (17:30 +0200)]
at91samd: Atmel SAML22 (segment LCD) family added

Part IDs taken from
Atmel-42402C-SAM L22_Datasheet_Complete-01/2016
(revision C)

Change-Id: I1eb76a92097a8327da10faa0551e7fc962a549f8
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3426
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agotarget: improve robustness of reset command 06/2606/6
Tomas Vanek [Sun, 15 Mar 2015 18:09:15 +0000 (19:09 +0100)]
target: improve robustness of reset command

Before this change jim_target_reset() checked examined state of a target
and failed without calling .assert_reset in particular target layer
(and without comprehensible warning to user).
Cortex-M target (which refuses access to DP under active SRST):
If connection is lost then reset process fails before asserting SRST
and connection with MCU is not restored.
This resulted in:
1) A lot of Cortex-M MCUs required use of reset button or cycling power
after firmware blocked SWD access somehow (sleep, misconfigured clock etc).
If firmware blocks SWD access early during initialization, a MCU could
become completely inaccessible by SWD.
2) If OpenOCD is (re)started and a MCU is in a broken state unresponsive
to SWD, reset command does not work even if it could help to restore communication.
Hopefully this scenario is not possible under full JTAG.

jim_target_reset() in target.c now does not check examined state
and delegates this task to a particular target. All targets have been checked
and xx_assert_reset() (or xx_deassert_reset()) procedures were changed
to check examined state if needed. Targets except arm11, cortex_a and cortex_m
just fail if target is not examined although it may be possible to use
at least hw reset. Left as TODO for developers familiar with these targets.

cortex_m_assert_reset(): memory access errors are stored
instead of immediate returning them to a higher level.
Errors from less important reads/writes are ignored.
Requested reset always leads to a configured action.

arm11_assert_reset() just asserts hw reset in case of not examined target.
cortex_a_assert_reset() works as usual in case of not examined target.

Change-Id: I84fa869f4f58e2fa83b6ea75de84440d9dc3d929
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/2606
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
7 years agoflash Kinetis: new KVx family added 35/3235/2
Tomas Vanek [Sat, 19 Dec 2015 11:34:31 +0000 (12:34 +0100)]
flash Kinetis: new KVx family added

Cortex-M0+ and M4 motor control MCUs KV10, KV11, KV30, KV31,
KV42, KV44 and KV46 added to SDID identification.
Watchdog disable code changed to work on Cortex-M0+ (KV1x)
Protection size set to 1K for 16K flash devices (KV10Z16)
- cherry picked from Andrey Smirnov's change #2051

Change-Id: Ia6f4868eaf7e2cb6ad6a736210c703a67e0027be
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3235
Tested-by: jenkins
Reviewed-by: Kyle Manna <kyle.manna@fuel7.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoAdd support for Atmel AT91SAMD21E16B (B variant) and a spelling mistake. 22/3422/2
Peter D. Gray [Wed, 20 Apr 2016 17:02:48 +0000 (13:02 -0400)]
Add support for Atmel AT91SAMD21E16B (B variant) and a spelling mistake.

Change-Id: I55ab830aed34a02c53f3419facc81c7354368e30
Signed-off-by: Peter D. Gray <peter@conalgo.com>
Reviewed-on: http://openocd.zylin.com/3422
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Andreas Färber <afaerber@suse.de>
7 years agoflash/nor: Reorder drivers alphabetically 17/3417/3
Andreas Färber [Sun, 17 Apr 2016 15:36:25 +0000 (17:36 +0200)]
flash/nor: Reorder drivers alphabetically

To avoid conflicts between flash drivers being added, consistently use
an alphabetical sort order for the three places new drivers get added:

* Makefile.am NOR_DRIVERS (note: automake disallows a trailing backslash)
* drivers.c struct flash_driver forward declarations
* drivers.c flash_drivers array

Change-Id: Idcd6a8e12821ef10958a6b3ad7bac0dc63cadd08
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3417
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agostm32lx: Add support for lock/unlock (RDP Level 0<->1) 34/3234/2
Andreas Fritiofson [Tue, 9 Feb 2016 16:50:47 +0000 (17:50 +0100)]
stm32lx: Add support for lock/unlock (RDP Level 0<->1)

Change-Id: Iecc356373e084056d048d92820062483cac3c8ec
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3234
Tested-by: jenkins
Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agostm32f2x.c: Add more F4 devices. 75/3375/2
Uwe Bonnes [Wed, 2 Mar 2016 12:11:48 +0000 (13:11 +0100)]
stm32f2x.c: Add more F4 devices.

Taken from git://git.ac6.fr/openocd commit e8ed67c42227b7072
STM32F446 (0x434) now is's own case.

Change-Id: I5061db7102b4c923c9f39d3d2f0cc69d29fca0a4
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3375
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agosrc/flash/nor/stm32f2x.c: Really erase second bank if requested. 74/3374/3
Uwe Bonnes [Wed, 2 Mar 2016 12:17:04 +0000 (13:17 +0100)]
src/flash/nor/stm32f2x.c: Really erase second bank if requested.

Taken from git://git.ac6.fr/openocd commit e8ed67c42227b7072

Change-Id: Ic7f529aecd1603b8c083c3c9ce96a0f13dd604e0
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3374
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)