Antonio Borneo [Sat, 16 Dec 2023 16:39:12 +0000 (17:39 +0100)]
command: drop Jim Command handler, at last
With all OpenOCD commands converted to COMMAND_HANDLER, we can
drop the management of jim_handler commands.
Drop also from documentation the subsection on Jim Command
Registration.
Change-Id: I4d13abc7e384e64ecb155cb40bbbd52bb79ec672 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8901 Tested-by: jenkins
Antonio Borneo [Fri, 2 May 2025 14:10:39 +0000 (16:10 +0200)]
cortex-a: fix single-step on infinite loop
On ARMv7a/r the single-step is implemented through a HW breakpoint
that hits instructions at any address except the address of the
current instruction.
The method above fails in case of an infinite loop coded by a
single instruction that jumps on itself; in such case, the same
instruction (at the same address) is executed over and over and
the breakpoint never hits. In current code this case is wrongly
considered as an error.
Reduce the timeout while waiting for the HW breakpoint being hit,
then halt.
The jump on itself would be executed several times before the
timeout and the halt, but this is not an issue. There are few
"pathological" instructions in ARMv7a/r that jumps on itself and
that can have side effects if executed more than once. They are
listed in the code. We do not consider these as real use cases
generated by a compiler.
Document the method in the code.
Report that the single-step function is not properly managing the
HW breakpoints if it exits on error. To be fixed in the future.
Change-Id: I9641a4a3e2f68b83897ccf3a12d3c34e98a7805c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8871 Tested-by: jenkins
Walter Ji [Mon, 4 Mar 2024 09:29:15 +0000 (17:29 +0800)]
helper: add bitfield helper macros
This patch ports FIELD_{GET,PREP,FIT} macros and related macro
from FreeBSD, referenced file:
- `src/tree/sys/compat/linuxkpi/common/include/linux/bitfield.h`
Checkpatch-ignore: MACRO_ARG_REUSE
Change-Id: I6fdf4514d3f95d62fadf7654409a4878d470a600 Signed-off-by: Walter Ji <walter.ji@oss.cipunited.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8171 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
target: improve error messaging in `target create`
There are a couple of issues with the usage string for `target create`,
namely:
* `-chain-position` is allowed to be not the first option.
* `-chain-position` should be ommited alltogether on ARM targets when
DAP is specified.
Before the patch:
```
> openocd -c 'target create name testee'
...
target create name type '-chain-position' name [options ...]
```
After the patch:
```
> openocd -c 'target create name testee'
...
-chain-position ?name? required when creating target
> openocd -c 'target create'
...
target create name type [options ...]
```
Change-Id: Ia21a99ce6a4086e2e0676f5ef4685da3514a4f69 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8860 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
Daniel Goehring [Thu, 1 May 2025 02:38:15 +0000 (22:38 -0400)]
target: cget command fix for result output
Function target_configure() when processing a "cget" command needs
to print the result to the console. Currently the result is only printed
when an error occurs. To fix this, move the command print statement from
the error handling section to the common code section.
The code was tested by executing a "$target_name cget -dap" command
and reviewing the result.
Change-Id: Iff1999de8c8e9a837055ba95714137aa03e68d4b Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com> Fixes: 61890e3dc320 ("target: rewrite function target_configure() as COMMAND_HELPER")
Reviewed-on: https://review.openocd.org/c/openocd/+/8870 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Antonio Borneo [Thu, 1 May 2025 17:38:42 +0000 (19:38 +0200)]
transport: fix incorrect statement
Commit 236208a5ff2d ("transport: use a bitmask for the transport")
has an incorrect C statement in place of a return.
The code is working thanks to the previous condition never true.
The issue has been detected by clang scan-build in OpenOCD ACI
since the missing return can make the following statement
dereferencing a NULL pointer.
Fix it!
Change-Id: I3bbe04d99ad9b1288f55ba3c45e2e487aef9ae40 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 236208a5ff2d ("transport: use a bitmask for the transport")
Reviewed-on: https://review.openocd.org/c/openocd/+/8868 Tested-by: jenkins
Antonio Borneo [Sat, 19 Apr 2025 14:28:50 +0000 (16:28 +0200)]
target: armv7a: drop command 'cache_config l2x'
The command was already tagged as deprecated in 2015 with commit 0df557728216 ("armv7a: remove l1 flush all data handler") but has
never been removed.
An equivalent command 'cache l2x conf' was introduced at the same
time in commit cd440bd32a12 ("add armv7a_cache handlers").
Drop it and deprecate it.
Replace the old command in the Tcl script.
Change-Id: Ie24eccc99a78786903704d10ee1d9f6c924529b5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8857 Tested-by: jenkins
Chien Wong [Tue, 8 Apr 2025 12:33:56 +0000 (20:33 +0800)]
rtos/FreeRTOS: fix next pointer member offset in FreeRTOS lists
Currently, we are using offset of xListEnd.pxPrevious in List_t for
list_next_offset and offset of pxPrevious in ListItem_t for
list_elem_next_offset. This is confusing. Fix this.
As the related lists are doubly linked lists, only iteration order is
changed without breaking functionality.
Also document those offsets.
Change-Id: I8beacc235ee781ab4e3b415fccad7b72ec55b098 Signed-off-by: Chien Wong <m@xv97.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8833 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Marc Schink [Sat, 17 Aug 2024 10:35:30 +0000 (12:35 +0200)]
doc/manual: Add guideline for configuration files
The goal of this guideline is to have consistent and well-structured
configurations files. The focus of this patch is on filenames and
directory structure. A guideline for the content of the files should be
included in a subsequent patch.
This patch addresses a long outstanding task listed in 'Pending and Open
Tasks'.
Change-Id: Ib32dd8b9ed15c3f647cd8d74cfc79edf0e79a3df Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8854 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Antonio Borneo [Mon, 23 Dec 2024 19:20:08 +0000 (20:20 +0100)]
stlink: simplify the use of deprecated HLA transport
Commit 34ec5536c0ba ("stlink: deprecate HLA support") makes hard
to use the still functional HLA transport with the stlink listed
in board config files.
Now that the prefixes 'hla_' and 'dapdirect_' has been dropped
from the transport name, allow overriding the transport by using
the 'stlink-hla' script in front of the board file, e.g.:
Revert the documentation changes of the change above.
Improve the documentation to explain how to use the compatibility
HLA mode.
Improve the error message in stlink driver to guide the user to
update the stlink firmware and to use the compatibility HLA mode.
Change-Id: I5d0bc7954511692cebe024bda2aaa72767b97681 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8679 Tested-by: jenkins
Antonio Borneo [Wed, 12 Feb 2025 15:30:46 +0000 (16:30 +0100)]
transport: allow transport name jtag/swd for hla and dapdirect
The transport used on adapter's wires is either 'jtag' or 'swd'
but, depending on the adapter, in the command 'transport select'
we have to use either 'jtag' or 'swd' or the similar 'hla_jtag',
'hla_swd', 'dapdirect_jtag' or 'dapdirect_swd'.
This becomes cumbersome when we just want to change adapter and we
get forced to modify the 'transport select' command too.
There is no reason for an adapter driver to support two of the
similar transports. In fact 'dapdirect' one is a superset of the
'hla', and the native 'jtag' or 'swd' is a superset of the
'dapdirect' one.
While the adapter could support more than one similar transports,
its adapter driver should only support the most complete of these
similar transports.
Modify the 'transport select' code to accept 'jtag' or 'swd' for
the 'dapdirect' and the 'hla' adapters too.
Issue a deprecated message for the old 'dapdirect' and 'hla'
transport names.
In command 'transport list', print only the transport names that
can be selected through 'transport select' skipping information
about 'dapdirect' and 'hla' versions and avoid duplicated entries.
This improvement was listed in the TODO file. Update it!
Change-Id: I626b50e7a94c141c042eab388cd1ffe77eb864c2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8677 Tested-by: jenkins
Antonio Borneo [Sun, 22 Dec 2024 22:59:19 +0000 (23:59 +0100)]
transport: validate the transport id's from the driver
Verify that it contains only valid transports.
While JTAG and SWD are the more permissive transports, the
respective 'dapdirect' versions are slightly limited, and the
respective 'hla' versions are even more limited.
A driver should not provide two version of the same transport.
Verify that only one JTAG and only one SWD transport is present.
Verify that the preferred transport is valid too.
Change-Id: Iace2f881dd65fc763e81b33e6a7113961a7008af Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8676 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Antonio Borneo [Wed, 12 Feb 2025 15:39:18 +0000 (16:39 +0100)]
adapter: use bitmask for driver's transports
In every driver, replace the array of strings with a bitmask that
lists the supported transports.
Add an extra field to carry the former first listed transport as a
"preferred" transport. It would be used as default when no command
'transport select' is used. This keeps backward compatibility with
scripts that do not define the transport, relying on such default.
Antonio Borneo [Sun, 22 Dec 2024 16:06:12 +0000 (17:06 +0100)]
transport: use a bitmask for the transport
Move the transport's names in a local array in the transport
framework.
Replace the string struct transport::name, that identifies the
transport, with a bitmask where each bit corresponds to one of the
available transports.
Antonio Borneo [Sat, 4 Jan 2025 15:54:14 +0000 (16:54 +0100)]
transport: deprecate auto-selection of transport
Historically, if the user does not specify a transport, OpenOCD
select automatically the first transport listed in the adapter
driver.
This auto-selection can behave differently by changing adapter,
so the transport should be enforced in the configuration file.
Deprecate the auto-selection and print a warning message when a
transport gets auto-selected.
There are two cases:
- adapter offers one transport only. The code early auto-selects
the transport but does not print anything. If later the user
selects the transport then no deprecation will be printed during
'transport init';
- user runs 'transport select', e.g. in 'swj-dp' script, and this
triggers the auto-selection and the deprecated message.
Change-Id: I2e55b9dcc6da77ca937978fbfb36bc365b803f0d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8692 Reviewed-by: Jan Matyas <jan.matyas@codasip.com> Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
Antonio Borneo [Sat, 4 Jan 2025 17:41:41 +0000 (18:41 +0100)]
adapter: list supported transports beside adapter name
Modify the command 'adapter list' to output the list of transports
supported by each adapter driver.
Drop the line number, as there is no real interest on it.
Format the output as a TCL dictionary indexed by the adapter name
and containing the transports in a TCL list. E.g:
dummy { jtag }
ftdi { jtag swd }
This format is easily handled by TCL scripts, e.g.:
dict get [adapter list] ftdi
Document the command output.
Change-Id: I69f73b71da2f1756866a63bc2c0ba33459a29063 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8691 Tested-by: jenkins
Tomas Vanek [Fri, 21 Mar 2025 20:30:13 +0000 (21:30 +0100)]
flash/nor/rp2xxx: fix LOG_xxx messages
Use proper format specifiers for uint16_t and uint32_t arguments.
Use LOG_TARGET_DEBUG instead of target->cmd_name as a parameter.
Use command_print() in command handler.
Drop dots and new lines at end of messages.
Change-Id: I37c7d3680a352210b1d7e69f2c9b4ba0efe6ec15 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reported-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8809 Tested-by: jenkins
Tomas Vanek [Sat, 17 Aug 2024 14:21:06 +0000 (16:21 +0200)]
tcl/target/rp2040: add flash size override and reset init event
Allow flash size override and suppress flash size detection
by setting FLASHSIZE Tcl variable.
reset-init event calls 'connect XIP' ROM API function to make
flash content accessible at the XIP mapping memory area.
Ported from rp2350.cfg
Change-Id: I9b352b1ef6d4c6d4b78a6b61e900ce01355c8eff Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8461 Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com> Tested-by: jenkins
Tomas Vanek [Fri, 16 Aug 2024 21:35:06 +0000 (23:35 +0200)]
flash/nor/rp2xxx: fix endianness error
struct rp2xxx_rom_call_batch_record consists of uint32_t in the host
endianness. Therefore it should be converted to the target endianness
not just simply copied by target_write_buffer().
Concatenate algo code, converted batch records and terminator
to the host resident buffer and copy it at once to the target and
save some adapter turnaround times.
While on it remove typedef rp2xxx_rom_call_batch_record_t
Change-Id: I0e698396003869bee5dde4141d48ddd7d62b3cbc Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8460 Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com> Tested-by: jenkins
Tomas Vanek [Fri, 16 Aug 2024 20:53:36 +0000 (22:53 +0200)]
flash/nor/rp2xxx: drop couple of Java-like const
The compiler knows what variable remains constant during its lifetime
and there is no need to emphasise constantness.
Change-Id: Ib515f96a3c77afea87274f33b8ccac7a71bfb932 Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8459 Tested-by: jenkins Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Tomas Vanek [Wed, 14 Aug 2024 15:43:13 +0000 (17:43 +0200)]
flash/nor/rp2xxx: minor code improvements
Add error messages and proper error propagation.
Type cleaning.
Use saved chip id.
Cosmetics: separating lines added.
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I151e684e1fbfc9476ec429036caf85f4c9329547
Reviewed-on: https://review.openocd.org/c/openocd/+/8457 Tested-by: jenkins Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Tomas Vanek [Wed, 14 Aug 2024 09:29:21 +0000 (11:29 +0200)]
flash/nor/rp2040: refactoring: change rp2040 to rp2xxx
While on it use calloc() instead of malloc()/memset()
Drop useless implementation of rp2040_flash_free_driver_priv()
- exactly same as default_flash_free_driver_priv()
Code style fixes forced by checkpatch
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I5c56c4a7d586c0dcab164a45e8f6200ea9a3bd1d
Reviewed-on: https://review.openocd.org/c/openocd/+/8455 Tested-by: jenkins
Tomas Vanek [Tue, 13 Aug 2024 14:23:20 +0000 (16:23 +0200)]
tcl/target/rp2350: workarounds for ROM API issues
A0 chip: remove pad isolation
A2 chip: instead of reset init fixes we will fix the flash driver
with the following patch by Luke Wren:
8729: flash/nor/rp2xxx: fix flash operation after halt in RISC-V bootsel
https://review.openocd.org/c/openocd/+/8729
I don't have A1 version to test.
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I9e9fab04ead929fe6e0a17c6c2f32a6f02e9beb9
Reviewed-on: https://review.openocd.org/c/openocd/+/8450 Tested-by: jenkins
Tomas Vanek [Wed, 17 Jul 2024 09:49:55 +0000 (11:49 +0200)]
flash/nor/rp2040: allow arbitrary ROM API call from Tcl
The new flash command could be handy for a reboot to BOOTSEL mode
and for making (Q)SPI flash content visible at 0x10xxxxxx
address mapping area after a rescue reset.
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I1b532afcc41a4051298313e685658e86c02c53f9
Reviewed-on: https://review.openocd.org/c/openocd/+/8447 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Tomas Vanek [Tue, 6 Aug 2024 15:39:44 +0000 (17:39 +0200)]
flash/nor/rp2040: allow flash size override from cfg
Do not enforce hard-wired size 32 MiB
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I54608f75cc13996fda38ebd5d330e3b1893c2fd9
Reviewed-on: https://review.openocd.org/c/openocd/+/8446 Tested-by: jenkins Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Luke Wren <luke@raspberrypi.com>
Change-Id: I2b9db61e8ac837b6c6431aacf3b73ed3a1772fbc
Reviewed-on: https://review.openocd.org/c/openocd/+/8445 Tested-by: jenkins Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Luke Wren [Thu, 25 Jul 2024 09:55:41 +0000 (10:55 +0100)]
flash/nor/rp2040: Avoid ROM call timeout on long erases by splitting into chunks
Also add keep_alive() to erase/program to avoid nasty GDB message.
TV: Fixed style problems.
Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Luke Wren <luke@raspberrypi.com>
Change-Id: Ibb18775aeed192361ae1585bfdaad03760583cf3
Reviewed-on: https://review.openocd.org/c/openocd/+/8444 Tested-by: jenkins Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Luke Wren [Fri, 28 Jun 2024 15:41:48 +0000 (16:41 +0100)]
flash/nor/rp2040: Fix up ROM table lookup for RP2350 A2
which has 16-bit well-known pointers.
Change-Id: Ia0838a0b062f73a9c5751abb48f1b4d55100bd1d Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Luke Wren <luke@raspberrypi.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8443 Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com> Tested-by: jenkins
Antonio Borneo [Sun, 6 Apr 2025 12:59:50 +0000 (14:59 +0200)]
flash: stellaris: fix deprecated command
The driver directly runs a TCL command that has been renamed with
commit 4d99e77419e3 ("jtag/hla: Restructure commands"), while the
original name has been deprecated.
Junhui Liu [Wed, 26 Mar 2025 15:05:39 +0000 (23:05 +0800)]
tcl/target: Add RCPU support for Spacemit K1
Add support for the Real-Time CPU (RCPU) of K1, which is a 32-bit RISC-V
N308 High-Efficiency Processor Core designed by Nuclei System Technology
Co. Ltd.
The JTAG interface can be configured to connect to either X60s or RCPU
processors. To enable JTAG for RCPU, set TARGET to "rcpu".
Antonio Borneo [Sun, 3 Dec 2023 14:41:27 +0000 (15:41 +0100)]
target: rewrite function target_configure() as COMMAND_HELPER
The function target_configure() is used by the commands
'target create', 'configure' and 'cget', already rewritten as
COMMAND_HANDLER.
Rewrite the common function as COMMAND_HELPER.
While there:
- fix the check on arguments, even if it should be coded better;
- keep jimtcl code for target_type::target_jim_configure() and for
rtos_create(); these would be rewritten later on.
Change-Id: I7e5699ca6d124e34d3b2199714e3ce584bfcce80 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8829 Tested-by: jenkins
Antonio Borneo [Sat, 2 Dec 2023 17:40:47 +0000 (18:40 +0100)]
target: rewrite command 'invoke-event' as COMMAND_HANDLER
The command shares with command 'target create' the
struct jim_nvp nvp_target_event[]
- Convert the 'struct jim_nvp' in 'struct nvp'.
- Create an alias 'struct jim_nvp' to decouple the commands
'invoke-event' and 'target create', abusing the fact that the
actual layout of the two struct's type is the same. This alias
will be dropped in a following change.
- Rewrite the command 'invoke-event' and the helper function
target_event_name().
Change-Id: I537732fe4c08042cc02bcd0f72142254d7968fa6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8826 Tested-by: jenkins
Antonio Borneo [Sat, 5 Apr 2025 23:20:44 +0000 (01:20 +0200)]
target: don't free working areas during 'configure -chain-position'
Since commit ef1cfb23947b ("Duane Ellis: "target as an [tcl]
object" feature.") merged in 2008, the commands:
$target_name configure -chain-position ...
target create ... -chain-position ...
cause the allocated working area to be freed.
There is no reason for this, it is probably caused by an incorrect
copy/paste from the author.
Drop the call to target_free_all_working_areas().
Change-Id: I61a9303afe7fee6953669218330635c0b965b20d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8825 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
Antonio Borneo [Sat, 5 Apr 2025 15:04:43 +0000 (17:04 +0200)]
list: silent scan-build false positive
With commit c023534e7b6f ("target: use list for target events")
scan build incorrectly states that list_add() would be called with
the field 'next' of the parameter 'head' (thus 'head->next') set
to NULL. Then, list_add() would call linux_list_add() with the
parameter 'next' set to NULL that will cause a NULL dereference.
While this can really happen with broken code, it's not the case
with the code from the change above.
Add assert() in linux_list_add() to silent scan build on this
false positive and to detect future incorrect use of the list.
Change-Id: Iec7f3d70237312b646ac58f76ecaab2fa25eab41 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8824 Tested-by: jenkins
Antonio Borneo [Sat, 2 Dec 2023 16:34:57 +0000 (17:34 +0100)]
command: rewrite command 'capture' as COMMAND_HANDLER
While there, use Jim_EvalObj() to execute the subcommand, so any
error will correctly report the TCL file and the line number that
have originated the error, instead of the silly:
> capture {bogus command}
command.c:703: Error: invalid command name "bogus"
at file "command.c", line 703
Change-Id: Ic75a6146d6cedf49e808d98501fa1a7d4235b58a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8587 Tested-by: jenkins
Sofiane HAMAM [Fri, 28 Mar 2025 11:31:17 +0000 (12:31 +0100)]
Makefile.am: Use SOURCE_DATE_EPOCH environment variable
This package defines PKGBLDDATE as build timestamp which makes
it non reproducible. Use SOURCE_DATE_EPOCH if it is found, otherwise
use build timestamp. Following best practices, see :
https://reproducible-builds.org/docs/source-date-epoch/
Antonio Borneo [Sun, 23 Mar 2025 14:27:37 +0000 (15:27 +0100)]
target: remove events that are set to empty string
Current code allows replacing the body of an existing event, but
it doesn't provides a way to remove it.
Replacing the event with an empty string makes the event still
present and visible through
$target_name eventlist
The presence of empty events makes more complex checking for the
event not set or set to empty.
Remove the event when set to empty string.
While there, add 'Jim_Length' to the list of allowed CamelCase
symbols, avoiding the associated checkpatch error.
Change-Id: I1ec2e1a71d298a0eba0b6863902645bcc6c4cb09 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8814 Tested-by: jenkins
Antonio Borneo [Sun, 16 Mar 2025 10:50:04 +0000 (11:50 +0100)]
target: drop last instances of 'target->cmd_name'
The helper function 'target_name()' or, better, the log functions
'LOG_TARGET_xxx(target, ...)' should be used in place of taking
the target name directly from 'target->cmd_name'.
Replace the remaining instances in the code.
While there:
- address some indentation,
- drop trailing punctuation in log message,
- replace one LOG WARNING with LOG_TARGET_WARNING.
Antonio Borneo [Sat, 2 Dec 2023 15:50:14 +0000 (16:50 +0100)]
command: factorize jim_command_mode()
During 'help' dump, to determine the mode (e.g. COMMAND_CONFIG) of
a command, the current code executes the OpenOCD TCL command
"command mode", while it could directly call the implementation of
the TCL command above.
Factorize jim_command_mode() and call the inner implementation
instead of executing "command mode".
Antonio Borneo [Sat, 30 Nov 2024 23:01:00 +0000 (00:01 +0100)]
adapter: simplify command 'adapter list'
The code of command 'adapter list' is called by command 'adapter
driver' to list the available drivers in case of error.
This dual possible entry points require a conditional check on the
number of command line arguments, reducing the code readability.
Split the command in a simpler code for the command 'adapter list'
that only checks the command line, and move in a common helper the
code that list the drivers.
While there, fix the output and the comments to report 'adapter
driver' instead of 'debug adapters'; we are not parsing the HW to
know which adapter is present.
Change-Id: I17538e86dc4a31a9589d404e49dcc65a29393390 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8672 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Antonio Borneo [Sun, 22 Dec 2024 16:13:59 +0000 (17:13 +0100)]
adapter: drop command 'adapter transports'
The commit 93f2afa45f4c ("initial "transport" framework") that
added the transport framework in 2010 was overly optimistic on the
possibility to dynamically add, at runtime, a new adapter and to
specify with the command 'adapter transports' the list of the
transports supported by the new adapter.
Such feature has never become part of OpenOCD, and the command
above has never become useful nor ever been used.
Drop the command 'adapter transports' and its documentation.
Drop the helper 'transport_list_parse', now unused.
Change-Id: Ie3d71c74d068fba802839b116bb9bc9af77cc83d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8671 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
Antonio Borneo [Mon, 23 Dec 2024 19:59:28 +0000 (20:59 +0100)]
doc: drop mention of not implemented SPI transport
The commit 93f2afa45f4c ("initial "transport" framework") adds a
dedicated chapter in the documentation about a possible SPI
transport for flashing.
This transport has never been part of OpenOCD and should not be
listed in the documentation.
Drop the chapter.
Change-Id: I9b406754399abda4dc7c2f8cf09dd47730a7e1d9 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8670 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins