Commit Graph

10211 Commits

Author SHA1 Message Date
Antonio Borneo cca64798f8 target: rewrite command 'was_examined' as COMMAND_HANDLER
Check for empty command line, add the mandatory 'usage' field.

Change-Id: I3f59448458fe01268bf5f4293aea5adcbd6d8279
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7505
Tested-by: jenkins
2023-03-25 18:15:03 +00:00
Antonio Borneo 113ba58231 target: rewrite command 'target curstate' as COMMAND_HANDLER
While there, add the mandatory 'usage' field.

Change-Id: Ibfda6f56a1450e2eb9ad3092d756de0778f4a092
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7504
Tested-by: jenkins
2023-03-25 18:14:52 +00:00
Antonio Borneo 584986ab1c target: rewrite command 'read_memory' as COMMAND_HANDLER
While there, fix typo on 'exceeds'.
In a following patch, the output could be formatted and split in N
values per line to make it easier to read by humans.

Change-Id: I295111a80934393011e46311f6cf6c13f2bdc0a3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7503
Tested-by: jenkins
2023-03-25 18:14:40 +00:00
Antonio Borneo 6f8c27dcfc target: arm_tpiu_swo: rewrite command 'tpiu init' as COMMAND_HANDLER
Change-Id: Iaaccfc62dd85267066a152c434f254d1b9a0c4f1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7502
Tested-by: jenkins
2023-03-25 18:14:30 +00:00
Antonio Borneo 90ddac12e3 target: arm_tpiu_swo: rewrite command 'tpiu names' as COMMAND_HANDLER
While there, format in a human readable way the output list by
using one line per tpiu name.

Change-Id: I937c92b6c1e92509cf8aa96be1517a51bc363600
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7501
Tested-by: jenkins
2023-03-25 18:14:18 +00:00
Antonio Borneo 5d39a8852a target: arm_tpiu_swo: rewrite command 'tpiu enable' as COMMAND_HANDLER
Change-Id: Ia600948b99a229ef0490b7f576df62f880db8546
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7500
Tested-by: jenkins
2023-03-25 18:14:07 +00:00
Antonio Borneo 8fa6db6e8e target: arm_tpiu_swo: rewrite command 'tpiu disable' as COMMAND_HANDLER
Change-Id: I689482f898bde2afa2881b2f311676a6b98abb9a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7499
Tested-by: jenkins
2023-03-25 18:13:56 +00:00
Antonio Borneo f76e67a440 target: arm_dap: rewrite command 'dap names' as COMMAND_HANDLER
While there, format in a human readable way the output list by
using one line per dap name.

Change-Id: I24a47350105b90db15808c61790f05d807120739
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7498
Tested-by: jenkins
2023-03-25 18:13:46 +00:00
Antonio Borneo fbb7a50cbd jtag: rewrite command 'flush_count' as COMMAND_HANDLER
While there:
- check the number of command parameters;
- add the mandatory 'usage' field.

Change-Id: I7cd16f049753caedf19f313f7dc84be98efdba42
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7497
Tested-by: jenkins
2023-03-25 18:13:34 +00:00
Antonio Borneo 254598ba25 jtag: rewrite command 'jtag arp_init-reset' as COMMAND_HANDLER
While there add the mandatory 'usage' field.

Change-Id: I316fb31e24e94985dcc724e428b0384be7ef5bdd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7496
Tested-by: jenkins
2023-03-25 18:13:18 +00:00
Antonio Borneo ff0fdcf614 jtag: rewrite command 'jtag arp_init' as COMMAND_HANDLER
While there add the mandatory 'usage' field.

Change-Id: I3491ed79d11c5a3e81cc9afd2423da14b8df72ff
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7495
Tested-by: jenkins
2023-03-25 18:13:05 +00:00
Antonio Borneo 2774125257 jtag: rewrite command 'jtag names' as COMMAND_HANDLER
While there:
- format in a human readable way the output list by using one line
  per tap name;
- add the mandatory 'usage' field.

