openocd.git
3 years agoGithub: add capstone in windows snapshots 15/5915/4
Tarek BOCHKATI [Mon, 2 Nov 2020 11:58:15 +0000 (12:58 +0100)]
Github: add capstone in windows snapshots

Change-Id: I402c18ff72de715ce4012bce3df72aaed7159d50
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5915
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agocontrib/cross-build.sh: build capstone from source 14/5914/3
Tarek BOCHKATI [Mon, 2 Nov 2020 15:12:11 +0000 (16:12 +0100)]
contrib/cross-build.sh: build capstone from source

tested with capstone 4.0.2, with the following options
CAPSTONE_CONFIG="CAPSTONE_ARCHS=arm,aarch64
                 CAPSTONE_BUILD_CORE_ONLY=yes
                 CAPSTONE_STATIC=yes
                 CAPSTONE_SHARED=no"

Change-Id: I40297772664e85c3d0f9358c85bfd901b5eba8b1
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5914
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agotcl/interface/ftdi: Add HIE JTAG Debugger config 10/5910/3
Jonathan McDowell [Sun, 1 Nov 2020 12:10:23 +0000 (12:10 +0000)]
tcl/interface/ftdi: Add HIE JTAG Debugger config

Change-Id: Ibb7a2bb8807c442394982e89258874557a2baaad
Signed-off-by: Jonathan McDowell <noodles@earth.li>
Reviewed-on: http://openocd.zylin.com/5910
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agodoc: Improve 'jlink usb' description 18/5918/2
Marc Schink [Tue, 3 Nov 2020 12:38:59 +0000 (13:38 +0100)]
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>
3 years agosemihosting: print the semihosting operation id 23/5923/3
Adrian Negreanu [Thu, 5 Nov 2020 09:56:16 +0000 (11:56 +0200)]
semihosting: print the semihosting operation id

Change-Id: If5c3568bd1c99a48ac492137f48da0d9764efe14
Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
Reviewed-on: http://openocd.zylin.com/5923
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
Reviewed-by: Tim Newsome <tim@sifive.com>
3 years agoarmv7m: add a TCP channel to stream captured trace 45/5345/9
Tarek BOCHKATI [Mon, 8 Jun 2020 22:47:46 +0000 (23:47 +0100)]
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>
3 years agoserver: permit the add_service function to return the created service 17/5717/4
Tarek BOCHKATI [Mon, 8 Jun 2020 23:15:49 +0000 (00:15 +0100)]
server: permit the add_service function to return the created service

returning the created service seems useful:

as the only method to get the freshly created service is by getting the
last item in the services linked list, and this seems to be like an
intrusion to service internal mechanism.

possibly, we could get the service from a connection but this is possible
only from [new_connection|input|connection_closed]_handler_t, but this is
not always practical:
  example: armv7m: add a TCP channel to stream captured trace
           http://openocd.zylin.com/#/c/5345/
           here we poll for trace and broadcast to all connections
           outside of these xxx_handler_t functions

also, storing one of the connections in new_connection_handler_t and get
the service from it is possible, but this will make the code less readable.

Change-Id: I5fef1baecec1e054953c6faf5b99d864ecc97f02
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5717
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
3 years agoopenocd: convert function setup_command_handler() to static 02/5902/2
Antonio Borneo [Thu, 29 Oct 2020 13:51:33 +0000 (14:51 +0100)]
openocd: convert function setup_command_handler() to static

The function setup_command_handler() was used in the eCos build of
OpenOCD, thus it was exported and a comment was added to remark it
should remain not-static. Unfortunately the comment was missing
the relevant information of the special build that requires so.
Also unusual is that there is no include file that declares the
prototype of the function.

The comment above the function was added in two steps, in commit
ea3e49f4e22d ("fix embedded builds") and commit fb96b8607a0c
("openocd: setup_command_handler() must not be static"), again
without info about the special build.
Also the mailing list archive does not report any further detail.
The only hint is in the first commit above that also adds a test
on BUILD_ECOSBOARD in a #if.

Commit 39650e2273bc ("ecosboard: delete bit-rotted eCos code")
removes all the eCos code, that effectively includes the both the
prototype and the call to the function setup_command_handler(),
http://openocd.zylin.com/#/c/503/2/src/ecosboard.c@a1092
but did not reverted the function to static.

With all the 'external' uses of this function being dropped, set
the function setup_command_handler() to static and remove the
obsoleted and misleading comment.

Change-Id: I4d6b83dec2a838119821189fc67949bfca070035
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5902
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 years agotarget/adi_v5_jtag: remove unused global variable 01/5901/2
Antonio Borneo [Thu, 29 Oct 2020 00:34:37 +0000 (01:34 +0100)]
target/adi_v5_jtag: remove unused global variable

Change-Id: Ia4e8b90359c23f4be1d3677b44b0ebd063bb8dcc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5901
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 years agocortex_m: declare local functions as static 00/5900/2
Antonio Borneo [Wed, 28 Oct 2020 22:48:57 +0000 (23:48 +0100)]
cortex_m: declare local functions as static

Functions that are not used outside the file should be declared as
static.

Change-Id: Ie81f6bdce91e2a1456364b47f30aa4d35c7ee7bc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5900
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Tested-by: jenkins
3 years agortos: make private the API rtos_try_next() 99/5899/2
Antonio Borneo [Wed, 28 Oct 2020 22:44:07 +0000 (23:44 +0100)]
rtos: make private the API rtos_try_next()

The function rtos_try_next() is only used internally.
Make it private.

Change-Id: I68c6b8d8e6bbf3d674b0e0199e63bc02d358c04e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5899
Tested-by: jenkins
3 years agotransport: remove unused function transports_are_declared() 98/5898/2
Antonio Borneo [Wed, 28 Oct 2020 22:20:42 +0000 (23:20 +0100)]
transport: remove unused function transports_are_declared()

