openocd.git
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>
7 years ago stm32l4x.c: Correct waiting for data. 40/3140/2
Uwe Bonnes [Mon, 30 Nov 2015 11:21:12 +0000 (12:21 +0100)]
 stm32l4x.c: Correct waiting for data.

Old code waited only for 7 bytes and didn't handle buffer wrap-around, but
was functional despite.

Change-Id: Iceaf7be1e51368b2ec0a8722cc9ac16d12f9aa63
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3140
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
7 years agostm32l4x.c: Use explicit 64-bit flash access as reference manual implies. 39/3139/3
Uwe Bonnes [Mon, 30 Nov 2015 11:12:42 +0000 (12:12 +0100)]
stm32l4x.c: Use explicit 64-bit flash access as reference manual implies.

Change-Id: I87b540c1ee7158a9d697e9fbc845a603c6bbe74d
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3139
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
7 years agoserver/telnet: Check malloc() return values 12/3412/2
Marc Schink [Wed, 13 Apr 2016 08:29:50 +0000 (10:29 +0200)]
server/telnet: Check malloc() return values

Change-Id: I598bd2dd5a65c0d1a8745bde41763057c4427a31
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/3412
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoRTOS support: Correction of out of bound access of thread array 00/3400/4
Jonathan Dumaresq [Fri, 8 Apr 2016 14:38:00 +0000 (10:38 -0400)]
RTOS support: Correction of out of bound access of thread array

FreeRTOS use an array to store ready task. The array size is
configMAX_PRIORITIES. In the current implementation, the code try to access 1 more priority if the helper from freeRTOS contrib is used.
This has effect of detecting bad thread. This patch correct this and have been tested on
a code with more than 12 task.

Change-Id: Id229f0b2c4bf1aab87a2a69be174cc9b6dda00cb
Signed-off-by: Jonathan Dumaresq <jdumaresq@cimeq.qc.ca>
Reviewed-on: http://openocd.zylin.com/3400
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agoRTOS support: Add FPU support for FreeRTOS 97/3397/5
Jonathan Dumaresq [Wed, 6 Apr 2016 20:00:06 +0000 (16:00 -0400)]
RTOS support: Add FPU support for FreeRTOS

Add new structure for for working with FPU thread in thread view.
This modification support both stacking.
When FPU is activated, LR must be validated to check if the FPU
register are push on the stack. This is mandatory to find the correct
stack pointer position.

the modified code was inspired and adapted from

https://github.com/TauLabs/TauLabs/commit/88d2003bb83a6b72c796274c889e307f96645966

Change-Id: I6641926aa14e7216cacb399cbc8bb0db324cc9fc
Signed-off-by: Jonathan Dumaresq <jdumaresq@cimeq.qc.ca>
Reviewed-on: http://openocd.zylin.com/3397
Tested-by: jenkins
Reviewed-by: Sergey A. Borshch <sb-sf@users.sourceforge.net>
Reviewed-by: Harry Zhurov <harry.zhurov@gmail.com>
Reviewed-by: Anton Gusev
Reviewed-by: Михаил Цивинский <mtsivinsky@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoflash: Added support for Freescale Kinetis KE family. 80/3380/4
Ivan Meleca [Sat, 5 Mar 2016 18:14:52 +0000 (19:14 +0100)]
flash: Added support for Freescale Kinetis KE family.

Tested with MKE04Z8VTG4, MKE02Z64VLC4 and MKE02Z64VLD2.

Change-Id: I606e32a2746a3b96d3e50f3656ba78d40c41c1ea
Signed-off-by: Ivan Meleca <ivan@artekit.eu>
Reviewed-on: http://openocd.zylin.com/3380
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agostm32l4x.c: Free r6/7 for 64-bit operations. 38/3138/3
Uwe Bonnes [Mon, 30 Nov 2015 11:05:43 +0000 (12:05 +0100)]
stm32l4x.c: Free r6/7 for 64-bit operations.

Use r5 instead of r7.

Change-Id: I350d00eeabe9446d64dba8f1dbffb5d4beab7dd6
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3138
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agointerface/jlink: Fix comment about serial number 01/3401/2
Marc Schink [Fri, 8 Apr 2016 08:57:11 +0000 (10:57 +0200)]
interface/jlink: Fix comment about serial number

Leading zeros for the serial number are not necessary anymore.

Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Change-Id: Ie4ff47b9cda7ccf314c6fda9a2784947db5ee4d9
Reviewed-on: http://openocd.zylin.com/3401
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoflash Kinetis: remove TARGET_HALTED halted check from probe 82/3382/2
Tomas Vanek [Thu, 10 Mar 2016 17:24:45 +0000 (18:24 +0100)]
flash Kinetis: remove TARGET_HALTED halted check from probe

There is no reason why not probe running target.
Initial gdb connect to running target is now possible without
halt in gdb-attach event.

Change-Id: Iacc4a231587d378168b18db871582f1086504831
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3382
Tested-by: jenkins
Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agocortex_a: allow physical memory access through AHB-AP again 59/3359/4
Matthias Welwarsky [Mon, 22 Feb 2016 14:23:10 +0000 (15:23 +0100)]
cortex_a: allow physical memory access through AHB-AP again

This feature is required for boards that use a programmatical way
to reset the cpu, like the TI Pandaboard with OMAP4. The board only
has a 14 pin JTAG header that doesn't feature SRST and is reset by
direct write to the PRM_RSTCTL register.

iMX6 can be reset through triggering the on-chip watchdog, but for these
methods to work reliably, access through the AHB-AP without interaction
with the CPU core is necessary.

Change-Id: I9a07a536adda83cc2f93e504384c8c7f0306220b
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3359
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agoftdi: allow selecting device by usb bus location 51/3351/2
Matthias Welwarsky [Tue, 2 Feb 2016 16:03:08 +0000 (17:03 +0100)]
ftdi: allow selecting device by usb bus location

This patch adds a 'ftdi_location' command to select an adapter by usb
bus number and port path.

This is helpful if you have a rack full of adapters in a testing or
manufacturing setup where the only constant is the physical usb bus
location of the adapter you want to address. Vid:Pid are not unique,
serial number _may_ be unique (and maybe not with embedded adapters) but
will change when a new target is plugged.

Specifying a location allows to understand instantly which board failed
bringup or testing.

Change-Id: I403c7c6c8e34fe42041b3f967db80f3160a4f1a3
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3351
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agohelper/fileio: Remove nested struct 22/3222/2
Marc Schink [Sun, 4 Oct 2015 15:18:40 +0000 (17:18 +0200)]
helper/fileio: Remove nested struct

Change-Id: I1a3afbddcf950689da58e0df8850a05f558d7879
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/3222
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agojim-nvp: Make Jim_GetOpt_String const-correct 78/3178/2
Andreas Fritiofson [Sun, 13 Dec 2015 21:18:14 +0000 (22:18 +0100)]
jim-nvp: Make Jim_GetOpt_String const-correct

Change-Id: Iae9824f6ff47a1944e674e59bfaa970904645082
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3178
Tested-by: jenkins
8 years agoCortex-A/R: Fix Mask-ISR parsing 95/3195/4
Evan Hunter [Mon, 11 Jan 2016 11:04:19 +0000 (11:04 +0000)]
Cortex-A/R: Fix Mask-ISR parsing

Remove needless error when not halted with wrong return.
Allow usage in any mode
Add error message for incorrect arguments

Change-Id: I3e94e159609351e503ed3f35760503079e3aa53c
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/3195
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoCortex-A/R: Add missing timeout for loop polling DSCR & fix timeout types 01/3201/3
Evan Hunter [Tue, 12 Jan 2016 18:13:27 +0000 (18:13 +0000)]
Cortex-A/R: Add missing timeout for loop polling DSCR & fix timeout types

Change-Id: I345658cfdc8a34a98418727423ac6bd562e980f3
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/3201
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agofm4: Add support for S6E2DH family 58/3158/3
Andreas Färber [Sun, 6 Dec 2015 18:43:52 +0000 (19:43 +0100)]
fm4: Add support for S6E2DH family

Add support for S6E2DH MainFlash. VFlash is not implemented.

Briefly tested with SK-FM4-176L-S6E2DH V110 board.

Change-Id: If7c523d8c75307bc1494bbf4cca3eed0272e8e01
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3158
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agofm4: Add support for MB9BFx64/x65 57/3157/4
Andreas Färber [Sun, 6 Dec 2015 16:51:49 +0000 (17:51 +0100)]
fm4: Add support for MB9BFx64/x65

These appear to be just additional flash size configurations.
Entirely based on manual, untested.

Change-Id: I4460dc1a588335df8fc0a385d24513a4e35b6951
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3157
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoarmv4_5: support weirdo ARMv6 secure monitor mode 96/3196/2
Linus Walleij [Tue, 12 Jan 2016 09:46:07 +0000 (10:46 +0100)]
armv4_5: support weirdo ARMv6 secure monitor mode

On the ARM PB1176JZF-S the system comes up in secure monitor
mode after reset. However the modebits in CPSR form the value
28 (0x1c) and CPSR is 0x800001dc deeming it UNRECOGNIZED.
Define this mode to be synonymous to mode 22 (MON) and things
start to work like a charm.

Change-Id: I001f7773ee1076202c0c633e466d2d833f7a1413
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-on: http://openocd.zylin.com/3196
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoflash: nor: mdr: implement read/verify for Info memory 27/3227/5
Paul Fertser [Sat, 6 Feb 2016 13:04:20 +0000 (16:04 +0300)]
flash: nor: mdr: implement read/verify for Info memory

This adds necessary code to obtain data from the Info region which is
not memory-mapped so can't be read the usual way.