Change-Id: I295449220c78fac8973478b265413342ea832f61
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7494
Tested-by: jenkins
2023-03-25 18:12:52 +00:00
Antonio Borneo 19e2a0d6af jtag: rewrite command 'adapter name' as COMMAND_HANDLER
Trivial change.
Add the mandatory 'usage' field.

Change-Id: Id92af5cd873fb86f5de79f785f156d1ef734b005
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7493
Tested-by: jenkins
2023-03-25 18:12:38 +00:00
Antonio Borneo 5da4ef25c8 target: cti: rewrite command 'cti names' as COMMAND_HANDLER
While there, format in a human readable way the output list by
using one line per cti name.

Change-Id: I6d4870ee512fe7e6935d73355c2377ad805ccc3b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7492
Tested-by: jenkins
2023-03-25 18:12:20 +00:00
Antonio Borneo c4f2337d02 target: armv4_5: rewrite commands 'arm mcr/mrc' as COMMAND_HANDLER
While there, add a check for target halted and check the number of
parameters accordingly to the command name.

Change-Id: I9e8bb109c35039561997d14782fac682267aee65
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7491
Tested-by: jenkins
2023-03-25 18:12:02 +00:00
Antonio Borneo 21e6252965 target: aarch64: rewrite commands 'aarch64 mcr/mrc' as COMMAND_HANDLER
This also fixes an incorrect return ERROR_TARGET_NOT_HALTED from a
jim command.

Change-Id: I99a02a21bedb64e60944e295c7cf24356e07be60
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7490
Tested-by: jenkins
2023-03-25 18:11:26 +00:00
Antonio Borneo 0332da1f15 rtt: rewrite command 'rtt channellist' as COMMAND_HANDLER
This also fixes a mistake of the jim command returning ERROR_xx
when function rtt_read_channel_info() returns error.
While there:
- format in a human readable way the output dictionary list, while
  preserving the structure of its TCL data;
- add check for the number of parameters.

Change-Id: Ica2b623699d3a606d3992975c836dae96f74b26d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7489
Tested-by: jenkins
2023-03-25 18:11:14 +00:00
Antonio Borneo 880ae3f077 openocd: rewrite command 'version' as COMMAND_HANDLER
Trivial change.
While there:
- add the mandatory 'usage' field;
- document the optional parameter 'git';
- reword the documentation.

Change-Id: I6be4d4423128fa026a62e2ef355f77b69d50397e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7488
Tested-by: jenkins
2023-03-25 18:10:54 +00:00
Antonio Borneo 842a12f4ca helper: util: rewrite command 'ms' as COMMAND_HANDLER
Use full 64 bits in output; no reason to truncate at 32 bits.

Change-Id: I433815a381e147731ff0da2c805170649a9bcf38
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7487
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2023-03-25 18:10:14 +00:00
Antonio Borneo 80fc9fabc6 flash: nor: rewrite command 'flash list' as COMMAND_HANDLER
The mixed use of jim commands and OpenOCD commands is error prone
due to handling of errors through JIM_xx and ERROR_yy.

Rewrite the jim command 'flash list' as OpenOCD command.
While there:
- format in a human readable way the output dictionary list, while
  preserving the structure of its TCL data;
- add the mandatory 'usage' field.

Change-Id: I1ee69870d3ab3c1cfc46cd2b8ec03de6b2300bd6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7486
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2023-03-25 18:10:02 +00:00
Antonio Borneo d05c686671 transport: rewrite command 'transport select' as COMMAND_HANDLER
The mixed use of jim commands and OpenOCD commands is error prone
due to handling of errors through JIM_xx and ERROR_yy.

Rewrite the jim command 'transport select' as OpenOCD command.
This fixes and incorrect check for the return value of function
transport_select(); it returns ERROR_yy but the check is on JIM_xx.
While there, fix the coding style.