The only use of this function has been removed with commit
159f11fefc19 ("jtag: set default "jtag_only" to uninitialized
transports").

Get rid of the unused function.

Change-Id: I79dd1d55bd54ed8edc39ed3443e6c3c01794f063
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5898
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 years agoserver: declare local functions as static 97/5897/3
Antonio Borneo [Wed, 28 Oct 2020 23:49:06 +0000 (00:49 +0100)]
server: declare local functions as static

Functions that are not used outside the file should be declared as
static.

Change-Id: I57b2fa6e49e87e14604bd34c4f1d2f037f401507
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5897
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 years agojtag: declare local symbols as static 96/5896/2
Antonio Borneo [Wed, 28 Oct 2020 23:47:12 +0000 (00:47 +0100)]
jtag: declare local symbols as static

Functions and variables that are not used outside the file should
be declared as static.

Change-Id: I58c9f5557d4809db9ccc34d32182c3797f825da1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5896
Tested-by: jenkins
3 years agotarget: declare local symbols as static 95/5895/2
Antonio Borneo [Wed, 28 Oct 2020 23:23:13 +0000 (00:23 +0100)]
target: declare local symbols as static

Functions and variables that are not used outside the file should
be declared as static.

Change-Id: I9f97571a528f0cb3c3c26f873577ab16fdec3cdc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5895
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 years agortos: declare local symbols as static 94/5894/2
Antonio Borneo [Wed, 28 Oct 2020 22:39:34 +0000 (23:39 +0100)]
rtos: declare local symbols as static

Functions and variables that are not used outside the file should
be declared as static.

Change-Id: I9731a35496cd1c7421563c8961da5fa0e3cc71c3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5894
Tested-by: jenkins
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
3 years agoflash: declare local symbols as static 93/5893/3
Antonio Borneo [Wed, 28 Oct 2020 22:27:02 +0000 (23:27 +0100)]
flash: declare local symbols as static

Functions and variables that are not used outside the file should
be declared as static.

Change-Id: I52d46ed6d4c9b98a7152eb23274c836416f409a3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5893
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 years agoopenocd: add support for libftdi 1.5 91/5891/3
Antonio Borneo [Tue, 27 Oct 2020 23:51:30 +0000 (00:51 +0100)]
openocd: add support for libftdi 1.5

The new libftdi 1.5 (2020-07-07) changes some API, deprecating the
old ones. This cause a warning at compile time.

Detect in configure the version of libftdi.
Use the new API in the driver's code.
Add an helper include file 'libftdi_helper.h' that wraps the old
API for backward compatibility with old libftdi.

Change-Id: I7800fbebe17dd0ce62e55b3598d8c08be8875bb7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: https://sourceforge.net/p/openocd/tickets/286/
Reviewed-on: http://openocd.zylin.com/5891
Tested-by: jenkins
3 years agoconfigure.ac: stop automake to search for scripts in parent dirs 90/5890/3
Antonio Borneo [Tue, 27 Oct 2020 21:56:49 +0000 (22:56 +0100)]
configure.ac: stop automake to search for scripts in parent dirs

Automake will search for the helper scripts in the folder that
contains the current Makefile.am (typically '.'), then some of the
scripts will be also searched in '..' and '../..'.

If the parent folders '..' or '../..' of OpenOCD source code
contain a file named 'install.sh', then automake will use it and
will assume that the same folder should contains also 'ltmain.sh'.
This situation can either cause the build to fail or automake to
use incorrect helper scripts.

Force automake to only search for helper scripts in the current
directory.

Change-Id: I00bbd6bf9057c94cf5007e5ecda3fefd683481f5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: https://sourceforge.net/p/openocd/tickets/285/
Reviewed-on: http://openocd.zylin.com/5890
Tested-by: jenkins
3 years agotarget: handle command 'target current' when no target is present 81/5881/2
Antonio Borneo [Fri, 23 Oct 2020 14:45:35 +0000 (16:45 +0200)]
target: handle command 'target current' when no target is present

Is it possible to run OpenOCD without any target, for example to
only dump the rom-tables of an arm dap, or to perform low level
jtag operations.
But without any target created, the command 'target current'
causes OpenOCD to abruptly exit.

Handle in command 'target current' the case of no targets.

Change-Id: Ide15cb13bec84b88ccc3e7126523c04a6d70e636
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5881
Tested-by: jenkins
3 years agogdb_server: allow multiple GDB connections to selected targets 65/5865/2
Antonio Borneo [Thu, 15 Oct 2020 12:45:27 +0000 (14:45 +0200)]
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>
3 years agotcl: replace '-ctibase' with '-baseaddr' 70/5870/4
Antonio Borneo [Sat, 17 Oct 2020 17:25:50 +0000 (19:25 +0200)]
tcl: replace '-ctibase' with '-baseaddr'

Replace the deprecated option '-ctibase' with the generic option
'-baseaddr'.

Change generated with command:
sed -i 's/-ctibase/-baseaddr/g' $(find tcl/ -type f)

Change-Id: If776934d2ac106532708768bb3a4ec6fcffb0368
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5870
Tested-by: jenkins
3 years agotarget/arm_cti: use adiv5_jim_mem_ap_spot_configure() 69/5869/4
Antonio Borneo [Sat, 17 Oct 2020 14:27:13 +0000 (16:27 +0200)]
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
3 years agotarget/arm_adi_v5: add helper to get mem_ap spot in configure/cget 57/5857/6
Antonio Borneo [Sun, 11 Oct 2020 22:11:07 +0000 (00:11 +0200)]
target/arm_adi_v5: add helper to get mem_ap spot in configure/cget

This is somehow an extension of existing adiv5_jim_configure(),
but includes the 'address' in the mem_ap.
Rewrite adiv5_jim_configure() using the new helper.

Change-Id: Ia7effeeece044004d459b45126ed4961a98b8568
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5857
Tested-by: jenkins
3 years agostm32h7x.cfg: alignment with RM0399 rev3 61/5861/4
Tarek BOCHKATI [Wed, 14 Oct 2020 13:14:09 +0000 (14:14 +0100)]
stm32h7x.cfg: alignment with RM0399 rev3

in RM0399 rev2, there was these bits in DBGMCU_CR registers:
 - DBGSTBY_D3 : bit 7
 - DBGSTOP_D3 : bit 8

these bits have been changed to reserved in rev3

Change-Id: I9d10d90e383795dc8e25a117d59fa065dc594610
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5861
Tested-by: jenkins
Reviewed-by: Christopher Head <chead@zaber.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agojtag/tcl: fix memory leak in error return 06/5906/2
Tomas Vanek [Thu, 29 Oct 2020 19:41:54 +0000 (20:41 +0100)]
jtag/tcl: fix memory leak in error return

Clang static analyzer reported:
Warning: line 196, column 3
Potential leak of memory pointed to by 'fields'

Free allocated memory pointed by 'fields' and fields[i].in_value

Change-Id: I0b3935d9a235544afc03e39a4648319047e65815
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5906
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
3 years agogdb_server: fix clang static analyzer warning 05/5905/2
Tomas Vanek [Thu, 29 Oct 2020 18:57:20 +0000 (19:57 +0100)]
gdb_server: fix clang static analyzer warning

Warning: line 373, column 15
Assigned value is garbage or undefined

Most probably a false warning, building the hex string byte
per byte seems too complicated for static analyze.

Change malloc to calloc to silence the warning.

Change-Id: I746d43fa51abf05582ccf2680ed72dc557798a7a
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5905
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
3 years agohelper/command: fix clang static analyzer warning 04/5904/2
Tomas Vanek [Thu, 29 Oct 2020 17:32:13 +0000 (18:32 +0100)]
helper/command: fix clang static analyzer warning

Warning: line 955, column 3
Argument to free() is the address of a global variable, which
is not memory allocated by malloc()

It is definitely a false alarm. Simplify concatenation of arguments
and allocate a string always to silence the warning.

Change-Id: I5ac4cc610fc35224df0b16ef4f7102700363249f
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5904
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
3 years agoflash/nor/atsamv: fix clang static analyzer warning 03/5903/2
Tomas Vanek [Thu, 29 Oct 2020 17:15:33 +0000 (18:15 +0100)]
flash/nor/atsamv: fix clang static analyzer warning

Warning: line 679, column 4
4th function call argument is an uninitialized value

Change-Id: If62d96e1595be945c8e17885bb402e820fb1ec7b
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5903
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
3 years agotcl/board: fix changed target config filenames 88/5888/2
Antonio Borneo [Mon, 26 Oct 2020 16:58:33 +0000 (17:58 +0100)]
tcl/board: fix changed target config filenames

In commit a1ce28b118e7 ("rename some target scripts to be
consistent with the rest") the following renames was applied, but
the old names are still referenced:
tcl/target/{sam7se512.cfg => at91sam7se512.cfg}
tcl/target/{sam7x256.cfg => at91sam7x256.cfg}

Fix the board files to use to correct target config filename.

Change-Id: I7698aa0da7db95c2bd9ba7ab8c260905a975c857
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5888
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
3 years agotcl/board: drop 'tcl' prefix in 'find' command 87/5887/2
Antonio Borneo [Mon, 26 Oct 2020 16:54:55 +0000 (17:54 +0100)]
tcl/board: drop 'tcl' prefix in 'find' command

When OpenOCD is installed to the host the 'tcl' folder gets
usually installed in /usr/share/openocd/, thus having 'tcl' as
prefix of the target's file causes 'find' to fail.

Remove the 'tcl' folder prefix.

Change-Id: I3dc484c8de6af8f5aae4dd1b230522ee47ae2ba6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5887
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
3 years agotcl/interface/ti-icdi: remove empty lines at end of file 03/5603/3
Antonio Borneo [Fri, 24 Apr 2020 20:52:57 +0000 (22:52 +0200)]
tcl/interface/ti-icdi: remove empty lines at end of file

Change-Id: I031dc52c20b8f213b12df13c9c974d9ac3ef2164
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5603
Tested-by: jenkins
3 years agojtag: xlnx-pcie-xvc: Declare function static 89/5889/2
Moritz Fischer [Tue, 27 Oct 2020 16:48:06 +0000 (16:48 +0000)]
jtag: xlnx-pcie-xvc: Declare function static

The xlnx_pcie_xvc_execute_stableclocks() function can and
should be static.

Change-Id: I45fb1363caee1f1762b0b1ac2c6bc1bb0153b15b
Signed-off-by: Moritz Fischer <moritzf@google.com>
Reviewed-on: http://openocd.zylin.com/5889
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoboard: drop open-bldc 84/5884/2
Karl Palsson [Mon, 26 Oct 2020 10:51:15 +0000 (10:51 +0000)]
board: drop open-bldc

This is a) broken and b) doesn't include anything other than the
(broken) target alias.  Don't see any reason for it to exist.

