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
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: I6be44efd5189b671caabcf6753bb82ef44521440
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9034
Tested-by: jenkins
To prepare for aligning switch and case statements, fix in advance
some checkpatch error due to existing code:
- remove useless parenthesis;
- uniform braces around if/else statements,
- add space around operators.
While there:
- put the 'default' case as last in the list;
- convert format strings to drop cast.
Change-Id: I335b200add75b95bf1e908af39e957b61b617e22
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9033
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: I9689e5b4650b8301d1b81e384e4db41b4efc3993
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9032
Tested-by: jenkins
To prepare for aligning switch and case statements, fix in advance
some checkpatch error due to existing code:
- remove useless parenthesis;
- don't end line with an open parenthesis;
- expand multiple assignments.
While there, put the 'default' case as last in the list.
Change-Id: I17bf5e88b145ef9b5b188424182f4e54b818eeae
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9011
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: Iea3b60b3f01afbe31c495e8ea4ddc2b4c8efa936
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9010
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: I2a4c33f12506e898e1efbbfd711cc5834d81dda1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9009
Tested-by: jenkins
Since 2011 [1], Jim Tcl supports namespaces as an optional package
that is compiled-in by default.
Drop the incorrect sentence in OpenOCD documentation that reports
namespaces as not supported by Jim Tcl. It was true in 2008 when
the sentence was added with [2].
The meaning of the paragraph in the documentation does not change.
Change-Id: I30b422e369d106e70f5e1e20b21f0b6ea0fe6b8d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Link: https://github.com/msteveb/jimtcl/commit/7f383c6726fd [1]
Fixes: a28eaa85f ("jtag newtap change & huge manual update") [2]
Reviewed-on: https://review.openocd.org/c/openocd/+/9093
Tested-by: jenkins
The eCos build has been dropped in 2012 with commit 39650e2273
("ecosboard: delete bit-rotted eCos code").
Drop last eCos related code.
Change-Id: I6b0de6386386c0102d540504236dda58d7a664b9
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9092
Tested-by: jenkins
Make the driver more flexible and define adapter-specific configurations
in Tcl instead of C using the adapter GPIO subsystem.
The rework also includes coding style fixes and improvements of the
documentation. All modifications are done such that backwards
compatibility is ensured.
Tested with Olimex ARM-JTAG cable [1] and APM32F103 target device on
Linux and FreeBSD. The driver works on Linux using direct I/O and PPDEV.
On FreeBSD, only PPDEV works. The build with direct I/O already failed
before the patch. This problem will be fixed in a subsequent patch.
The patch is not tested on Windows because there is no documentation
for it.
[1] https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG/
Change-Id: Ib671d52a919eaf2959cf6365f2c8004257ae074c
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8943
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Add a user-specific signal 'user0' which can be used for custom
functionality.
For now, only a single user-specific signal is supported. Additional
signals 'userX' or a more generic handling can be added in the future.
Also, the signal state can only be configured during the adapter
initialization and termination. Commands to change the signal state at
run-time may be added in the future.
Change-Id: I3f31242f6a693e11565542c3bd4521a245b4ff95
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9088
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
In addition to a signal's 'init state', add support to configure its
'exit state'. This option determines the state and configuration of a
pin when the adapter terminates its operation.
Change-Id: I0577ed9e3bc79715290b4e6a21e3f64c66f2ff9a
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9087
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Create a new backend for cmsis_dap driver that allows CMSIS-DAP protocol
to run over TCP/IP instead of USB.
An example implementation of the firmware for an SWD programmer that
uses this cmsis_dap_tcp protocol can be found at the link below.
https://github.com/bkuschak/cmsis_dap_tcp_esp32
Using this cmsis_dap_tcp backend with the firmware above on an ESP32-C6
programmer and STM32F401RE target shows the following performance:
- loading 96KB image to RAM: 80 KB/sec
- dumping 96KB image from RAM: 72 KB/sec
- flashing 512KB image completes in about 13.5 seconds (including erase,
program, and verify).
Change-Id: I6e3e45016bd16ef2259561b1046788f5536b0687
Signed-off-by: Brian Kuschak <bkuschak@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8973
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
STM32U37/U38x devices have 1Mb flash (split into pages of 4 Kb)
Note: add wait for the BSY bit to be cleared in FLASH_SR
Change-Id: I8208aa81951b9e2f7b0a6bbfce3f7c8ad0f78ade
Signed-off-by: HAOUES Ahmed <ahmed.haoues@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8874
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Adds documentation entry for newly added possibility to program
ATSAMV family embedded flash signature area page.
Change-Id: I3bbaba304868dca49d6dd7006276d2d3a95facad
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/9096
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Embedded flash also has a user signature area. This is a 512
bytes large page whose data are not erased by asserting ERASE pin or by
software ERASE command. It may be used to store configuration, keys,
trimming values etc.
This commit adds option to access this area from OpenOCD.
Change-Id: If870aa85938b9cccd94f958dd1f3d93dbdf779f0
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8302
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Drop some useless initialization in the driver.
Replace a constant value returned through a variable with the
value itself.
Change-Id: I7b7c0b30c6d36e9763ff78bf826742792546fa7f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9095
Tested-by: jenkins
Reviewed-by: Matthias Jentsch <info@easydevkits.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
The newly merged driver ch347 triggers two new scan-build warnings
about dead assignment to variables.
Fix them.
Change-Id: Ided14272c3573be1498584e68ac4653cde029f31
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 7d0e125896 ("jtag/drivers: Add support for CH347-based JTAG adapters")
Reviewed-on: https://review.openocd.org/c/openocd/+/9094
Tested-by: jenkins
Reviewed-by: Matthias Jentsch <info@easydevkits.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
With gcc 15.2.1 we get the following error:
'calloc' sizes specified with 'sizeof' in the earlier argument and
not in the later argument.
Change-Id: Ib34d758bc09d34d86d29dd02ea9c7f05b1e83327
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/9014
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Move the configuration files into a dedicated vendor folder as required
by the developer guidelines.
Change-Id: I5bf048f2d8d0fccbcfe40e0a0e7b30dfbab192d1
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9082
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Signal handlers currently violate both C language and POSIX requirements:
1. To avoid undefined behavior (UB), variables accessed or modified by
signal handlers be of atomic lock-free type.
2. The respected variables should be marked as volatile.
3. Signal handlers may only call a very limited subset of standard
library functions.
4. Additionally, POSIX restricts signal handlers to signal-safe
functions.
This patch addresses the first two issues by changing the type of global
variables that are accessed inside signal handler to `sig_atomic_t` and
adding `volatile` qualifiers.
Items 3 and 4 must be handled separately but are outside the scope of
this change.
Change-Id: I9c344e87bab9eefe7d99b0aad300a3ef4712df51
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8927
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Chris Head <chead@zaber.com>
Processors.
QCS6490 and QCM6490 are 6nm processors designed for enterprise and IOT
applications featuring global 5G and Wi-Fi 6E support with similar
architecture.
This configuration file will allow debugging applications on these
processors.
Verified with Olimex(ARM-USB-OCD-H):
openocd -f tcl/interface/ftdi/olimex-arm-usb-ocd-h.cfg
-c 'transport select jtag'
-f <path_to_qcs6490_cfg>
and Jlink:
openocd -f tcl/interface/jlink.cfg
-c 'transport select jtag'
-f <path_to_qcs6490_cfg>
Change-Id: I05e923293134eaa9b70d3cf0d18efac9a024b6c7
Signed-off-by: Ashi Gupta <quic_ashig@quicinc.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8615
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
On Windows 11, if select() is called with empty sets, it fails and
returns WSAINVAL. On POSIX this works fine.
This patch addresses it by detecting this case in OpenOCD replacements
and returning 0 in these cases.
This fixes OpenOCD crash on Windows if no services are enabled
(gdb server, tcl server and telnet server all disabled).
Change-Id: I601878671caf4ae44e105d6a819251d2d96c607c
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9081
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>