Change-Id: I9f3e8394c1a0cc0312b414c58275e1220217bbed
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7485
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2023-03-25 18:09:47 +00:00
Antonio Borneo 1ec8b83cbd helper: command: rewrite command 'ocd_find' as COMMAND_HANDLER
The mixed use of jim commands and OpenOCD commands is error prone
due to handling of errors through JIM_xx and ERROR_yy.

Rewrite the jim command 'ocd_find' as OpenOCD command.

Change-Id: Id775bccc12840bcf95d8c19787beda5e7c3107fc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7484
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2023-03-25 18:09:35 +00:00
Antonio Borneo 5f6ceebbba svf: make command 'svf' syntax consistent
The command 'svf' is the only command in OpenOCD that accepts
options in both forms 'option' and '-option'.

Deprecate the option format without the leading '-'.
Update the documentation and fix the on-line help.
While there:
- switch to use the new nvp.h helper;
- return ERROR_COMMAND_ARGUMENT_INVALID on invalid command args;
- fix some minor coding style rule.

Change-Id: I5b944403d92a3fa1e12d5faafc1d2a139bc16a7d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7534
Tested-by: jenkins
2023-03-25 18:09:06 +00:00
Antonio Borneo f8631c3650 svf: fix memory leak on error during command execution
If svf_set_padding() returns error, jump to free_all label to
prevent any memory leak.
Propagate the error reported by svf_set_padding() instead of
overwriting it.
Use command_print() instead of LOG_ERROR() for command output.

Change-Id: I61fd89cad10652f2f9ef1f9d48a040e35253c3d4
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7533
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-03-25 18:08:45 +00:00
Antonio Borneo 86827a961a svf: fix leaking file descriptor
The file descriptor svf_fd is not closed on command error, thus
leaking memory.

Close svf_fd on errors.
While there, properly initialize svf_fd using NULL instead of 0.

Change-Id: I5efe9ce576a3a50588b30000222665e26161dfdc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7532
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: <kai.schmitz@advantest.com>
2023-03-25 18:08:18 +00:00
Tomas Vanek 415715d91a target/adi_v5_jtag: fix endianness error in transaction replay
The code for JTAG WAIT recovery did not handle DP_SELECT
endianness.

While on it, mark missing ADIv6 DP SELECT1 handling as TODO.

Change-Id: I44f3bc8fc9fd2483c0293b6d4f2c51a60ca01873
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7540
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-25 18:07:51 +00:00
Tomas Vanek 6ecd99ff9b target/adi_v5_swd: update comment about SWD capability
The multidrop SWD is also supported.

Change-Id: I9fefc54fc9d40a75194285cd6e0f10c5c347d9b6
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7537
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-25 18:07:04 +00:00
Erhan Kurubas faeae51d7f target/espressif: check common_magic instead of gdb_arch string
The value returned by target_get_gdb_arch() is something specific for GDB.
There could be several variants of the same CPU.
If we start implementing all the variants, checking the string value,
could become incorrect.
It's better to check for xtensa->common_magic == XTENSA_COMMON_MAGIC

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I20f3fdced176c3b9ab00f889743161ecad7280f9
Reviewed-on: https://review.openocd.org/c/openocd/+/7536
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-25 18:06:36 +00:00
Erhan Kurubas ee31f1578a rtos/nuttx: add Espressif target support and refactoring
Almost written from the beginning in a modern OpenOCD way.
- Endiannes support
- Proper variable types
- Align with the other rtos implementations

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I0868a22da2ed2ab664c82b17c171dc59ede78d10
Reviewed-on: https://review.openocd.org/c/openocd/+/7444
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-25 18:06:08 +00:00
Antonio Borneo 9ce6b0898e helper/compiler: fix build on MacOS
On MacOS, clang defines [1]:
	#define __nonnull _Nonnull
that creates incompatibility with GCC and with the macro __nonnull
defined in some libc.

Detect clang on MacOS and undefine __nonnull.

Change-Id: I64fcf51b102ea91c196e657debd8c267943a2b08
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Links: [1] https://github.com/llvm/llvm-project/blob/llvmorg-16.0.0/clang/lib/Frontend/InitPreprocessor.cpp#L1226
Reviewed-on: https://review.openocd.org/c/openocd/+/7544
Tested-by: jenkins
2023-03-25 18:00:28 +00:00
Kai Schmitz b6b4f9d46a svf: new command line options -noreset and -addcycles
-noreset: when using several SVF input files in a sequence it is not always
 desireable to have a JTAG reset between the execution of the files.
 The -noreset option skips this unwanted reset.

-addcycles <x>: some tests rely on a certain number of extra clock cycles
 between the actual JTAG commands. The -addcycles option injects a number
 x cycles after each SDR instruction.

Signed-off-by: Kai Schmitz <kai.schmitz@advantest.com>
Change-Id: I31932d6041dbc803be00016cd0a4f23fb2e7dbe1
Reviewed-on: https://review.openocd.org/c/openocd/+/7433
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-18 22:01:34 +00:00
Antonio Borneo b4e28446b8 tcl: remove exec permission to tcl config files
With the new checkpatch we will not get this type of issues
anymore.
In mean time, let's fix what we have missed during the review
process.

Change-Id: Iecebf9d43f51a29ee09505d360792793afd24b40
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 53556fcded ("tcl/interface: add Ashling Opella-LD FTDI config files")
Reviewed-on: https://review.openocd.org/c/openocd/+/7530
Tested-by: jenkins
2023-03-18 22:00:36 +00:00
Marc Schink 1528845331 tcl/tools/test_cpu_speed: Fix register name
Use correct register name after it has beed changed
in commit 11ee500bff ("target/armv7m: Rename xPSR to xpsr")

Change-Id: I3648848f4b47af2d20d60c3e0ecef78f75f6d605
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7473
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-18 21:59:47 +00:00
Antonio Borneo dccf323c1f jimtcl: update to version 0.82
The new version modifies it's auto configure in change
	https://github.com/msteveb/jimtcl/commit/ccd47be13019
stating:
	configure: Default to --full
	Now use --minimal and/or --without-ext to disable things.

With such change jimtcl doesn't build anymore as OpenOCD submodule
because of errors linking with new dependencies openssl and zlib.

Use option --minimal to keep the same build configuration as with
former jimtcl 0.81.
Add option --disable-ssl to avoid a build error on system with no
ssl libraries installed. This is already fixed in jimtcl upstream
but not part of 0.82. Note that ssl is not currently used by
OpenOCD.

Change-Id: I0879891dbd083bfbff1e904daf6cd549c3329bbf
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7517
Tested-by: jenkins
2023-03-18 21:59:19 +00:00
Antonio Borneo 45eeeab308 build: fix distcheck for jimtcl
The issues have been highlighted while integrated jimtcl 0.82,
but were already present.

While building jimtcl as submodule, OpenOCD generates the file
jimtcl/configure.gnu to pass specific configure flags.
Issue 1: this file is not included in the distribution.
This causes the rebuild from the distribution to have a jimtcl
built with different (the default) configure flags.
With jimtcl 0.82 the new default is to enable all the features,
but a bug causes the build to fail when openssl is not installed
in the build system (the bug is already fixed but after 0.82 [1]).
All these together cause OpenOCD Jenkins to fail the build for
target 'distcheck' with jimtcl 0.82.

Add jimtcl/configure.gnu to OpenOCD distribution's file list.

The build system considers jimtcl/configure.gnu as a temporarily
file that should be removed during 'distclean'.
Issue 2: 'distcheck' set read-only permission to the source files,
including jimtcl/configure.gnu, so 'distclean' fails removing it.

Add a leading '-' to ignore errors while trying to remove the
file.

Issue 3: Now that 'distcheck' properly configures and builds
jimtcl, 'distcheck' still fails because we have enabled jimtcl
json support in [2] and jimtcl 'distclean' fails to properly
remove one object file (fixed after 0.82 [3]).

Make OpenOCD removing the file jimtcl/jsmn/jsmn.o to complete
the execution of 'distcheck'. Add a comment specifying which of
the jimtcl versions are affected.