Change-Id: I833635eeac392bf7c0c39f51ff2f76525ba2d406
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
Reviewed-on: http://openocd.zylin.com/5884
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agojtag/drivers/stlink_usb: fix SWO prescaler 56/5656/3
Cliff L. Biffle [Tue, 12 May 2020 20:28:04 +0000 (13:28 -0700)]
jtag/drivers/stlink_usb: fix SWO prescaler

The config_trace function has an out-parameter for generating the
prescaler for the TPIU. The STLink implementation wasn't always writing
it, causing the tpiu command to load uninitialized stack memory (minus
one) into the TPIU's prescaler register when 'external' was requested.

This change ensures that the out-parameter (and the other one,
trace_freq, which hadn't caused any buggy behavior for me) are written
every time.

Signed-off-by: Cliff L. Biffle <cliff@oxide.computer>
Change-Id: I222975869b1aa49cc6b1963c79d5ea0f46522b8c
Reviewed-on: http://openocd.zylin.com/5656
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agotarget: restore last run state after profiling 37/5237/5
Christopher Head [Fri, 14 Jun 2019 22:35:31 +0000 (15:35 -0700)]
target: restore last run state after profiling

Now that it’s possible to start profiling from either a running or a
halted state, rather than unconditionally halting after profiling
finishes, it makes more sense to restore the processor to whatever state
(running or halted) it was in before profiling started.

Change-Id: If6f6e70a1a365c1ce3b348a306c435c220b8bf12
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5237
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agotarget/cortex_m: reduce duplication in profiling 36/5236/5
Christopher Head [Fri, 14 Jun 2019 22:25:26 +0000 (15:25 -0700)]
target/cortex_m: reduce duplication in profiling

The Cortex-M implementation of profiling contains a bunch of
conditionals and checks to handle both chips which have PCSR and chips
which do not. However, the net effect of the non-PCSR branches is
actually exactly the same as what target_profiling_default does. Rather
than duplicating this code, just detect the situation where PCSR isn’t
available and delegate to target_profiling_default.

Change-Id: I1be57ac77f983816ab6bf644a3cfca77b67d6f70
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5236
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agotarget: allow profiling from running 35/5235/5
Christopher Head [Fri, 14 Jun 2019 22:12:28 +0000 (15:12 -0700)]
target: allow profiling from running

There are a handful of implementations of profiling. There is the
default implementation, which repeatedly halts and resumes the target,
sampling PC each time. There is the Cortex-M implementation, which
uses PCSR if available, otherwise falling back to halting and resuming
and sampling PC. There is the OR1K implementation, which reads NPC
repeatedly. Finally, there is the NDS32 implementation which uses some
kind of AICE commands with which I am unfamiliar.

None of these (with the possible exception of the NDS32
implementation) actually require the target to be halted when starting
profiling. The Cortex-M and OR1K actually resume the target as pretty
much their first action. The default implementation doesn’t do this,
but is written in such a way that the target just flips back and forth
between halted and running, and the code will do the right thing from
either initial state. The NDS32 implementation I don’t know about.

As such, for everything except NDS32, it is not really necessary that
the target be halted to start profiling. For the non-PCSR Cortex-M and
default implementations, there is no real harm in such a requirement,
because profiling is intrusive anyway, but there is no benefit. For
the PCSR-based Cortex-M and the OR1K, requiring that the target is
halted is annoying because it makes profiling more intrusive.

Remove the must-be-halted check from the target_profiling function.
Add it to the NDS32 implementation because I am not sure if that will
break when invoked with a running target. Do not add it to any of the
other implementations because they don’t need it.

Change-Id: I479dce999a80eccccfd3be4fa192c904f0a45709
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5235
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoflash/nor/nrf5: unify size of HWID 89/5589/2
Tomas Vanek [Mon, 13 Apr 2020 18:19:41 +0000 (20:19 +0200)]
flash/nor/nrf5: unify size of HWID

HWID is a part of 32 bit CONFIGID register. hwid member of struct nrf5_info
was typed uint32_t to enable direct CONFIGID read and masked afterwards.

Change to uint16_t to unify with hwid in struct nrf5_device_spec
and RM description.

Change-Id: Ib720d3ce23c301aee41d074ea78a6f00a23aed68
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5589
Tested-by: jenkins
3 years agoflash/nor/nrf5: improve handling of nRF52 flash errors 87/5587/2
Tomas Vanek [Mon, 13 Apr 2020 12:49:46 +0000 (14:49 +0200)]
flash/nor/nrf5: improve handling of nRF52 flash errors

nRF52 devices indicate a flash error by emitting hard fault
exception (unlike nRF51 series).

Change error message when NVMC READY read fails. A hard fault
from flash erase/write operation is detected here.

Check exit point of the flash write algo to ensure a failed
write is recognised.

Change-Id: I637eda268a6bf45f7f41bcb9dcd82db8f5cb41b4
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5587
Tested-by: jenkins
3 years agoflash/nor/nrf5: check protection before flash erase/write on nRF51 22/5522/5
Tomas Vanek [Mon, 16 Mar 2020 14:49:54 +0000 (15:49 +0100)]
flash/nor/nrf5: check protection before flash erase/write on nRF51

nRF51 devices have a clumsy flash protection based on UICR CLENR0.
A code running in RAM can write to a protected flash region without
any hint the protection gets violated.
NVMC flash page erase obeys protection setting but fails absolutely
silently.

Before this change the first problem was not addressed in the code.
To justify the second one, protection was loaded during probe,
after protection setting and after a mass erase.

Move protection updates to the beginning of erase/write operation
and limit them to nRF51 series only. Check for protected sectors
before write.

The change also fixes the problem of 'nrf5 mass_erase' on
nRF52833/840 devices. They use ACL flash protection, which is not
supported in nrf5 driver. mass_erase then looked like it failed.

Change-Id: Ie58cda68eb104d410b02777c3df5b343408e2666
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5522
Tested-by: jenkins
3 years agoflash/nor/nrf5: fix protection setting on nRF51 86/5586/3
Tomas Vanek [Sun, 12 Apr 2020 08:15:00 +0000 (10:15 +0200)]
flash/nor/nrf5: fix protection setting on nRF51

Protection setting has not ever worked. UICR CLENR0 register cannot
be simply written but has to programmed because it resides in UICR
page of the flash.

Enable flash programming before writing CLENR0 and set back to r/o
afterwards.

Inform the user that reset might be required.

Change-Id: Ib0f96c74ba3583ac33f4394ddb57d8c8895adf53
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5586
Tested-by: jenkins
3 years agotcl/interface/ftdi: Add Steppenprobe open hardware interface 53/5653/3
Diego Herranz [Sun, 10 May 2020 17:57:46 +0000 (18:57 +0100)]
tcl/interface/ftdi: Add Steppenprobe open hardware interface

https://github.com/diegoherranz/steppenprobe

Change-Id: Ief2c3f4a8707fa628650697d93893b2355015898
Signed-off-by: Diego Herranz <diegoherranz@diegoherranz.com>
Reviewed-on: http://openocd.zylin.com/5653
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoserver/telnet: Handle Ctrl+K 68/5868/4
Brian Brooks [Sun, 18 Oct 2020 13:37:09 +0000 (08:37 -0500)]
server/telnet: Handle Ctrl+K

Handle Ctrl+K shortcut which clears the line from the cursor position
to the end of line.

Change-Id: I2ecff5284473cef7c11cf9cb7e1c0c97d55f6c1c
Signed-off-by: Brian Brooks <brooks.brian@gmail.com>
Reviewed-on: http://openocd.zylin.com/5868
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Marc Schink <dev@zapb.de>
3 years agotarget/arc: introduce watchpoints support 67/5867/3
Evgeniy Didin [Thu, 30 Jul 2020 21:02:38 +0000 (00:02 +0300)]
target/arc: introduce watchpoints support

With help of actionpoint mechanism now it is possible to introduce
watchpoints support for ARC.

Change-Id: I5887335d0ba38c15c377bc1d24a1ef36e138cf65
Signed-off-by: Evgeniy Didin <didin@synopsys.com>
Reviewed-on: http://openocd.zylin.com/5867
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoAdded comment to ti-icdi.cfg 28/2528/4
John Pham [Tue, 3 Feb 2015 02:22:38 +0000 (21:22 -0500)]
Added comment to ti-icdi.cfg

Added comment to ti-icdi.cfg specifying how to get serial and an example of
specifying hla_serial for ti-icdi devices. This has been implemented in revision
2121a8f92969804611412b705af8114697a647dc

Change-Id: I648458a4dea176beae6a3f1a4e5641d0206077eb
Signed-off-by: John Pham <jhnphm@gmail.com>
Reviewed-on: http://openocd.zylin.com/2528
Tested-by: jenkins
Reviewed-by: Matthew Trescott <matthewtrescott@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoEnable hla_serial for TI ICDI devices 27/2527/5
John Pham [Mon, 2 Feb 2015 10:23:32 +0000 (05:23 -0500)]
Enable  hla_serial for TI ICDI devices

Used jtag_libusb_open from libusb_helper.h instead of
libusb_open_device_with_vid_pid to get device handle,
as well as managing context, i.e. similar to stlink_usb.
Direct calls to libusb1 are left in for the moment.

(When this Gerrit revision was originally created,
the jtag_libusb_ wrappers did not return error conditions.)

Tested w/ a TM4C123GXL board

Change-Id: I71e9a366356c125444d4813e58ddd9b6c6498bf0
Signed-off-by: John Pham <jhnphm@gmail.com>
Signed-off-by: Matthew Trescott <matthewtrescott@gmail.com>
Reviewed-on: http://openocd.zylin.com/2527
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoflash/stm32l4: add support of STM32G4 category 4 devices (G491/G4A1) 93/5793/3
Tarek BOCHKATI [Thu, 15 Oct 2020 16:05:48 +0000 (17:05 +0100)]
flash/stm32l4: add support of STM32G4 category 4 devices (G491/G4A1)

STM32G4 cat.4 devices are up to 512 KB of flash memory (single bank)
organized into pages of 2KB each.

Reference: RM0440 rev.4

Change-Id: I0f510e2806c8f824fff8083e2d4f90d68f01046b
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5793
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 years agotcl/target/nrf52: fix nrf52_recover 45/5845/2
Tomas Vanek [Thu, 1 Oct 2020 10:36:00 +0000 (12:36 +0200)]
tcl/target/nrf52: fix nrf52_recover

nrf52_recover was merged in pre "Handle Tcl return values consistently"
state - remove ocd_ prefixes.

Erase and unlock sequence was changed to comply Nordic semiconductor
recommendation:
https://infocenter.nordicsemi.com/index.jsp?topic=%2Fnwp_027%2FWP%2Fnwp_027%2FnWP_027_erasing.html

Change-Id: Ic54236c27cf25ad8091e9e572ba1ef846f0d47c2
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reported-by: Pieter De Gendt <pieter.degendt@gmail.com>
Reviewed-on: http://openocd.zylin.com/5845
Tested-by: jenkins
Reviewed-by: Pieter De Gendt <pieter.degendt@gmail.com>
3 years agocortex_m: support control.FPCA 53/5853/3
Sylvain Chouleur [Mon, 12 Oct 2020 15:24:05 +0000 (17:24 +0200)]
cortex_m: support control.FPCA

Bit 2 of control register is used if the processor includes the FP
extension

Change-Id: Ie21bc9de8cae5bad9d841e1908eff3aa0bb29d4b
Signed-off-by: Sylvain Chouleur <schouleur@graimatterlabs.ai>
Reviewed-on: http://openocd.zylin.com/5853
Reviewed-by: Sylvain Chouleur <sylvain.chouleur@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 years agoriscv: fix compile error 56/5856/2
Antonio Borneo [Wed, 14 Oct 2020 08:41:12 +0000 (10:41 +0200)]
riscv: fix compile error

The commit b68674a1da72 ("Upstream tons of RISC-V changes.") was
proposed well before commit 3ac010bb9f10 ("Fix debug prints when
loading to flash"), but the merge got in different order.
After latest merge, the master branch fails to compile.

Fix the compile error.

Change-Id: Ia3bd21d970d589343a3b9b2d58c89e0c49f30015
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5856
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Jan Matyas <matyas@codasip.com>
3 years agoUpstream tons of RISC-V changes. 21/5821/11
Tim Newsome [Wed, 19 Aug 2020 20:24:56 +0000 (13:24 -0700)]
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>
3 years agoflash/nor/at91sam4: ATSAMG55x19 Rev.B 25/5825/3
Benedikt-Alexander Mokroß [Mon, 24 Aug 2020 08:59:27 +0000 (10:59 +0200)]
flash/nor/at91sam4: ATSAMG55x19 Rev.B

Add support for ATSAMG55x19 Rev.B.
Both chips have nearly the same cidr, however, Rev.B has an incremented version.

Change-Id: I5939c41fa5d54c4d3bfb850964974b878f709d13
Signed-off-by: Benedikt-Alexander Mokroß <mokross@gessler.de>
Reviewed-on: http://openocd.zylin.com/5825
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
3 years agotarget/aarch64: fix use of 'target->private_config' 47/5847/2
Antonio Borneo [Wed, 16 Sep 2020 13:26:40 +0000 (15:26 +0200)]
target/aarch64: fix use of 'target->private_config'

The function adiv5_jim_configure() casts the void pointer
'target->private_config' to a struct adiv5_private_config pointer.
This is tricky in case of aarch64, where the private data are in a
struct aarch64_private_config that has as first element the struct
adiv5_private_config.

While the current solution is working fine, it's not clean and
requires special attention for any further code development.

Override 'target->private_config' to the correct pointer while
calling adiv5_jim_configure().

Change-Id: Ic2fc047dd1e57013943d96e6d5879a919d1eb7b3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5847
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
3 years agotarget/aarch64: Use apnum setting 31/5831/4
Kevin Yang [Thu, 3 Sep 2020 03:15:31 +0000 (20:15 -0700)]
target/aarch64: Use apnum setting

Change aarch64 to use ap-num setting if provided. Fall back to original
behavior of using first AP when ap-num is invalid.

Change-Id: I0d3624f75c86ba5fd5a322ac60856dbbb6e71eaf
Signed-off-by: Kevin Yang <kangyang@google.com>
Reviewed-on: http://openocd.zylin.com/5831
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agodrivers/jlink: fix (again) calculate_swo_prescaler formula 46/5846/2
Antonio Borneo [Thu, 1 Oct 2020 12:19:16 +0000 (14:19 +0200)]
drivers/jlink: fix (again) calculate_swo_prescaler formula

The prescaler computation should round at the nearest integer
value, not to the next integer value.

Change-Id: I957e0774421211f3c4ba4b312738b1c67b87c4a2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 051e80812b1b ("drivers/jlink: fix calculate_swo_prescaler formula")
Reviewed-on: http://openocd.zylin.com/5846
Tested-by: jenkins
Reviewed-by: Adrian M Negreanu <adrian.negreanu@nxp.com>
3 years agoUpdate user dir config file search path 90/3890/6
Andreas Fritiofson [Sat, 24 Dec 2016 10:38:04 +0000 (11:38 +0100)]
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>
3 years agoFreeRTOS: strip duplicate line returns 43/5843/3
Karl Palsson [Thu, 24 Sep 2020 14:29:36 +0000 (14:29 +0000)]
FreeRTOS: strip duplicate line returns

Log lines already print a new line, so these superfluous \r\n result in
blank lines being printed in the log.  Remove per review comment
request.

Change-Id: I8f5b20776634cf70ce4490fc4f732c916130928a
Signed-off-by: Karl Palsson <karlp@etactica.com>
Reviewed-on: http://openocd.zylin.com/5843
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
3 years agoFreeRTOS: properly read on big endian systems. 42/5842/3
Karl Palsson [Thu, 24 Sep 2020 09:09:11 +0000 (09:09 +0000)]
FreeRTOS: properly read on big endian systems.

Remember, don't cast your pointers between types of different sizes!

While the FreeRTOS handlers attempt to account for different pointer and
list widths, the types used are always fixed, so this will _remain_
broken if/when someone targets FreeRTOS on 8/16/64 bit targets. (Note
that this patch does not _change_ that, it was fixed to 32bit before as
well)

In the meantime, this properly handles 32bit reads on a mips BE system
(ath79) as well as remaining fully functional on x86_64.

Change-Id: I677bb7130e25dccb7c1bee8fabaee27371494d00
Signed-off-by: Karl Palsson <karlp@etactica.com>
Reviewed-on: http://openocd.zylin.com/5842
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
3 years agoARM|Driver: Add DPI Driver for emulation 73/5573/7
Kevin Burke [Sat, 4 Apr 2020 00:47:50 +0000 (20:47 -0400)]
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>
3 years agotarget/cortex_m.c: vector_catch command checks if a target is examined 13/5813/2
Daniel Trnka [Mon, 17 Aug 2020 15:51:43 +0000 (17:51 +0200)]
target/cortex_m.c: vector_catch command checks if a target is examined

If a target is not examined, command vector_catch crashes while accessing
the debug_ap NULL pointer.

maskisr and reset_config commands don't require this check.

Change-Id: I949b6f6e8b983327dd98fbe403735141f8f0b5d6
Signed-off-by: Daniel Trnka <daniel.trnka@gmail.com>
Reviewed-on: http://openocd.zylin.com/5813
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agotarget/aarch64: a64 disassembler 04/5004/5
Mete Balci [Sat, 30 Mar 2019 11:27:57 +0000 (12:27 +0100)]
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
3 years agotcl: board/dp_busblaster_v4 Busblaster v4.1a by Seed Studio added 49/5549/5
Ulrich-Lorenz Schlüter [Tue, 31 Mar 2020 08:05:47 +0000 (10:05 +0200)]
tcl: board/dp_busblaster_v4 Busblaster v4.1a by Seed Studio added

Change-Id: I53141d7f6f022f9dee641858f5fb0e0b70c049f8
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Ulrich-Lorenz Schlüter <audiomobster@gmail.com>
Reviewed-on: http://openocd.zylin.com/5549
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agotcl/board: Add QuickLogic QuickFeather configuration 03/5803/4
Jan Kowalewski [Thu, 9 Jul 2020 10:34:22 +0000 (12:34 +0200)]
tcl/board: Add QuickLogic QuickFeather configuration

Add configuration for QuickLogic QuickFeather development kit.

Change-Id: I39120714bf0bcafa86e0071c38da84a7d9f12a0d
Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
Reviewed-on: http://openocd.zylin.com/5803
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
3 years agotcl/target: Add QuickLogic EOS S3 MCU configuration 02/5802/3
Jan Kowalewski [Fri, 3 Jul 2020 16:19:01 +0000 (18:19 +0200)]
tcl/target: Add QuickLogic EOS S3 MCU configuration

Add configuration for QuickLogic EOS S3 MCU target.

Change-Id: I375057ff387a826e632f194843dbd92148b0c5dd
Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
Reviewed-on: http://openocd.zylin.com/5802
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agodrivers/jlink: fix calculate_swo_prescaler formula 07/5807/4
Adrian Negreanu [Mon, 7 Sep 2020 19:36:10 +0000 (22:36 +0300)]
drivers/jlink: fix calculate_swo_prescaler formula

a) TPIU_ACPR is defined as:
SWO_baudrate = TRACECLKIN/(TPIU_ACPR +1)

b) TPIU_ACPR is set by armv7m_trace_tpiu_config()
target_write_u32(target, TPIU_ACPR, Prescaler-1), so
TPIU_ACPR = Prescaler-1

