The file INSTALL has been dropped in 2009 with [1] and it has been
replaced by the INSTALL file generated by automake.
The file INSTALL is only present in official releases of OpenOCD
and not in the code cloned from git.
Add a note in README to report this inconsistency.
Change-Id: I881b4282550a80bd5a6c61baff05543714a2e9c5
Reported-by: Mats <mats_w@users.sourceforge.net>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: https://sourceforge.net/p/openocd/tickets/451/
Link: [1] commit ef733b48e9 ("Switch automake handling to use
--gnu mode, not --foreign. Remove INSTALL file; automake
generates a copy of the latest version.")
Reviewed-on: https://review.openocd.org/c/openocd/+/9121
Tested-by: jenkins
Add a comment in the breakpoint code to clarify the check for the
odd breakpoint length of 3 bytes, introduced by [1].
[1]: commit 0a5e03c12a ("cortex_m.c: Use two byte breakpoint for
32bit Thumb-2 request").
Change-Id: I024863d10078b5d9062c876aa59ccf70a81bf641
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9139
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Cores like Cortex-M7, Cortex-M55 and Cortex-M85 can have either
D-Cache and/or I-Cache.
Using SW breakpoints in RAM requires handling these caches.
Detect the presence of cache at examine.
Detect cache state (enable/disable) at debug entry.
Take care of caches synchronization through the PoC (usually the
SRAM) while setting and removing SW breakpoints.
Add command 'cache_info' to check cache presence and size.
Change-Id: Ice637c215fe3042c8fff57edefbab1b86515ef4b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9077
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Do not echo the selected reset config. This is one of many changes to
make the behavior of Tcl commands more consistent.
This also avoids stray and confusing messages in the output of OpenOCD.
For example, the "reset_config" line here:
Open On-Chip Debugger 0.12.0+dev-00802-gb7f0145fc-dirty
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
cortex_m reset_config sysresetreq
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
While at it, fix some coding style and command handling issues.
Change-Id: I3b3d8687af1d23a2dc1764f29b52dc607b80cb59
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8638
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
We need to cleanup watchpoints on all targets in SMP group when GDB
connects. Otherwise, the targets will not be consistent.
Once thats fixed, both *_clear_target functions clearly duplicate
the corresponding *_remove_all functions.
Change-Id: I8e85dbc66fd3e596990d631ed2aed22959a8ca60
Signed-off-by: Samuel Obuch <samuel.obuch@espressif.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9086
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This finalizes the work that has begun to emulate v2 API
for older libgpiod versions.
It also add the required autotools/pkg-config stuff to
detect the available libgpiod version.
Change-Id: I2c3a60ce607ed9601b01d22d5d9b8af953944941
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8226
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Work in progress. Target is to replace v1 gpiod_line_request()
Define and use dummy functions from v2 for v1:
- gpiod_line_config_new(),
- gpiod_line_config_free(),
Not yet used:
- gpiod_line_config_add_line_settings(),
- gpiod_chip_request_lines().
Change-Id: I9e2d3013845c5d12942f5e07c9721fcd151d6840
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8207
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reorganize the code of helper_get_line() for label err_out.
Define and use dummy functions from v2 for v1:
- gpiod_request_config_new(),
- gpiod_request_config_free(),
- gpiod_request_config_set_consumer().
Change-Id: Ide7cd8459941a5a863c425a2b5abf1fb4a075874
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8202
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Preparing for libgpiod v2, replace v1 specific function
gpiod_chip_open_by_number() with the common v1 & v2 function
gpiod_chip_open().
Change-Id: I5f0f9bef739f4097fb74f78b5b6e2fe823c1ab87
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8201
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Some target, like aarch64, has more than one bank of registers.
Let the commands 'get_reg' and 'set_reg' to search the register
name in all banks, as is already done in command 'reg'.
Change-Id: Iae350a52f993790c5546925a2f7f81fbdb3f49b8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: e8e62c5aca ("target/tcl: Add get_reg function")
Fixes: da73280101 ("target/tcl: Add set_reg function")
Reviewed-on: https://review.openocd.org/c/openocd/+/9122
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
The reset-init handler needs to call the ROM API function to enable
XIP from flash.
Correct syntax for this command is to supply two-letter function code
as the first argument, flash bank number sholudn't be there.
Reported-by: Thomas D. Dean <tomdean@wavecable.com>
Fixes: 376d11c2e3
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: I94713630300ead32bc9db6a1a77658fa5d5214d4
Reviewed-on: https://review.openocd.org/c/openocd/+/9134
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
LaTeX is not used for the documentation but only as (intermediate)
output format. Developers do not need to write any LaTeX code at all and
will not need to do so in the future, so we do not need a style guide.
Remove the section on LaTeX from the style guide to make it clearer and
avoid confusion.
Change-Id: I238a35445616f39e38104ad0ff50ab246dd5990f
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9110
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
The buffer size check was using len + 4 but snprintf requires additional
space for the null terminator. The snprintf call formats '#%02x' which
needs 4 bytes total (1 for '#', 2 for checksum, 1 for null terminator).
The original check of len + 4 was insufficient and could cause snprintf
to truncate the checksum and replace the last character with '\0',
leading to malformed GDB packets.
Fix by changing the buffer size check from len + 4 to len + 5 (1 for '$',
1 for '#', 2 for checksum, 1 for null terminator) to provide adequate space
for snprintf's null terminator.
Change-Id: Ibf8b3c3f5e4d5ac5be795b8e688e055453798afe
Signed-off-by: Ryan QIAN <jianghao.qian@hpmicro.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9117
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
For some hosts build fails after the recent cmsis_dap_tcp addition
(see commit fcff4b712c ("jtag/drivers/cmsis_dap: add new backend
cmsis_dap_tcp") or https://review.openocd.org/c/openocd/+/8973)
- Header 'hidapi.h' may not be available and should not be needed here.
- Global pointer variable is not guaranteed to be treated as a constant
expression even with const modifier. Use global array instead, to avoid
'error: initializer element is not constant', as address of a global
array is a constant expression.
Change-Id: I0c72ff52340f546a5f635663a8fde28c99176d1b
Signed-off-by: Samuel Obuch <samuel.obuch@espressif.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9115
Tested-by: jenkins
Reviewed-by: Brian Kuschak <bkuschak@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
pico-debug and pico2-debug are virtual CMSIS-DAP adapters that
run on the otherwise dormant second core of the RP2040 and RP2350
respectively.
Change-Id: Ifd7dcbbabeb86c738cc58854add0e897633197de
Signed-off-by: Peter Lawrence <majbthrd@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9099
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
The coding style requires the 'case' to be at the same indentation
level of its 'switch' statement.
Align the code accordingly.
While there:
- add space around the operators;
- drop useless empty line.
Skip all riscv code, as it is going to be updated soon from the
external fork.
No changes are reported by
git log -p -w --ignore-blank-lines --patience
Change-Id: I2691dfdd2b6734143e14160b46183623e9773539
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9051
Tested-by: jenkins
The coding style requires the 'case' to be at the same indentation
level of its 'switch' statement.
Checkpatch is not able to detect numbers in exponential format,
like 6E-5, and complains about missing space around the operator
minus.
To complete the alignment of switch and case statements in this
file, use a separate commit with the special checkpatch ignore tag
in the commit message.
Align the code accordingly.
No changes are reported by
git log -p -w --ignore-blank-lines --patience
Checkpatch-ignore: SPACING
Change-Id: Ibe70c4a4d3f0bb44c03007103910b778944bb90e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9056
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
The coding style requires the 'case' to be at the same indentation
level of its 'switch' statement.
Align the code accordingly.
Skip the driver angie that is going to be updated soon with a new
commit and skip the folder OpenULINK that contains a firmware for
the dongle.
No changes are reported by
git log -p -w --ignore-blank-lines --patience
Change-Id: I960a89a45bc9956f98676a019f0d1a652601155f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9055
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
To prepare for aligning switch and case statements, fix in advance
some checkpatch error due to existing code:
- remove 'else' after return and break;
- use '__func__' in place of hardcoded function name;
- remove useless parenthesis;
- don't end line with an open parenthesis.
Change-Id: I6a9905e5a30c90456de562e727dd2dfe2fda10c4
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9054
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
The coding style requires the 'case' to be at the same indentation
level of its 'switch' statement.
Align the code accordingly.
No changes are reported by
git log -p -w --ignore-blank-lines --patience
Change-Id: Iaf368b0bdd7c797b0e4cfb91e838696d706fdcce
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9053
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
To prepare for aligning switch and case statements, fix in advance
some checkpatch error due to existing code:
- use '__func__' in place of hardcoded function name.
Change-Id: Ib90811c7fffa15702fb710345c5ca3c7331d5ad6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9052
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
To prepare for aligning switch and case statements, fix in advance
some checkpatch error due to existing code:
- remove useless parenthesis;
- remove useless 'break';
- join spit lines;
- add space around operators;
- remove 'else' after exit() and return.
Change-Id: I8a87a0ea104205d087dcb8cbf4c67ff13a47742f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9050
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
The code falls-through in the default case, making it not easy to
read.
Add the explicit break to improve the readability.
Change-Id: I4784b883e0e82258de17018dfdfb59b4042ac743
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9049
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
The coding style requires the 'case' to be at the same indentation
level of its 'switch' statement.
Align the code accordingly.
No changes are reported by
git log -p -w --ignore-blank-lines --patience
Change-Id: I24762505cdac22058e0a2a1f4e9235c9006e543d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9048
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
To prepare for aligning switch and case statements, fix in advance
some checkpatch error due to existing code:
- uniform braces around if/else statements.
While there:
- drop useless break.
Change-Id: Ic0ce0a9877dbf17c625cf80009a52922176a162d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9047
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
The coding style requires the 'case' to be at the same indentation
level of its 'switch' statement.
Align the code accordingly.
While there:
- add space around operators;
- remove space after cast.
Skip the file
contrib/firmware/angie/c/src/usb.c
as it's going to be modified by a patch already pending in gerrit.
No changes are reported by
git log -p -w --ignore-blank-lines --patience
Change-Id: I0bebd6d0cc95ddecd5794cc4c12c8412b38691e9
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9046
Tested-by: jenkins
To prepare for aligning switch and case statements, fix in advance
some checkpatch error due to existing code:
- uniform braces around if/else statements;
- don't end line with an open parenthesis.
While there:
- move the default case as last in the list.
Change-Id: Idb9603e9a59c7f2e1a7346d5bdd3bde384d2f75f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9045
Tested-by: jenkins
The coding style requires the 'case' to be at the same indentation
level of its 'switch' statement.
Align the code accordingly.
No changes are reported by
git log -p -w --ignore-blank-lines --patience
Change-Id: I1369294af64c2830cc7fcc2814eac073c2413ff5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9044
Tested-by: jenkins
Rework the function to drop the goto in the switch statement.
While there, change some variable to boolean.
Change-Id: I37cbc8aafaeb8aef7f083ee6f5afa9eae71e0cd9
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9042
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Drop the jumps to the label thanks to the factorized code.
Drop the now unused label.
Change-Id: I7e61ecee5a883a6ed6b77bfbff54a615d1b4d61c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9041
Tested-by: jenkins
Factorize function svf_run_command() by moving out of the 'case'
the common code related to the label 'xxr_common'.
The target is to drop later on the ugly label 'xxr_common' inside
the switch.
Apart for:
- the function and local variables declaration,
- the added function call in place of original code,
- the reduced indentation in the new function,
this change is a dummy copy/paste with no code modification.
Change-Id: I8149cf25f460326ba6666a9287c5c309e5d99488
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9040
Tested-by: jenkins
To prepare for aligning switch and case statements, fix in advance
some checkpatch error due to existing code:
- remove unnecessary parenthesis;
- uniform braces around if/else statements.
Change-Id: I851032e1b126462a325f73bdf236fd2dbc938ff3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9039
Tested-by: jenkins
The coding style requires the 'case' to be at the same indentation
level of its 'switch' statement.
Align the code accordingly.
No changes are reported by
git log -p -w --ignore-blank-lines --patience
Change-Id: Ic4070571d322776b638a15a40af85cd31fdae7ce
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9038
Tested-by: jenkins
To prepare for aligning switch and case statements, fix in advance
some checkpatch error due to existing code:
- fix useless 'else' after 'break', by moving the 'break'
statement.
While there:
- modify the checks on strncmp().
Change-Id: I123f3c0e3999669440845c946e4839d7288e8d91
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9037
Tested-by: jenkins
Since the initial code merged in 2012, the last case of the switch
has a useless test on 'retval' that is not assigned in the case.
Since 'retval' is initialized to ERROR_OK, the condition is always
false.
Drop the check on 'retval'.
While there, drop the useless parenthesis around the 'case' and
add the 'break' statement.
Change-Id: I3f673b5e10f6b28a4a74881b8a06a71b58afb422
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9036
Tested-by: jenkins