Change-Id: I2f9153c5a41ba66b989b27c7bc57b38d1744cc29
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Link: [1] https://github.com/msteveb/jimtcl/commit/22277943a19c
Link: [2] 0a36acbf6a ("configure: build jimtcl with json extension")
Link: [3] https://github.com/msteveb/jimtcl/commit/32a488587a3e
Reviewed-on: https://review.openocd.org/c/openocd/+/7527
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2023-03-18 21:58:20 +00:00
Antonio Borneo 642735449a openocd: drop JIM_EMBEDDED macro
The macro JIM_EMBEDDED was required to be defined before including
jim.h in applications that embed jimtcl.
This requirement has been dropped in 2010 by removing the file
dos/Embedder-HOWTO.txt from jimtcl in
https://github.com/msteveb/jimtcl/commit/2d8564100c86#diff-3e93fa55e666

Drop the macro definition and the comment that mandates it.

Change-Id: I36883f60f25bb25839e4ebf908159569659764dd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7518
Tested-by: jenkins
2023-03-18 21:58:01 +00:00
Antonio Borneo e8f376e3c1 helper: add compiler.h to handle compiler specific workarounds
Not all compilers nor compiler versions supports the attributes
used in OpenOCD code.
Collect in a single file the workaround to handle them.

Change-Id: I92d871337281169134ce8e40b2064591518be71f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7519
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-03-18 21:57:27 +00:00
Ian Thompson 904d58c208 target/xtensa: add NX support
- Manual integration of NX support from xt0.2 release
- No new clang static analysis warnings

Signed-off-by: Ian Thompson <ianst@cadence.com>
Change-Id: I95b51ccc83e56c0d4dbf09e01969ed6a4a93d497
Reviewed-on: https://review.openocd.org/c/openocd/+/7356
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-18 21:56:50 +00:00
Peter Collingbourne 047b1a8fc2 target/image: zero-initialize ELF segments up to p_memsz
We were previously not zero-initializing ELF segments between p_filesz
and p_memsz (aka BSS). However, this may be necessary depending on the
user's application. Therefore, start doing so.

Change-Id: I5a743390069583aca7ee276f53afeccf2cac0855
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7513
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-18 21:52:02 +00:00
Chao Du a7f8a1d7fb doc: add missing FreeRTOS symbol
A new FreeRTOS symbol xSchedulerRunning was added into the symbol list.
But the doc was not updated accordingly.

Signed-off-by: Chao Du <duchao@eswincomputing.com>
Change-Id: If1b18591e2681477ad96f1dea566cc2547097767
Reviewed-on: https://review.openocd.org/c/openocd/+/7531
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-18 17:40:13 +00:00
Andrew Lalaev 8d1261c248 flash/nor/at91samd: add missing SAMR34/35 part numbers
All DIDs are taken from "SAM R34/R35 Errata Sheet" (DS80000834A).

Signed-off-by: Andrew Lalaev <andrey.lalaev@gmail.com>
Change-Id: Ie35f58e61bb02919c0676c91938c90192481d995
Reviewed-on: https://review.openocd.org/c/openocd/+/7521
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-03-18 17:39:29 +00:00
Andrew Lalaev 70d771c7b7 flash/nor/at91samd: fix RAM size for SAMR34/35
According to the datasheets these MCUs have 40Kb RAM.

Signed-off-by: Andrew Lalaev <andrey.lalaev@gmail.com>
Change-Id: I52b8a0c86035bccd6f3c1a478bb2e558bca4ae86
Reviewed-on: https://review.openocd.org/c/openocd/+/7520
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-03-18 17:39:18 +00:00
Tomas Vanek a8bc4e75b3 drivers/ftdi: prevent misleading error msg when more vid/pids configured
The driver tries to open mpsse engine for each vid pid
pair in sequence. If more vid/pid pairs are configured and
the USB device does not correspond to the first pair,
the driver shows 'unable to open ftdi device ...' error.