With this "flash read_bank" and "flash verify_bank" commands should
start to work as expected for the Info memory block.

Change-Id: I57e4b80fff577500cfa85954b625fe9c9ff92aa5
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3227
Tested-by: jenkins
Reviewed-by: Eldar Khayrullin <eldar.khayrullin@mail.ru>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoarmv7m: Integrate build of erase check code 34/3134/3
Andreas Färber [Sun, 29 Nov 2015 02:35:51 +0000 (03:35 +0100)]
armv7m: Integrate build of erase check code

Instead of documenting the file path as a comment and inline-commenting
the THUMB bytecode, include the hex array via preprocessor.

This assures the path is actually up-to-date and facilitates updating
the code.

Change-Id: Ieb0a7cd0bc14882ac96750f524616d9768a0c6f5
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3134
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoxmc4xxx: Integrate build of erase check code 33/3133/3
Andreas Färber [Sun, 29 Nov 2015 02:09:46 +0000 (03:09 +0100)]
xmc4xxx: Integrate build of erase check code

Instead of pointing to the assembler sources in a comment and
inline-commenting the THUMB bytecode, place the hex array alongside the
assembler sources and include it via preprocessor.

Originally inspired by a typo in the file path during driver development,
but it also facilitates making changes to the assembler sources.

A Makefile is provided to help automate updating the bytecode. It is not
integrated with the automake system to avoid forcing an ARM cross-compiler
onto every user, i.e. after modifying the sources they need to be rebuilt
in that directory before building the usual way. ARM_CROSS_COMPILE= can
be passed on the make command line to deal with native ARM toolchains
or with varying prefixes of cross-toolchains.

Change-Id: I00ceb980a68c8554a180dd13719ac77b677a8bcd
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3133
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agoflash: New Spansion FM4 flash driver 90/2190/15
Andreas Färber [Mon, 20 Apr 2015 00:51:23 +0000 (02:51 +0200)]
flash: New Spansion FM4 flash driver

The Spansion FM4 family of microcontrollers does not offer a way to
identify the chip model nor the flash size, except for Dual Flash vs.
regular layout. Therefore the family is passed as argument and
wildcard-matched - MB9BFx6x and S6E2CC families are supported.

Iterations showed that ...
1) Just doing the flash command sequence from SRAM loader code for each
half-word took 20 minutes for an 8 KB block.
2) Doing the busy-wait in the loader merely reduced the time to 19 minutes.
3) Significant performance gains were achieved by looping in loader code
rather than in OpenOCD and by maximizing the batch size across sectors,
getting us down to ~2 seconds for 8 KB and ~2.5 minutes for 1.1 MB.
(Tested with SK-FM4-176L-S6E2CC-ETH v11, CMSIS-DAP v23.)

gcc, objcopy -Obinary and bin2char.sh are used for automating the
integration of hand-written assembler snippets.

Change-Id: I092c81074662534f50b71b91d54eb8e0098fec76
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/2190
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoat91sam4 Flash: Added identification of atsam4n's 42/3242/2
Colin Helliwell [Wed, 17 Feb 2016 09:51:25 +0000 (09:51 +0000)]
at91sam4 Flash: Added identification of atsam4n's

The Flash driver for at91sam4 cpu's has been enhanced to recognise and support the SAM4N family.

Change-Id: I50c471a6053b52edffd8efdd8abfe516cc5c55ee
Signed-off-by: Colin Helliwell <colin.helliwell@ln-systems.com>
Reviewed-on: http://openocd.zylin.com/3242
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agostm32lx.c: Print device string as info. 62/3362/3
Uwe Bonnes [Thu, 25 Feb 2016 13:33:43 +0000 (14:33 +0100)]
stm32lx.c: Print device string as info.

Change-Id: I893f0d9a5095a9f122adc76cf403277639fa880c
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3362
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agostm32lx.c: Add STM32L0 categories 1, 2 and 5. 60/3360/5
Uwe Bonnes [Thu, 25 Feb 2016 13:29:44 +0000 (14:29 +0100)]
stm32lx.c: Add STM32L0 categories 1, 2 and 5.

Change-Id: I493072a856a66e4cd60de490a0937287db4b5c4d
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3360
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agotcl/target/stm32f4: fix: reduce adapter speed before reset 65/3365/3
Alexander Kurz [Sun, 28 Feb 2016 11:36:19 +0000 (12:36 +0100)]
tcl/target/stm32f4: fix: reduce adapter speed before reset

The reset-init hook for this target speeds up the CPU clock and JTAG adapter
speed. When the target is reset running with high adapter speed, a series of
warnings "DAP transaction stalled (WAIT) - slowing down" will be generated
since the adapter speed is not reduced to fit the slower CPU speed.
Fix: reduction of the adapter speed before a reset is performed.

Change-Id: Iabfc8e3f70311e0e71c8eed09b8a37fcbed9c58d
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3365
Tested-by: jenkins
Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
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)