Replacing TPIU_ACPR in a), we get:
SWO_baudrate = TRACECLKIN/Prescaler, so

c) Prescaler = TRACECLKIN/SWO_baudrate

The Prescaler calculated by calculate_swo_prescaler() is greater by 1:
Prescaler = TRACECLKIN/SWO_baudrate + 1

The second problem is that even in situations when
an exact baudrate match is possible,
the resulting TRACECLKIN/Prescaler already has a 3% deviation.

For example, TRACECLKIN=88000000, SWO_baudrate=500000,
calculate_swo_prescaler will return Prescaler=171.
The correct value should be Prescaler=176 (TPIU_ACPR=175).

Might be related to https://sourceforge.net/p/openocd/tickets/263/

Change-Id: Ib4d6df6e34685a9be4c2995cb500b2411c76e39b
Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
Reviewed-on: http://openocd.zylin.com/5807
Tested-by: jenkins
Reviewed-by: Marc Schink <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoAdd support of STM32H72x/73x 1M (0x483) 92/5792/3
Tarek BOCHKATI [Tue, 11 Aug 2020 11:34:50 +0000 (12:34 +0100)]
Add support of STM32H72x/73x 1M (0x483)

STM32H72x/73x flash is similar to STM32H74x/75x,
except STM32H72x/73x devices have only one single flash bank.