Match vid pid with the whole list as used in jtag_libusb_open()
instead of multiple mpsse_open() in for loop over vid/pid pairs.

Change-Id: I8ef55205be221c727607fe25b81ae21de0d96f02
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7529
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Wolfram Sang <wsa@kernel.org>
2023-03-18 17:33:48 +00:00
Tomas Vanek c7e0040689 drivers/libusb_helper: allow external use of jtag_libusb_match_ids()
Can be employed by a driver with custom libusb open.

Change-Id: I00c8a01df8780891a8b7c30e2e34ab191acdf9a8
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7528
Tested-by: jenkins
Reviewed-by: Wolfram Sang <wsa@kernel.org>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-18 17:33:28 +00:00
Wolfram Sang c8f56b4f00 TODO: remove outdated AT91SAM92xx entry
SAM9260 gained good generic infrastructure since 2009. And we always
want "improvements", no need for a TODO item.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
Change-Id: I92551ef9d42ee47ad7441f2354587bbb45edc97e
Reviewed-on: https://review.openocd.org/c/openocd/+/7526
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-18 17:30:46 +00:00
Wolfram Sang e1b0d5759a tcl/board/at91sam9g20-ek: remove outdated FIXME
It was fixed by e94180571 ("at91sam9: factorise cpu support") in 2011.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
Change-Id: I95ea149b45a9902424bf9068b4a2830c17ddc6be
Reviewed-on: https://review.openocd.org/c/openocd/+/7525
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-03-18 17:30:26 +00:00
Tomas Deingruber fc30feb51a tlc/interface: does fix source of raspberrypi-gpio-connector.cfg
in raspberrypi-native.cfg

Fixes: bec6c0eb09 (tcl/interface: universal config for all Raspberry Pi models)
Signed-off-by: Tomas Deingruber <Deingruber.Tomas@gmail.com>
Change-Id: I632c8acd84974937849b5fdf2943239def17bd6d
Reviewed-on: https://review.openocd.org/c/openocd/+/7512
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-03 22:26:15 +00:00
Peter Collingbourne 0a20e78b75 jtag/drivers/cmsis_dap: run queue on reaching transaction limit
We currently fail the transfer when issuing more than 255 transactions
at once, e.g.

> read_memory 0x10000000 32 256
CMSIS-DAP transfer count mismatch: expected 257, got 1

This is because the protocol only supports 255 transactions per packet
(65535 for block transactions), and as a result we truncate the
transaction count when assembling the packet. Fix it by running the
queue when we hit the limit.

Change-Id: Ia9e01e3af5ad035f2cf2a32292c9d66e57eafae9
Signed-off-by: Peter Collingbourne <pcc@google.com>
Fixes: 40bac8e8c4 ("jtag/drivers/cmsis_dap: improve USB packets filling")
Reviewed-on: https://review.openocd.org/c/openocd/+/7483
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-02-26 10:03:42 +00:00
Antonio Borneo c99c043f3f helper: command: drop last LF ('\n') from sequence of command_print()
The OpenOCD commands produce their TCL text result through the
pair command_print() and command_print_sameline().
The latter is used to concatenate output in a single line.

At the end of a sequence of command_print(), the last LF is taken
as part of the command result, while it is not always needed, and
it is even annoying when the output of two commands needs to be
concatenate in a single line.

Using command_print_sameline() in place of the last call to
command_print() would solve the problem but it's quite expensive
in term of coding to fix all the existing commands.

Drop the last LF, if present.
Commands that would specifically need a LF as last char, can add
an extra LF at the end of the output.
Document this behavior in command.h.

Change-Id: I6757c20fbfce923dd393083146e8d5a1f3b790b4
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7471
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-02-26 10:00:52 +00:00
Daniel Anselmi 79caea8745 flash/nor/spi: add 25pe{10/20/40/80/16}
Change-Id: Ic5660bff83b8636ef397482a3313971ecdff72c0
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7416
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-02-18 18:09:22 +00:00