fallback programming without loader when resources are not available
while at there refactor reused code
(wait for interrupt and command execution)
Change-Id: I2cba0f53d3470bc324f4a72614c236cebf196f64
Signed-off-by: BOCHKATI Tarek <tarek.bochkati@st.com>
Signed-off-by: HAOUES Ahmed <ahmed.haoues@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8883
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
flash ADDRESS register is encoded in 17 bits (was 16),
so fix the cast to uint32_t
Change-Id: I13384ee8967e65890577b12a42a0eb4f1e2a7467
Signed-off-by: HAOUES Ahmed <ahmed.haoues@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8882
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
The BlueNRG-LPF has a flash size up to 512 Kb
Change-Id: I4c71b716330351004f4f2ab8bf8eac7d5bb694eb
Signed-off-by: HAOUES Ahmed <ahmed.haoues@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8881
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
With commit d8a2f6dbcf ("configure.ac: show the Amontec
JTAG-Accelerator driver in the config summary") the driver
amt_jtagaccel is now build by default on Linux.
This highlights the dependency of some include files, dependency
that is not properly managed and that can cause build failure.
The driver is queued to be dropped soon, so there is no real
interest to fix the dependencies.
Change the default so the driver is not built if the user does not
require it at configure time.
Change-Id: Ifb74e2c802abda290efbf59ca4ce02048c94e6f8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8939
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Tested-by: jenkins
By merging [1] and [2], the drivers 'xlnx-pcie-xvc' and 'linuxspidev'
are now build by default on Linux.
This highlights the dependency of some include files under subfolder
'linux' that are not installed by default in all Linux boxes.
Add the check in 'configure' for the presence of the include file
and conditionally enable the build of the driver.
Change-Id: Ie88645c3455ab07622f069a0cc7bf09d1a5a2c75
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Link: [1] 7214c8be46 ("configure: show adapter Xilinx XVC/PCIe in the configuration summary")
Link: [2] 83e0293f7b ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8935
Tested-by: jenkins
For aarch32 secure EL3
- Change target_el to 3 for SVC/ABT/IRQ/FIQ/UND/SYS for aarch32 secure
EL3
- Do not update SPSR for SYS, behavior is UNPREDICTABLE (ARMv8-A F5.1.121)
- Do not execute DRPS for SYS, behavior is UNPREDICTABLE (ARMv8-A
F5.1.51)
Change-Id: Ic1484665cd53afcccb5c20b152993a3f0407f8a2
Signed-off-by: Kevin Yang <kangyang@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/5854
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Plamena Marinova <pmarinova@hilscher.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
raspberrypi.com is the home for technical information, raspberrypi.org
is the Foundation's site (though there are intelligent redirects).
Several pages have moved around, fix these.
Also tweak a few comments for style and correctness.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Change-Id: I7f52bcc362fb213b50987e3a42866fe4a6fec883
Reviewed-on: https://review.openocd.org/c/openocd/+/8885
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
The peripheral address details have been removed from the documentation
part of the website (instead presented in the SoC datasheets).
Pi 5 GPIOs are provided by the RP1 southbridge, which requires the use
of libgpiod. The associated Linux driver for the GPIO interface must be
used when bitbashing on Pi 5, as the timing of pin state changes is not
guaranteed across the PCIe link without special treatment.
Using libgpiod, the typical maximum swclk speed is 1MHz.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Change-Id: I8b2c44ec5edd71abaa0a763ba4d4f4603a211348
Reviewed-on: https://review.openocd.org/c/openocd/+/8884
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This command allows to read non-memory mapped flash content directly
via Tcl script. The API is the same as for the 'read_memory' command
for targets.
Change-Id: I4a8d0d7ea2f778ac8f1501227b60b964c881cb84
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8634
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
This change adds a polling mechanism to the driver. When not busy
the driver issues a wait, allowing the target to advance time.
The wait period gets adjusted to match the polling setting.
Change-Id: I67f481d05d7c5ce5352b5cb97de78dbaa97d82ae
Signed-off-by: Jacek Wuwer <jacekmw8@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8221
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Enable the trace port (GPIOE) clock, otherwise the following pin
configurations have no effect.
Change-Id: I3942d2527c64340463c3b6c607addb4214f83081
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8823
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
P25Q16 can be found in the Efinix T13/20Q100F3, so that one is necessary
for jtagspi on those chips. The other ones were added for completeness.
Change-Id: Ifb6f3c6fbd23938d6fd26bce7742c3484ece130c
Signed-off-by: Matthias Breithaupt <m.breithaupt@vogl-electronic.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8223
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
The function find_file() is supposed to be called when the search
dirs in 'script_search_dirs' has already been populated.
This is not the case when the command 'ocd_find' is used in one of
the embedded scripts 'startup.tcl'. It then triggers SIGSEGV.
Check for 'script_search_dirs' and eventually skip searching in
the dirs.
Change-Id: I9e75a8739c94de72041fb64487910d60dffcb2bd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8931
Tested-by: jenkins
Tested with nRF5340 development kit.
Change-Id: I44f1ba176dd4ac491b5dccea4c4d6d6d9bfaf479
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8867
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested with nRF9160 development kit.
Change-Id: I367b869b9707bef0547b5d3575b24e19db74cd21
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8866
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Board configuration files for specific external debug adapters are not /
no longer supported.
Checkpatch-ignore: LONG_LINE_STRING
Change-Id: I0f391dfb1a2d7ceb92c2ad3e34eaeb8a85b2cdc5
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8865
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Add the old configuration files to the 'file_renaming' list in order to
ensure backwards compatibility.
Change-Id: Ia61df8e5cd8c19cee19a494635c8025e36f3f4a7
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8907
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Move board configuration files into a dedicated vendor directory as
required by the new guideline for configuration files.
Change-Id: Icbf368d7a453c82813e685d2935b186eb738c3ea
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8864
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Use the moved nordic target configuration files.
Change-Id: Ie0e2eb7f9514eedb1ae6678eeee59291856c2674
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8906
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Keep the old configuration files to ensure backwards compatibility.
Change-Id: Ia1d06b5a8a646d65f2cdc5a9415df3014a93b7d7
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8863
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Move target configuration files into a dedicated vendor directory as
required by the new guideline for configuration files.
Note that the moved files are still accessible via the old path to ensure
backwards compatibility. This works because of the extended file search in
vendor folders.
Change-Id: If3935985769dc543e8c7d72cda590c9d79303abb
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8905
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
The TCL configuration files are going to be dispatched in vendor
specific folders.
Old user configuration files will fail to find the new files to
include, so a set of fallback files reporting the deprecation
should replace the renamed files.
To prevent such enormous proliferation of fallback files, extend
the search of files in the vendor folders too.
For non-trivial renames, a dedicated table is added in the file
tcl/file_renaming.cfg to track old --> new file names.
The deprecated message is then part of the extended search.
E.g.:
old file names:
- path/to/a/certain/vendor_config_file
- path/to/a/certain/vendor-config_file
trigger search of:
- path/to/a/certain/vendor/config_file
and
- path/to/a/certain/config_file
trigger search of:
- path/to/a/certain/${vendor}/config_file
among a possible vendors list.
This is a temporarily feature that should be removed as soon as
possible to prevent clashing on files with the same name.
The names in tcl/file_renaming.cfg are for demonstration purpose
only and should be dropped when the first real entries are added.
Change-Id: If4793fef27dc570d5df4ff4d77a5e36004f394f6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8929
Tested-by: jenkins
Added support for TMS570LS1xxx series parts. This uses the existing
ti_tms570.cfg as parent.
Change-Id: I40567bfb8dc052532807df68ef3d42f8e7a8ecf4
Signed-off-by: Lucien Dufour <lucien.buchmann@dufour.aero>
Reviewed-on: https://review.openocd.org/c/openocd/+/8928
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: zapb <dev@zapb.de>
Fix endianness for cortex_r4 and cortex_r5 when inserting software
breakpoints. Because the cortex_a target is used by the cortex_r
architecture and some chips start in BE by default (e.g. TMS570)
Change-Id: I68b7fe7c4604de67fee2e64fff0fad2691659a58
Signed-off-by: Lucien Dufour <lucien.buchmann@dufour.aero>
Reviewed-on: https://review.openocd.org/c/openocd/+/8909
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
When SMP is enabled, gdb will always use the first target in the SMP
group. That doesn't work when that first target is unavailable, but
others in the SMP group are still available.
For cases where gdb expects an operation to affect the entire group (run
control, memory access), find the first available target in an SMP group
and use that.
Imported from
https://github.com/riscv-collab/riscv-openocd/pull/767
Change-Id: I4bed600da3ac0fdfe4287d8fdd090a58452db501
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8912
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This is added for future RISC-V changes. The RISC-V debug interface can
explicitly tell a debugger when a hart is unavailable. This is used for
instance when that hart is powered down (or yet to be powered up out of
reset).
Imported from
https://github.com/riscv-collab/riscv-openocd/pull/752
Change-Id: I8a062d59eea1e5b3c788281a75159592db024683
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8911
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Bernhard Rosenkränzer <bero@baylibre.com>
The numeric value '3' for the ASCII character CTRL-C is not
immediately readable, even if the lines that follow explicitly
mention CTRL-C.
Use the same macro present in `telnet_server.c` to replace the
numeric value.
Change-Id: Iaf4296b1f0e384f8122d8a4875cad17e8ddaf66a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8922
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
GDB server debug logging eat Ctrl-C when gdb user issues interrupt
in time of communication between OpenOCD and gdb.
E.g. Ctrl-C after `next` gdb command taking many
gdb remote protocol $vCont;s (steps)
Change-Id: I4a65446a9bb25a28e50566607b3dec116fa7d2cd
Suggested-by: Tim Newsome <tim@sifive.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8920
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Replace it by target_state_name() helper.
Change-Id: I720f2bf121e6fd2c6987a7e8fa9e52593888ee6c
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8918
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Since the initial commit f444c57bf2 ("arm_cti: add cti command
group") the helper handle_cti_dump() return JIM error codes.
Fix it by returning standard OpenOCD error codes.
Change-Id: Ia36b82083d213aff90fe22fcfe7fbe26172806a3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8904
Tested-by: jenkins
The API was introduced in 2008 by commit 8d73c2a9b0 ("duan ellis
target tcl work in progress") and never used.
Drop it!
Change-Id: Icbc5789f59696bd28f9d1151bc3e29f4adb74670
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8903
Tested-by: jenkins
With the rewrite of jim_handler commands as COMMAND_HANDLER, some
camelcase symbol from jimtcl are not referenced anymore in OpenOCD
code.
Drop such symbols from the camelcase whitelist.
Change-Id: I723be1820f13fe2cec7e4f0512a5e9da12889199
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8902
Tested-by: jenkins
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
Rewrite only the command, but still use the old jimtcl specific
code in arm_tpiu_swo_configure(), shared with command 'create'.
Change-Id: If2258f048403f54faf229e602d9b395b71894f97
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8900
Tested-by: jenkins
Rewrite only the command, but still use the old jimtcl specific
code in arm_tpiu_swo_configure(), shared with commands 'configure'
and 'cget'.
Change-Id: I39c69b1cdc23f7b5f875df3e15be987c715b0bcf
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8899
Tested-by: jenkins
Rewrite only the command, but still use the old jimtcl specific
code in cti_configure().
Change-Id: I29fb952a7c8148416b301cbf78b6e342979af7d3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8898
Tested-by: jenkins
Rewrite only the command, but still use the old jimtcl specific
code in dap_configure().
Change-Id: I3360884616367aae52f5b32247d9864000c53fdc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8897
Tested-by: jenkins
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
These helpers are needed by the updated RISC-V target files.
Change-Id: I5aa9f4e58eb75e1c7a1e8e0e3961725e2a915ebb
Signed-off-by: Bernhard Rosenkränzer <bero@baylibre.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8895
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
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>
The license CC-BY-4.0 is not compatible with GPLv2, but files can
be dual licensed with a GPLv2 compatible license 'OR' CC-BY-4.0.
This is the case for some file auto-generated by riscv project.
Change-Id: I4313d85a569a5e6423392129a730d1e22ef17c51
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8894
Reviewed-by: Bernhard Rosenkraenzer <bero@baylibre.com>
Tested-by: jenkins
Introduce basic testing of error-handling in target configuration
related commands.
The tests can be run via `make check` when JTAG `dummy` adapter is
enabled.
Change-Id: Id0f382046dd70007d8e696d82d2396a7ccab7a33
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8644
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
`target create` calls can get quite long and an indication what is the
option that caused the error can be helpful.
Also, there can be multiple `-event` options for different events,
therefore indicating which one is it is also helpful.
Change-Id: I5ea61437ca9705e790ed8343183883a3fdfebc80
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8861
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
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
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: 61890e3dc3 ("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>