Commit Graph

791 Commits

Author SHA1 Message Date
Antonio Borneo 9d3f337570 doc: document adapter drivers linuxgpiod and sysfsgpio
Change-Id: If894092a7ae04bb95fa1913d2e3c8465c2d0f75c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5961
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-12-09 14:31:00 +00:00
Marc Schink 7b641d3d4e Add initial RTT support
Real Time Transfer (RTT) is an interface specified by SEGGER based on
basic memory reads and writes to transfer data bidirectionally between
target and host.
Every target that supports so called "background memory access", which
means that the target memory can be accessed by the debugger while the
target is running, can be used.

RTT is especially of interest for targets which do not support Serial
Wire Output (SWO) (e.g. ARM Cortex-M0) or where using semihosting is
not possible (e.g. real-time applications) [1].

The data transfer is organized in channels where each channel consists
of an up- and/or down-channel. See [2] for more details.

Channels are exposed via TCP connections. One or more RTT server can be
assigned to each channel to make them accessible to an unlimited number
of TCP connections.

The current implementation does not respect buffer flags which are used
to determine what happens when writing to a full buffer.

Note that the implementation is designed in a way that the RTT
operations can be directly performed by an adapter (e.g. J-Link).

[1] https://devzone.nordicsemi.com/tutorials/6/
[2] https://www.segger.com/jlink-rtt.html

Change-Id: I8bc8a1b381fb74e08b8752d5cf53804cc573c1e0
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/4055
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-12-02 23:15:52 +00:00
Tarek BOCHKATI 3d736e0488 flash/stm32l4x: STM32L55/L56xx basic support (non-secure mode)
STM32L5 have 512 Kbytes of Flash memory with dual bank architecture.
STM32L5 flash is quite similar to L4 flash, mainly register names
and offsets and some bits are changed.
NON-SECURE flash is located at 0x8000000 like L4 devices, so no
big change is needed (secure flash will be subject of another change).

Note: flash driver name is set stm32l5x, in order to extend the commands
with specific L5 commands (to manage TZEN for example ...)

Note: this works only when TZEN=0

Change-Id: Ie758abb4aa19a3f29eeb0702d7dcb43992e4c639
Signed-off-by: Michael Jung <mijung@gmx.net>
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5510
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-11-15 21:55:20 +00:00
Tomas Vanek 0e0283e582 doc: document CMSIS-DAP v2
Change-Id: Ie54e855901c079b456c26a6239177c7678cdcac7
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5930
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-11-15 21:38:50 +00:00
Andreas Bolsch e44539d66c Flash, FRAM and EEPROM driver for STM32 QUAD-/OCTOSPI interface
- write speed up to 150 kByte/s on STM32F469I-disco (due to
  SWD clock and USB connection), up to 1 MByte/s on Nucleo-F767ZI
  with external STLink-V3 or Nucleo-G474RE with two W25Q256FV in
  dual 4-line mode or STM32H73BI-Disco in octal mode
- tested with STM32L476G-disco (64MBit flash, 3-byte addr),
  STM32F412G-Disco, STM32F469I-Disco, STM32F746G-Disco, and
  STM32L476G-Disco (all 128Mbit flash, 3-byte addr),
  STM32F723E-Disco, STM32F769I-Disco (512Mbit flash, 4-byte addr)
  STM32L4R9I-Disco, STM32L4P5G-Disco (512MBit octo-flash, DTR, 4-byte addr)
  STM32H745I-Disco, STM32H747I-Disco (two 512MBit flash, 4-byte addr)
  STM32H73BI-Disco, STM32H735G-Disco (512MBit octo-flash, DTR, 4-byte addr)
- suitable cfg for Discovery boards included
- limited parsing of SFDP data if flash device not hardcoded
  (tested only in single/quad mode as most devices either don't
  support SFDP at all or have empty(!) SFDP memory)
- 'set' command for auto detection override (e. g. for EEPROMs)
- 'cmd' command for arbitrary SPI commands (reconfiguration, testing etc.)
- makefile for creation of binary loader files
- tcl/board/stm32f469discovery.cfg superseded by stm32f469i-disco.cfg
- tcl/board/stm32f7discovery.cfg removed as name is ambiguous
  (superseded by stm32f746g-disco.cfg vs. stm32f769i-disco.cfg)