Change-Id: I3d3422dc60234f8273172924f426200210f388cc
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5792
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoUse capstone for ARM disassembler 12/4812/7
Marc Schink [Wed, 12 Aug 2020 11:54:10 +0000 (13:54 +0200)]
Use capstone for ARM disassembler

Change-Id: I1c9bf3f8178d4a06babe23a918e4411833ebc418
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/4812
Tested-by: jenkins
Reviewed-by: Fredrik Hederstierna <fredrik@hederstierna.com>
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agocortex_m: add detection of Cortex M35P and M55 99/5799/2
Tarek BOCHKATI [Tue, 11 Aug 2020 14:23:19 +0000 (15:23 +0100)]
cortex_m: add detection of Cortex M35P and M55

Change-Id: I52599b2b09c2dc50c95d64059213c832d380ea31
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5799
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agocortex_m: read and display core security state 98/5798/2
Tarek BOCHKATI [Tue, 11 Aug 2020 13:06:04 +0000 (14:06 +0100)]
cortex_m: read and display core security state

Change-Id: I0fce3c66af7e98df2dc2258daf0d6af661e29ae7
Signed-off-by: Laurent LEMELE <laurent.lemele@st.com>
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5798
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoarmv8-m: add SecureFault exception 97/5797/2
Tarek BOCHKATI [Tue, 11 Aug 2020 11:56:36 +0000 (12:56 +0100)]
armv8-m: add SecureFault exception