- dual 4-line mode tested on Nucleo-F767ZI, Nucleo-H743ZI and Nucleo-H7A3ZI-Q
  with two W25Q256FV, and on Nucleo-L496ZP-P and Nucleo-L4R5ZI
  with two W25Q128FV, sample cfg files included and on STM32H745I-Disco,
  STM32H747I-Disco, STM32H750B-Disco
- read/verify/erase_check uses indirect read mode to work around silicon bug in
  H7, L4+ and MP1 memory mapped mode (last bytes not readable, accessing last
  bytes causes debug interface to hang)
- octospi supported only in single/dual 1-line, 2-line, 4-line
  and single 8-line modes, (not in hyper flash mode)

Requirements:
GPIOs must be initialized appropriately, and SPI flash chip be configured
appropriately (1-line ..., QPI, 4-byte addresses ...). This is board/chip
specific, cf. included cfg files. The driver infers most parameters from
current setting in CR, CCR, ... registers.

Change-Id: I54858fbbe8758c3a5fe58812e93f5f39514704f8
Signed-off-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-on: http://openocd.zylin.com/4321
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Christopher Head <chead@zaber.com>
2020-11-08 22:46:00 +00:00
Antonio Borneo 3cf95a9d02 doc: remove reference to already dropped tftp support
The only code dealing with tftp in OpenOCD was in eCos build, code
already dropped in commit 39650e2273 ("ecosboard: delete
bit-rotted eCos code") almost 8 years ago.

Drop tftp related documentation too.

Change-Id: I0defc8f844e74c90894dca04a652dcc497a520e1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5913
Tested-by: jenkins
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
2020-11-07 20:53:13 +00:00
Marc Schink 8e281b76ea doc: Improve 'jlink usb' description
Change-Id: Ica44980ac0ba8a4f0ff03b42ce37d1de861d4fb5
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/5918
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-11-07 20:50:37 +00:00
Tarek BOCHKATI 9cce6b3c76 armv7m: add a TCP channel to stream captured trace
When trace capturing the trace is enabled using 'tpiu_config internal'
(via the internal mode), OpenOCD can collect the trace buffers then append
it to a specified file or named pipe and propagate the trace to 'tcl_trace'
command.
This change is allowing OpenOCD to stream the captured trace over TCP.

When using this configuration OpenOCD acts like a server and multiple
clients can connect and receive the captured trace.

Example on STM32F7 running at 216MHz:
  itm port 0 on
  tpiu config internal :3344 uart off 216000000


Change-Id: Idea43e7e26e87b98a33da7fb9acf7ea50fe3b345
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5345
Tested-by: jenkins
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-11-07 20:49:57 +00:00
Antonio Borneo e2e8a5f467 gdb_server: allow multiple GDB connections to selected targets
The default way of working is to have a single GDB attached to one
target, so OpenOCD accepts only one connection to the GDB port of
each targets and rejects any further connection.

There are some barely safe use cases in which it could get useful
having a second GDB connection to the same target.
One such use case is while using GDB as a 'non-intrusive memory
inspector', as explained in the OpenOCD documentation.
One GDB can be left running an infinite loop to dump some memory
area, or even analysing the content, while keeping a second GDB
ready for user interaction or spot memory check.

Add a target configure option to specify the maximum number of GDB
connections allowed for that target, keeping the default to 1.

Change-Id: I4985a602e61588df0b527d2f2aa5b955c93e125e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5865
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-11-04 17:37:59 +00:00
Antonio Borneo ec0c23a3ab target/arm_cti: use adiv5_jim_mem_ap_spot_configure()
To avoid code duplication, reorganize the code to replace
cti_configure() with adiv5_jim_mem_ap_spot_configure().

Reorganize 'struct arm_cti_object' and its sub-'struct arm_cti'
moving DAP and mem-AP info in a 'struct adiv5_mem_ap_spot'.
Replace cti_configure() with adiv5_jim_mem_ap_spot_configure().
Deprecate the use of '-ctibase' in favor of '-baseaddr'.

Change-Id: I43740a37c80de67c0f5e4dc79c3400b91a12e9e8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5869
Tested-by: jenkins
2020-11-04 17:37:25 +00:00
Tim Newsome b68674a1da Upstream tons of RISC-V changes.
These are all the changes from https://github.com/riscv/riscv-openocd
(approximately 91dc0c0c) made just to src/target/riscv/*. Some of the
new code is disabled because it requires some other target-independent
changes which I didn't want to include here.

Built like this, OpenOCD passes:
* All single-RV32 tests against spike.
* All single-RV64 tests against spike.
* Enough HiFive1 tests. (I suspect the failures are due to the test
suite rotting.)
* Many dual-RV32 (-rtos hwthread) against spike.
* Many dual-RV64 (-rtos hwthread) against spike.

I suspect this is an overall improvement compared to what's in mainline
right now, and it gets me a lot closer to getting all the riscv-openocd
work upstreamed.

Change-Id: Ide2f80c9397400780ff6780d78a206bc6a6e2f98
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: http://openocd.zylin.com/5821
Tested-by: jenkins
Reviewed-by: Jan Matyas <matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-10-14 05:43:05 +01:00
Andreas Fritiofson 87d2651edc Update user dir config file search path
Search in XDG_CONFIG_HOME as per XDG Base Directory Specification
in addition to $HOME/.openocd.

On Darwin, search in ~/Library/Preferences/org.openocd/ which
appears to be one of the conventional locations.

Make $OPENOCD_SCRIPTS highest priority on all platforms, previously
it was only higher on WIN32.

Update the documentation to reflect the search order.

Change-Id: Ibaf4b59b51fdf452712d91b47ea2b5312bb5ada9
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3890
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-03 11:23:12 +01:00
Kevin Burke cbbec2dce5 ARM|Driver: Add DPI Driver for emulation
This driver provides support for Cadence JTAG BFM

The "jtag_dpi" driver implements a JTAG driver acting as a client for the
SystemVerilog Direct Programming Interface (DPI) for JTAG devices.
DPI allows OpenOCD to connect to the JTAG interface of a hardware model
written in SystemVerilog, for example, on an emulation model of
target hardware.

Tested on Ampere emulation with Altra and Altra Max models

Change-Id: Iaef8ba5cc1398ee2c888f39a606e8cb592484625
Signed-off-by: Kevin Burke <kevinb@os.amperecomputing.com>
Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Reviewed-on: http://openocd.zylin.com/5573
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-03 11:21:51 +01:00
Mete Balci d7d70c2719 target/aarch64: a64 disassembler
Add A64 (AArch64) Disassembler using Capstone framework.

Change-Id: Ia92b57001843b11a818af940a468b131e42a03fd
Signed-off-by: Mete Balci <metebalci@gmail.com>
[Antonio Borneo: Rebased on current HEAD]
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5004
Tested-by: jenkins
2020-10-03 11:21:15 +01:00
Antonio Borneo 33b52174e6 nulink: add minimal support for Nu-Link2
Implementation largely taken from Nuvoton github
	https://github.com/OpenNuvoton/OpenOCD-Nuvoton

Reset is still not fully compatible with OpenOCD framework.
Adapted to hidapi.

Change-Id: Ieb1791b1b7f0b444c15c9668f8f2bcf34975d48f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Zale Yu <cyyu@nuvoton.com>
Reviewed-on: http://openocd.zylin.com/5720
Tested-by: jenkins
Reviewed-by: Saravanan Sekar <saravanan@linumiz.com>
Reviewed-by: Marc Schink <dev@zapb.de>
2020-08-02 10:48:20 +01:00
Zale Yu b12fca236d jtag/drivers: add support for Nu-Link (Nuvoton ICE) over usb
Add support for Nu-Link1 over usb hidapi and config file.

The original work is fetched from Nuvoton github.
Code cleanup, fix merge conflicts, compile and runtime issues.
Switch the code from libusb to hidapi, being the device HID based.
Add documentation.
Merge fixes for multi-word memory read.

Reset is not fully compatible with openocd framework; currently
the target is reset and then halt at openocd start.

Change-Id: I9738de4e26783ba462ea3e39ec32069fd5bb7d94
Signed-off-by: Zale Yu <cyyu@nuvoton.com>
Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5635
Tested-by: jenkins
Reviewed-by: Marc Schink <dev@zapb.de>
2020-08-02 10:47:02 +01:00
Daniel Krebs 6a78c8581d rtos: add support for RIOT
Add threads support for RIOT (https://github.com/RIOT-OS/RIOT).
Original code is from Daniel Krebs.

Change-Id: I83fe3b91dd75949e800b5aea1015d8fa37b09c61
Signed-off-by: Daniel Krebs <github@daniel-krebs.net>
Signed-off-by: Vincent Dupont <vincent@otakeys.com>
Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
Reviewed-on: http://openocd.zylin.com/4256
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-07-26 20:11:52 +01:00
Christopher Head bc987c8e31 doc/target/mips: fix grammar
Change-Id: Ib9012a1cfccbe4f69682d106688536c4d92392dd
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5777
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2020-07-26 20:08:48 +01:00
Antonio Borneo 3a5f84f818 doc: remove duplicated words
Remove occurrences of duplicated words in the documentation.

Change-Id: Ib6ef1607fc5e6387764be108b2b9c0c93ac10a62
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5754
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-07-14 00:39:18 +01:00
Antonio Borneo e8cfdd4a72 gdb_server: suggest user to prefer GDB extended mode
In case of GDB connection not using extended mode, issue a warning
message to suggest the user to switch using the extended mode.
Issue the message only once at each run of OpenOCD, to avoid too
much noise.
Update the documentation to suggest using extended mode.

Change-Id: I9326e84f748d5d7912d5a48f00f0fb541ca19221
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5311
Tested-by: jenkins
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-07-08 22:08:40 +01:00
Moritz Fischer 64733434e2 jtag: drivers: xlnx-pcie-xvc: Add support for SWD mode.
Add support for SWD debug to the Xilinx XVC/PCIe driver.

This is possible since the device is essentially a shift-register.
So doing SWD vs JTAG is a matter of wiring things correctly on the
RTL side (use TMS for SWDI, TDO for SWDO).

The clang static checker doesn't find any new problems with this change.

Change-Id: I3959e21440cd1036769e8e56a55e601d3e4aee9a
Signed-off-by: Moritz Fischer <moritzf@google.com>
Reviewed-on: http://openocd.zylin.com/5447
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-06-27 15:34:38 +01:00
Antonio Borneo ffe6bc8220 swim: add new transport
Add SWIM and STM8 to documentation and update TODO file.
Introduce transport "swim" and command "swim newtap".
Switch in swim.c from HLA API to the new SWIM API.
Implement in stlink driver the SWIM APIs as wrappers of existing
HLA functions.
Remove any SWIM related reference from HLA files.
Update stm8 config files and stlink-dap interface config file.

Change-Id: I2bb9f58d52900f6eb4df05f979f7ef11fd439c24
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5530
Tested-by: jenkins
2020-05-24 21:32:05 +01:00
Antonio Borneo 3a28cdc7cb doc: fix typo and spelling
Identified by checkpatch script from Linux kernel v5.7-rc1 using
the command
	find doc/ -type f -exec ./tools/scripts/checkpatch.pl \
	-q --types TYPO_SPELLING --strict -f {} \;

Change-Id: I1269ac966027439e16eb6e63179e43925bec37fa
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5614
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
2020-05-09 14:37:25 +01:00
Antonio Borneo 307ee6db47 doc: fix texinfo warning on @deffn not at the line beginning
Commit 87a4158acf ("drivers: xds110: Clean up command syntax and
documentation") does not follow the documentation structure that
lists the adapters in cpt 2 "Debug Adapter Hardware" then lists
the adapter commands in cpt 8.2 "Interface Drivers"; it puts all
in cpt 2.
While doing that, uses an incorrect texinfo syntax that causes the
following warnings at compile time:
	doc/openocd.texi:543: warning: @deffn should only appear at the beginning of a line
	doc/openocd.texi:547: warning: @deffn should only appear at the beginning of a line
	doc/openocd.texi:552: warning: @deffn should only appear at the beginning of a line

Move the documentation of xds110 commands in the proper chapter
and fix the texinfo syntax.

Change-Id: I0b3f0fe0c687f194bb02e2d81aca86fcd4fdd718
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 87a4158acf ("drivers: xds110: Clean up command syntax and documentation")
Reviewed-on: http://openocd.zylin.com/5613
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Edward Fewell <efewell@ti.com>
2020-05-09 14:37:17 +01:00
Tomas Vanek 6e86ad6166 flash/nor: add flash mdw/h/b commands
Some flash banks are not mapped in the target memory
(e.g. SPI flash, some special pages).

Add flash version of mdw/h/b which reads data using
the flash driver.

Change-Id: I66910e0a69cf523fe5ca1ed6ce7b9e8e176aef4a
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4776
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-21 16:47:43 +01:00
Evgeniy Didin a7d98680e2 Add documentation section for ARCv2
Changes since v1:
-Moved from http://openocd.zylin.com/#/c/5332/4
 into separate commit.

28.02.2020:
-Removed multiple cpu configuration section, currently
 only ARC EM is supported.

17.03.2020:
-Some cleanup
-For "arc set-reg-exists" command limitize the number of
 arguments (50 maximum).

17.03.2020(v2):
-Revert limitation for "arc set-reg-exist" command

Change-Id: I4b06f89df95f2773bfde6e1bd2ae2b6b880bfaa8
Signed-off-by: Evgeniy Didin <didin@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Reviewed-on: http://openocd.zylin.com/5351
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-04-20 18:19:14 +01:00
Jan Matyas 25efc15069 target: added events TARGET_EVENT_STEP_START and _END
Events TARGET_EVENT_STEP_START and TARGET_EVENT_STEP_END
have been added - analogous to already existing events
TARGET_EVENT_RESUME_*.

This is an example of a concrete use case where having
these events is important:

In RISC-V processors without Debug Program Buffer, OpenOCD
cannot execute fence/fence.i when resuming or single-
stepping. With these events implemented, the user can
instead provide custom operations to achieve that same
effect prior to resuming the processor.

Change-Id: I786348ff08940759d99b0f24e9e0ed5a44581094
Signed-off-by: Jan Matyas <matyas@codasip.com>
Reviewed-on: http://openocd.zylin.com/5551
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
2020-04-09 11:06:39 +01:00
Tarek BOCHKATI d6541a811d doc: add missing target types
missing target types are arm946e, avr32_ap7k, cortex_r4, dsp5680xx,
hla_target, mips_mips64, nds32_v2, nds32_v3, nds32_v3m, quark_d20xx,
quark_x10xx, riscv, stm8 and testee

Change-Id: I38f6ed78ee88c09add4b779cd409ebb1e219304f
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5487
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@casualhacker.net>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-03-27 07:14:38 +00:00
Tarek BOCHKATI 8f221f32bc doc: enhance target types description
target types are sorted alphabetically
minor changes for some precision:
 - cortex_a : it's an ARMv7-A core
 - cortex_m : besides the ARMv7-M it support the v6-M and v8-M cores

Change-Id: I37ade2392fe3948fba4156a2831bbd8739fa9993
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5486
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-03-27 07:12:53 +00:00
Tarek BOCHKATI af69f5ad0b doc: fix OpenRISC target documentation
OpenRISC correct target name is 'or1k' not 'openrisc'
http://openocd.zylin.com/3096 introduced a conflict between 'openrisc'
and 'ls1_sap' documentations

Change-Id: Iedebbf9809300e1272334c5b63d0b31a41062282
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5485
Tested-by: jenkins
Reviewed-by: Esben Haabendal <esbenhaabendal@gmail.com>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-03-27 07:11:45 +00:00
Marc Schink 5ceae0eef4 target: Add possibility to remove all breakpoints
Change-Id: I46acd57956846d66bef974e0538452462b197cd0
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/4916
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-26 19:30:45 +00:00
Antonio Borneo b7c13323e7 doc: fix texinfo files attributes on Windows
While installing git on Windows, the user is prompted by a dialog
"Configuring the line ending conversions" to select the value for
the git property "core.autocrlf". The default choice proposed by
the installer is "Checkout Windows-style, commit Unix-style line
endings", that corresponds to "core.autocrlf=true".
Even if the dialog provides technical explanation of the different
choices, most users will blindly accept the default proposal.

With "core.autocrlf=true" git will convert to DOS mode all the
text files during "clone" (so can be edited by any crap Windows
tool) and convert back to UNIX mode during "push" operation.
While this is safe enough for C and TCL files, it breaks the
texinfo files.
The trailing '@' character used for command continuation in
	https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Def-Cmd-Continuation-Lines.html
does not accept being followed by CR+LF (DOS mode), generating a
build error. Same error can be replicated on Linux by passing the
file doc/openocd.texi through "unix2dos" command.
Tentative to fix this has already been proposed in
	http://openocd.zylin.com/5294
	http://openocd.zylin.com/5413
by breaking the command continuation syntax, which is a no go.
The correct fix would require to force/suggest all the Windows
users to get rid of the crap DOS mode, but this could have side
effects.

To workaround the issue, add a .gitattributes file in the doc
folder, specifying a local conversion attribute for the files .txt
and .texi in the doc folder and overriding the eventual incorrect
global value of "core.autocrlf" selected during installation.
The local attribute "text eol=lf" is equivalent to the global one
"core.autocrlf=input".

Change-Id: I468a8f8125b6bc4628fce6c66eb082824ba3413f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5499
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-24 17:20:19 +00:00
Edward Fewell 87a4158acf drivers: xds110: Clean up command syntax and documentation
Arrange all commands under a top level xds110 command. Fix
documentation to properly reflect the current functionality.

Also updated the links in the document to the new permanent
links for the XDS110 only support.

Patch updated for comments from code review. Return
ERROR_COMMAND_SYNTAX_ERROR for wrong number of args in
commands. Added deprecated commands to src/jtag/startup.tcl.

Change-Id: Ica45f65e1fdf7fa72866f4e28c4f6bce428d8ac9
Signed-off-by: Edward Fewell <efewell@ti.com>
Reviewed-on: http://openocd.zylin.com/5495
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-03-24 17:17:45 +00:00
Tarek BOCHKATI c999fcef3e flash/stm32l4x: add support of STM32WLEx devices
STM32WLEx devices are based on arm Cortex-M4 running at 48MHz,
contains a single bank of maximum 256 Kbytes of flash memory.

there is 3 variants with different Flash/RAM sizes:
  STM32WLE5JC : 256K/64K
  STM32WLE5JB : 128K/48K
  STM32WLE5J8 :  64K/20K

the work-area size is set to 20 kb to fit in STM32WLE5J8

Change-Id: Ie8e186fe4be97cbc25c53ef0ade4b4dbbcee6f66
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5450
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-23 21:52:10 +00:00
Andreas Bolsch ba131f30a0 Flash driver for STM32G0xx and STM32G4xx
Flash module of STM32G0/G4 family is quite similar to the one of
STM32L4, so only minor changes are required, in particular
adaption of flash loader to Cortex-M0. Register addresses
passed to flash loader to simplify integration of L5.
Added re-probe after option byte load.
Added flash size override via cfg file.
WRPxxR mask now based on max. number of pages instead of fixed 0xFF,
as G4 devices fill up unused bits with '1'.
Sizes in stm32l4_probe changed to multiples of 1kB.

Tested with Nucleo-G071RB, G030J6, Nucleo-G431RB and Nucleo-G474RE.
Gap handling in G4 Cat. 3 dual bank mode tested with STM32G473RB.
This handling isn't optimal as the bank size includes the
size of the gap. WB not tested.

Change-Id: I24df7c065afeb71c11c7e96de4aa9fdb91845593
Signed-off-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-on: http://openocd.zylin.com/4807
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-16 15:25:10 +00:00
Tomas Vanek 9f4659ae6b target: add examine-fail event
A configuration script may want to check the reason why examine fails
e.g. device has security lock engaged.

tcl/target/kx.cfg and klx.cfg is modified to use the new event
for testing of the security lock of Kinetis MCU

Change-Id: Id1d3a79d24e84b513f4ea35586cd2ab0437ff9b3
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4289
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-03-12 09:43:55 +00:00
Edward Fewell 82a5c55dc3 flash/nor: update support for TI MSP432 devices
Added fixes for issues found in additional code reviews.

Fixed host Endianness issues with using buffer reads
and writes instead of the *_u32 variants.

Changed code that tried to ID banks by hardcode
bank_number values to use instead the bank base
address. This fixes problems using configurations
with multiple devices.

Note that this replaces Change 4786 which has
been abandoned because of extensive changes to
the code to stop IDing banks by name.  And I
think I really messed up a rebase/merge on the
document file.

Tested on MSP432P401R, MSP432P4111, and MSP432E401Y
Launchpads.

Change-Id: Id05798b3aa78ae5cbe725ee762a164d673ee5767
Signed-off-by: Edward Fewell <efewell@ti.com>
Reviewed-on: http://openocd.zylin.com/5481
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-07 15:32:24 +00:00
luca vinci e9932ef23d bluenrg-x: simplyfied the driver
Adopted only fast algorithm for flash programming:
- write_word and write_byte methods have been removed.
- start and end write alignments have been defined.
Moved flash controller registers offsets in a common file
shared with the flash algorithm.
- the flash base address is passed to the flash algorithm
  as a parameter.
Removed unused functions

Change-Id: I80aeab3994e477044bbcf02e66d9525dae0cb491
Signed-off-by: luca vinci <luca.vinci@st.com>
Reviewed-on: http://openocd.zylin.com/5393
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Michele Sardo <msmttchr@gmail.com>
2020-03-07 15:31:09 +00:00
luca vinci 6bc0a77a6e bluenrg-x: added support for BlueNRG-LP device
Extended bluenrg-x flash driver with BlueNRG-LP flash controller.
Changes include:
- register set for the flash controller
- made software structure prone to support more easily future devices
- updated target config file

Change-Id: I2e2dc70db32cf98c62e3a43f2e44a4600a25ac5b
Signed-off-by: luca vinci <luca.vinci@st.com>
Reviewed-on: http://openocd.zylin.com/5343
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-07 15:31:02 +00:00
Antonio Borneo 3bfe492663 coding style: doc: remove empty lines at end of text files
Empty lines at end of text files are useless.
Remove them.

Change-Id: I30e4d3d03c4ce846aa7bcefa7366f88732275557
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5170
Tested-by: jenkins
2020-02-24 10:31:29 +00:00
Antonio Borneo 86d8c05eb6 log: let command "log_output" to set back its default
The default log output is stderr. After the command "log_output"
has been used to set an output log file, it is possible to return
back to stderr only on *NIX hosts specifying a new log output file
as "/dev/stderr", but this is not intuitive, not documented and
not portable out of *NIX.

Make command "log_output" able to set back the default output to
stderr when the parameter is either "default" or is missing.
While there, add debug message to log the change and make the
command return error on incorrect syntax.

Change-Id: I8c7c929780f58e2c23936737c8e7274a96734786
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5233
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-24 10:30:10 +00:00
Tarek BOCHKATI 1ef468edc5 flash/nor/tcl.c: add filld command to write double-word with 64-bit value
Change-Id: I2eeda7af7d855ed1284083d025994f8fa9531969
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5443
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-23 21:33:58 +00:00
Tarek BOCHKATI 0a11537b32 flash/stm32lx: mention explicitly that this driver covers STM32 L0 and L1
this is to avoid confusion with STM32 L4, L4+ and L5 families

also:
 - a warning message is changed to error
 - stm32l0x and stm32l1x aliases has been created to permit
   the usage of either names

Change-Id: If3f16d2a3b7d1369959aa7407da37a9076ea91d7
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5437
Reviewed-by: Marc Schink <dev@zapb.de>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-13 20:21:24 +00:00
Antonio Borneo 0d598535a3 doc: replace example command "interface" with "adapter driver"
Keep documentation consisted after commands renaming.

Change-Id: I97b43887cae9d7c224b07e4ba0b7d04915a19fc4
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5285
Tested-by: jenkins
Reviewed-by: Marc Schink <dev@zapb.de>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-29 05:37:05 +00:00
Oleksij Rempel 5280eb618a jtag: adapter: rework adapter related commands
currently we have different types of same command group:
- starting with adapter_*
- starting with interface*
- without adapter or interface prefix.

Since interface name is already used, we can only use "adapter" command
group by keeping old commands as well.

Change-Id: Id0a1cb63a2ea6860c67ae1e7a3a06a37ddf464f4
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-on: http://openocd.zylin.com/4774
Reviewed-by: Marc Schink <dev@zapb.de>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-29 05:33:39 +00:00
Moritz Fischer ff6d0704ec jtag: drivers: xlnx-pcie-xvc: Add support for Xilinx XVC/PCIe
Add support for Xilinx Virtual Cable over PCIe JTAG controller.
It is commonly used in Xilinx based PCI Express designs with JTAG IP
in the FPGA fabric.

Access to the JTAG registers happens via the PCI Express extended
configuration space.

This can be used to debug soft-cores instantiated in the FPGA fabric.

The clang static checker doesn't find any new problems with this change.

Change-Id: Ib12ede0d1f26dacfda808d5e05b947b640c5bde7
Signed-off-by: Moritz Fischer <moritzf@google.com>
Reviewed-on: http://openocd.zylin.com/5314
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Marex
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-17 05:21:29 +00:00
Tarek BOCHKATI a6a642bf72 flash/nor: add support of STM32WB on top STM32L4 flash driver
Change-Id: I9fb6700085d817d35a691f6484193f67939a4e0f
Signed-off-by: Laurent LEMELE <laurent.lemele@st.com>
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/4933
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-01-16 09:38:52 +00:00
Antonio Borneo 944d3e6771 stlink: add DAP direct driver
STLINK-V3 and the new firmware V2J24 for ST-LINK/V2 provide API
to directly access the DAP registers.
This mode permits to use the native target in cortex_m.c, with no
need to override it with the target in hla_target.c.
Other advantages wrt HLA are: support for Cortex-A cores, support
for SoC multi-core and/or multi AP, support for OpenOCD commands
"dap" thus including control of CSW.
This obsoletes the existing HLA driver for ST-Link, that should
anyway be kept for those cases where it's not possible to update
the ST-Link firmware.

This commit introduces the minimal implementation for direct DAP
access. The implementation is much slower than the HLA because
every memory transfer requires several USB packets. Further
commits will close the performance gap.
The whole ST-Link driver is compiled under BUILD_HLADAPTER, to
remove the need to split the driver between the two modes. This
has to be reworked, but it's quite invasive!
A new interface file stlink-dap.cfg is added and should be used
in place of stlink.cfg to enable the DAP mode.
Documentation is updated and reports limitation on the maximum AP
number that can be accessed by ST-Link for some firmware already
tested.

Change-Id: I932ffe16bc81d00b1fe489e2944fda13470cce9b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4904
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-01-14 11:40:36 +00:00
Antonio Borneo c07b774e8f jtag: replace command "jtag_reset" with "adapter [de]assert"
Replace the JTAG transport specific command with a more generic
one. Deprecate "jtag_reset" and update the documentation.
While there, fix an error in the documentation, where the command
"jtag_reset" was used in place of command "reset_config".

Change-Id: I41a988d37ce69f7b35a960cbaf5306aab0299b99
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5286
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-01-02 21:24:38 +00:00
Tarek BOCHKATI 0750a7c085 target/arm_cti: add new 'ack' and 'channel' commands
these commands have been introduced to ease the manipulation of CTI trough
script files, these commands are:
 - $cti_name ack $event : to acknowledge a CTI event
 - $cti_name channel $channel_number $operation: to perform an operation
    on a specific channel, the possible operations are:
    gate, ungate, set, clear and pulse

Change-Id: I35463867a3c85072f3776c3aeb1e5788953ec435
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5315
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2020-01-02 21:19:27 +00:00