Change-Id: I4e1963631e834b6334bc917e956c2db4464b7b08
Signed-off-by: Laurent LEMELE <laurent.lemele@st.com>
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5797
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoGitHub: add workflow to provide an openocd snapshot binaries for win32 94/5594/10
Tarek BOCHKATI [Tue, 2 Jun 2020 21:03:18 +0000 (22:03 +0100)]
GitHub: add workflow to provide an openocd snapshot binaries for win32

This change could be used within OpenOCD GitHub forks.

Once workflow actions are enabled in the GitHub project, this workflow
will be run automatically on each push into OpenOCD.

This workflow will provide a neutral build of openocd for win32, then
the package will be available for download in Actions section.
Note: the artifact will be deleted after 90 day (actual GitHub rules)

If the push is a tag, the generated package will be uploaded to release
pane under the corresponding release, and it will resides forever.

The built openocd enables libusb1, hidapi and libftdi adapters,
and could be extended to cover more adapters and Oses

PS: ./contrib/cross-build.sh updated to build libftdi from source like
libusb1 and hidapi.

Change-Id: I290c8aa14a12548e2dcb6a0eee456430ea44ab9f
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5594
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agotarget: avoid checking for non NULL pointer to free it 09/5809/3
Antonio Borneo [Mon, 17 Aug 2020 07:58:58 +0000 (09:58 +0200)]
target: avoid checking for non NULL pointer to free it

The function free() can be called with a NULL pointer as argument,
no need to check the argument before. If the pointer is NULL, no
operation is performed by free().

Remove the occurrences of pattern:
if (ptr)
free(ptr);

In target/openrisc/jsp_server.c, an error is logged if the ptr was
already NULL. This cannot happen since the pointer was already
referenced few lines before and openocd would have been already
SIGSEGV in that case, so remove the log.

Change-Id: I290a32e6d4deab167676af4ddc83523c830ae49e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5809
Tested-by: jenkins
3 years agodrivers/buspirate: remove empty lines at end of file 04/5604/2
Antonio Borneo [Fri, 24 Apr 2020 20:59:13 +0000 (22:59 +0200)]
drivers/buspirate: remove empty lines at end of file

Change split from http://openocd.zylin.com/5172/ to avoid
conflicts with other pending changes in gerrit.

Change-Id: Id3e21c92b3da7ddce7b00664280da2143c06f172
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5604
Tested-by: jenkins
3 years agojtag: avoid checking for non NULL pointer to free it 10/5810/3
Antonio Borneo [Mon, 17 Aug 2020 08:05:11 +0000 (10:05 +0200)]
jtag: avoid checking for non NULL pointer to free it

The function free() can be called with a NULL pointer as argument,
no need to check the argument before. If the pointer is NULL, no
operation is performed by free().

Remove the occurrences of pattern:
if (ptr)
free(ptr);

Change-Id: I2938e333bd1eac5218bd67aefb9d8f373da017a8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5810
Tested-by: jenkins
3 years agoopenrisc: Fix segv jsp due to free of unallocated data 93/4093/2
Stafford Horne [Tue, 4 Apr 2017 21:11:30 +0000 (06:11 +0900)]
openrisc: Fix segv jsp due to free of unallocated data

The prompt pointer in the jtag serial port is never zero'd or allocated.
Completely remove it since there is not much use for it as the target
software will provide the actual prompt.

Change-Id: Id95d8ccb9f725e53b9d03386b11d91eba1cd6ef4
Signed-off-by: Stafford Horne <shorne@gmail.com>
Reviewed-on: http://openocd.zylin.com/4093
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoopenocd: fix command's usage string 24/5824/2
Antonio Borneo [Sat, 22 Aug 2020 23:43:21 +0000 (01:43 +0200)]
openocd: fix command's usage string

The usage string should contain only the command parameters.
OpenOCD will automatically prepend the command name to the usage
string while dumping the usage or help message.

Remove the repeated command name from the usage string.

Change-Id: If10a0f1c254aee302b9ca08958390b7f21cdb21b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5824
Tested-by: jenkins
3 years agojtag/aice: fix command's usage string 23/5823/2
Antonio Borneo [Sat, 22 Aug 2020 23:35:09 +0000 (01:35 +0200)]
jtag/aice: fix command's usage string

The usage string should contain only the command parameters.
OpenOCD will automatically prepend the command name to the usage
string while dumping the usage or help message.

Remove the repeated command name from the usage string.

Change-Id: Idbc301b34fab19e221131d232577c1629568e6ea
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5823
Tested-by: jenkins
3 years agotarget/arc: fix command's usage string 22/5822/2
Antonio Borneo [Sat, 22 Aug 2020 23:28:38 +0000 (01:28 +0200)]
target/arc: fix command's usage string

The usage string should contain only the command parameters.
OpenOCD will automatically prepend the command name to the usage
string while dumping the usage or help message.

Remove the repeated command name from the usage string.

Change-Id: I691094a6395acb0e4ea3bea2347ff38379002464
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5822
Tested-by: jenkins
3 years agoopenocd: use proper format with uint32_t 19/5819/2
Antonio Borneo [Tue, 18 Aug 2020 16:56:53 +0000 (18:56 +0200)]
openocd: use proper format with uint32_t

Modify the format strings to properly handle uint32_t data types.

Change-Id: I4de49bf02c9e37b72240224c23fc83abe8a4fa83
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5819
Tested-by: jenkins
3 years agotarget: use proper format with uint32_t 18/5818/2
Antonio Borneo [Tue, 18 Aug 2020 16:56:27 +0000 (18:56 +0200)]
target: use proper format with uint32_t

Modify the format strings to properly handle uint32_t data types.

While there, fix prototype mismatch between header and C file of
the function armv7a_l1_d_cache_inval_virt().

Change-Id: I434bd241fa5c38e0c15d22cda2295097050067f5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5818
Tested-by: jenkins
3 years agoflash: use proper format with uint32_t 16/5816/2
Antonio Borneo [Tue, 18 Aug 2020 16:56:03 +0000 (18:56 +0200)]
flash: use proper format with uint32_t

Modify the format strings to properly handle uint32_t data types.

Change the type of variable retval in 'nor/ambiqmicro.c' to match
both the value to carry and the returned type of the function.

Fix the prototype mismatch of function lpc2900_address2sector()
between the header and the C file.

Change-Id: I68ffba9bd83eec8132f83bff3af993861fd09d84
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5816
Tested-by: jenkins
3 years agojtag: use proper format with uint32_t 15/5815/2
Antonio Borneo [Tue, 18 Aug 2020 16:55:25 +0000 (18:55 +0200)]
jtag: use proper format with uint32_t

Modify the format strings to properly handle uint32_t data types.

Change the prototype of detect_swo_freq_and_prescaler() in
'jlink.c' to avoid an implicit cast in the caller function.

Change the type of the variable retlen in some functions in
'usb_blaster.c' to properly pass their pointer to the local read
and write functions.

Use the proper parser COMMAND_PARSE_NUMBER(u32, ...).

Change-Id: I5227dbce04ee59881f173724db90790b7b9cc7af
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5815
Tested-by: jenkins
3 years agojtag/aice: avoid abusing of int32_t type 14/5814/2
Antonio Borneo [Tue, 18 Aug 2020 16:31:53 +0000 (18:31 +0200)]
jtag/aice: avoid abusing of int32_t type

In several cases the 'int' status value returned by libusb and by
aice internal functions is taken in a variable of type 'int32_t',
requiring an implicit (but trivial) cast.
This makes compulsory using 'PRId32' in the format strings that
print such 'int32_t' result and requires an additional implicit
conversion to return the 'int32_t' as 'int'.

Replace to type 'int' all the occurrences of 'int32_t result' and
fix accordingly the format strings.

Plus, all the size of aice commands are stored as int32_t const
variables with uppercase name, violating the coding style, and are
then passed as 'int' parameter to the read/write functions.

Replace the variables with C macros carrying an 'int' value.

While there, replace also a 'uint32_t' loop index with 'unsigned'
and fix the format string in the loop.

Change-Id: Ic57d58770f1af95f003b5a02fbcb7c926ec06fd1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5814
Tested-by: jenkins
3 years agoopenocd: avoid checking for non NULL pointer to free it 08/5808/5
Antonio Borneo [Sun, 16 Aug 2020 19:35:10 +0000 (21:35 +0200)]
openocd: avoid checking for non NULL pointer to free it

The function free() can be called with a NULL pointer as argument,
no need to check the argument before. If the pointer is NULL, no
operation is performed by free().

Remove the occurrences of pattern:
if (ptr)
free(ptr);

While there replace a sequence malloc(size)+memset(,0,size) with a
calloc(1,size).
Replace a pointer assignment to '0' with an assignment to NULL.
In server/*, an error is logged if the ptr was already NULL. This
cannot happen since the pointer was already referenced few lines
before and openocd would have been already SIGSEGV in that case,
so remove the log.

Change-Id: I10822029fe8390b59edff4070575bf7f754e44ac
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5808
Reviewed-by: Adrian M Negreanu <adrian.negreanu@nxp.com>
Tested-by: jenkins
3 years agoflash: avoid checking for non NULL pointer to free it 11/5811/4
Antonio Borneo [Mon, 17 Aug 2020 08:08:35 +0000 (10:08 +0200)]
flash: avoid checking for non NULL pointer to free it

The function free() can be called with a NULL pointer as argument,
no need to check the argument before. If the pointer is NULL, no
operation is performed by free().

Remove the occurrences of pattern:
if (ptr)
free(ptr);

There are cases where the pointer is set to NULL after free(), but
then re-assigned within few lines. Drop the setting to NULL when
this is evident. Anyway, the compiler will remove the useless
assignment so no reason to be too much aggressive in this change.

Change-Id: I55b2ce7cbe201410016398933e34d33a4b66e30b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5811
Tested-by: jenkins
3 years agoadi_v5: use macro DP_APSEL_MAX to allocate struct adiv5_ap 06/5806/2
Antonio Borneo [Fri, 14 Aug 2020 08:54:32 +0000 (10:54 +0200)]
adi_v5: use macro DP_APSEL_MAX to allocate struct adiv5_ap

Commit 11019a824d02 ("adi_v5: enforce check on AP number value")
introduces the macro DP_APSEL_MAX and use it in place of hardcoded
magic numbers for the upper limit of AP selection value.

Use the macro also while defining the array of struct adiv5_ap in
struct adiv5_dap.

Change-Id: I88f53ceb710f92a48a8026a365709fbf2d9e6912
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5806
Tested-by: jenkins
3 years agohelper: fix minor typos 01/5801/2
Antonio Borneo [Sat, 11 Jul 2020 22:57:34 +0000 (00:57 +0200)]
helper: fix minor typos

Change-Id: I785e388148c0329e51cb0b39ab30e8ee44f5a7cd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5801
Tested-by: jenkins
3 years agohla_transport: split command registration per transport 77/4877/3
Antonio Borneo [Sun, 27 Jan 2019 14:49:34 +0000 (15:49 +0100)]
hla_transport: split command registration per transport

All the HLA transports (hla_swd and hla_jtag) register the same
set of commands. Such commands are mainly aimed at handling JTAG
compatibility that is required for the transport hla_jtag only.

Split per transport the command registration and limit the
commands to only those required by the transport itself.
Replace the command "hla newtap" with the transport specific
"swd newdap" or "jtag newtap".
Deprecate the command "hla".

Change-Id: I79c78fa97b707482608516d3824151a4d07644c0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4877
Tested-by: jenkins
3 years agotcl/target: use command 'jtag newtap' to add a boundary scan TAP 73/4873/5
Antonio Borneo [Sat, 26 Jan 2019 15:19:55 +0000 (16:19 +0100)]
tcl/target: use command 'jtag newtap' to add a boundary scan TAP

A JTAG TAP for boundary scan should be added in the scan chain
through the command "jtag newtap".
In some TCL target script the boundary scan TAP is added through
the command "swj_newdap", command that is inappropriate in this
context because specific for arm adi-v5 SWJ-DP.
This situation was probably created to bypass the error with HLA
framework, caused by missing command "jtag newtap".

Add the command "jtag newtap" in HLA, by reusing the existing
code for command "hla newtap".
Fix the TCL target scripts to use the command "jtag newtap" for
the boundary scan TAPs.

The TCL script target/psoc6.cfg has no evident reference to HLA,
so the reason for using "swj_newdap" is less clear. Nevertheless
it uses the wrong command and, once HLA is fixed, there is no
reason to avoid fixing it too.

Change-Id: Ia92f8221430cf6f3d2c34294e22e5e18963bb88c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4873
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
3 years agotcl/board/st_nucleo_l1.cfg use dualbank configuration 29/5829/2
Alexandre Bourdiol [Tue, 1 Sep 2020 14:50:08 +0000 (16:50 +0200)]
tcl/board/st_nucleo_l1.cfg use dualbank configuration

st_nucleo_l1.cfg is based on STM32L152RET6 which support
dualbank flash.

Change-Id: I7ecdb7b7557229465e23eed667f20cd84197dfc7
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Reviewed-on: http://openocd.zylin.com/5829
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoFix debug prints when loading to flash 00/5800/4
Samuel Obuch [Tue, 11 Aug 2020 15:37:01 +0000 (17:37 +0200)]
Fix debug prints when loading to flash

While loading to flash with debug level at least 3,
OpenOCD tries to print the whole loaded bitstream.
This will be very-very-slow due to implementation of
conversion from buffer to string.

* fix condition on selected debug level in jtag/core.c
* replace slow buf_to_str function from helper/binarybuffer.c
  with faster but_to_hex_str function

Change-Id: I3dc01d5846941ca80736f2ed12e3a54114d2b6dd
Signed-off-by: Samuel Obuch <sobuch@codasip.com>
Reviewed-on: http://openocd.zylin.com/5800
Tested-by: jenkins
Reviewed-by: Jan Matyas <matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agotcl/interface/ftdi: fix comment in minimodule-swd.cfg 04/5804/2
Jan Kowalewski [Fri, 14 Aug 2020 10:21:54 +0000 (12:21 +0200)]
tcl/interface/ftdi: fix comment in minimodule-swd.cfg

Change-Id: I160faca11f231e3e839046ae2045e37e350ca613
Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
Reviewed-on: http://openocd.zylin.com/5804
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agoRefer to cross-build script in README 11/5711/2
Andreas Fritiofson [Tue, 2 Jun 2020 17:37:49 +0000 (19:37 +0200)]
Refer to cross-build script in README

Change-Id: Ic983d2505e40891ba0d0eea3468a71a7741f5c3a
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/5711
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
3 years agolog: handle LOG_*() before calling to log_init() 02/5602/2
Antonio Borneo [Thu, 23 Apr 2020 22:28:49 +0000 (00:28 +0200)]
log: handle LOG_*() before calling to log_init()

There are cases where LOG_*() functions are called before the logs
are initialized with log_init().
E.g. in transport_register() that is executed in gcc constructors,
thus called even before main().
With debug_level set to LOG_LVL_USER=-1 all the LOG_ERROR() get
dropped.
Properly initializing debug_level cause segmentation fault due to
log_output still not initialized.

Initialize debug_level to LOG_LVL_INFO so errors get printed.
Handle separately the case of log_output still NULL, meaning that
log_init() is not called yet.

Change-Id: I2ea32c87a4955fb44e79b38131c456e25dfbc327
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5602
Tested-by: jenkins
3 years agoserver/gdb_server: fix incorrect condition check 94/5794/2
Christopher Head [Mon, 10 Aug 2020 18:09:02 +0000 (11:09 -0700)]
server/gdb_server: fix incorrect condition check

The warning message should be printed if the target is NOT halted, not
if it IS halted.

Change-Id: I0a38292a8a2e20e4a4a5ada92b475d551d4cbf38
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5794
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agotcl: Add support for NDS V5 target and xc7/Corvette-F1 38/5338/5
Hellosun Wu [Tue, 29 Oct 2019 05:36:31 +0000 (13:36 +0800)]
tcl: Add support for NDS V5 target and xc7/Corvette-F1

The "Corvette-F1" is an Arduino-compatible evaluation platform,
which fully supports AndesCore. The board has FTDI FT2232 to
connected to FPGA's JTAG interface.

The "ADP-XC7KFF676" is a development and prototyping board that
provides capacity for evaluation of AndesCore processors.
It works with AICE in-circuit debugging tools.

This patch also include target/nds32v5.cfg to support AndesCore
N22/N25F and AndeShape Platform AE250.

Change-Id: I144d5063d5086d00ec44634a5028b5ea5d2eba33
Signed-off-by: Hellosun Wu <wujiheng.tw@gmail.com>
Reviewed-on: http://openocd.zylin.com/5338
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 years agosrc/flash/nor/virtual: handle null pointers 82/5782/5
Christopher Head [Fri, 17 Jul 2020 21:44:35 +0000 (14:44 -0700)]
src/flash/nor/virtual: handle null pointers

Either of protect and protect_check driver callbacks can be NULL. In
virtual_protect, reuse flash_driver_protect which checks for that case
and generates a nice error message and return code. In
virtual_protect_check, there is no corresponding flash_driver_*
function, so add the NULL check directly.

Change-Id: Ia63d85ede640a8382cf5cad0760f5d1ffe4d7cfe
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5782
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 years agoflash/nor/stm32f2x: clean up data types 78/5778/3
Christopher Head [Fri, 17 Jul 2020 18:17:52 +0000 (11:17 -0700)]
flash/nor/stm32f2x: clean up data types

Change-Id: I677bc4487fc2eff2c32e14ca2db5470fddaa63b5
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5778
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 years agosrc/flash/nor/stm32h7x: fix format strings 83/5783/2
Christopher Head [Fri, 17 Jul 2020 21:54:46 +0000 (14:54 -0700)]
src/flash/nor/stm32h7x: fix format strings

* use proper type codes
* add 0x in front of hex values
* remove some concatenated empty strings

Change-Id: I06a8344d0ed62de7a0f3e2dd8fba69b17eeb3626
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5783
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>

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)