aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2024-02-11jtag/drivers: fix reset logic handling in OpenJTAGN S1-7/+11
The OpenJTAG driver behaviour always forces a system reset on jtag_init. The driver was incorrectly assuming that when execute_reset is called with trst set to 1 - perform a software TAP reset, otherwise perform a system reset when trst is 0. The set_state call assumes the that OpenJTAG hardware will perform a software TLR reset if the target state is TAP_RESET. This is not the case: the published VHDL will simply find the shortest path to TLR and not perform a fixed 5 cycle operation with TMS held high. Fix the code to only perform system resets when srst is 1 in execute_reset and to force a software TAP reset operation in set_state when the target state is TAP_RESET. Change-Id: I7e0f76f8491efefff1ccaeb4b1ae16e722d76df4 Signed-off-by: N S <nlshipp@yahoo.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8121 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-02-11jtag/drivers: OpenJTAG standard variant perf improvementN S1-1/+12
Calculate exact size of response expected from OpenJTAG device so that openjtag_buf_read_standard doesn't spend 5 retry cycles waiting for data that isn't coming. Change-Id: Icd010d1fa4453d6592a1f9aed93fb1f01e0a19da Signed-off-by: N S <nlshipp@yahoo.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8101 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-02-11jtag: fix jtag configure command containing eventsAntonio Borneo1-1/+1
Commit ea2e26f7d521 ("jtag: rewrite jim_jtag_configure() as COMMAND_HANDLER") breaks the option -event if it is the last of the command line. This can be tested, even without any device connected, through: #> openocd -f board/ti_cc26x0_launchpad.cfg wrong # args: should be "-event <event-name> <event-body>" Fix the check on available arguments after -event. Change-Id: Iec1522238f906d61a888a09a7685acd9ac6442a7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reported-by: Lorenz Brun <lorenz@brun.one> Fixes: ea2e26f7d521 ("jtag: rewrite jim_jtag_configure() as COMMAND_HANDLER") Reviewed-on: https://review.openocd.org/c/openocd/+/8125 Tested-by: jenkins Reviewed-by: Lorenz Brun <lorenz@brun.one>
2024-02-11helper/log: report the file in `log_output` commandEvgeniy Naydanov1-21/+18
Prior to the change when calling `log_output` without any arguments it was unclear where the log was redirected. Change-Id: Iaa3ecea8166f9c7ec8aad7adf5bd412799f719a1 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8071 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-02-11jtag/mpsse: mpsse_flush should not treat LIBUSB_ERROR_INTERRUPTED as an errorParshintsev Anatoly1-14/+9
LIBUSB_ERROR_INTERRUPTED can happen when (among other things) OpenOCD process receives a signal like SIGHUP or SIGINT during a call to libusb. Such situations are expected and should not be treated as an error - the affected request should just be restarted. Without this patch applied if a signal arrives during FTDI initialization procedure we can easily end up (if JTAG speed is low) in situations like https://review.openocd.org/c/openocd/+/4767. This happens because fpsse_flush fails due to LIBUSB_ERROR_INTERRUPTED . It should be noted that the current usage of mpsse_flush should be revised since it seems that we don't always process error codes returned by the function. Change-Id: Ifa063ce828068f8d0371e1c2a864bb6174649848 Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7769 Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-02-11jtag/drivers: Add vid_pid command to OpenJTAGN S1-0/+18
Enable support for USB vid and pid combinations other than 0x0403/0x6001 on OpenJTAG adapters. Change-Id: Ibb5fb14a6f33abbc011dbf3179df20d79ed74a7a Signed-off-by: N S <nlshipp@yahoo.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8100 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-02-11target/cortex_m: fix couple of commentsTomas Vanek1-8/+6
Fix obsoleted references to Cortex-M3 from the time when M3 was the only supported Cortex. Fix typo. Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: I6f93265f1b9328fec063fecd819210deb28aaf2c Reviewed-on: https://review.openocd.org/c/openocd/+/8099 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-02-11target/cortex_m: drop useless target_halt() callTomas Vanek1-27/+4
In 2008 the commit 182936125371 ("define resetting the target into the halted or running state as an atomic operation.") introduced the target_halt() call to the end of cortex_m3_assert_reset(), Checkpatch-ignore: GIT_COMMIT_ID A year later the commit ed36a8d15dfd ("... Updated halt handling for cortex_m3") prevented cortex_m3_halt() take any action in case of TARGET_RESET state. This narrowed the target_halt() called from cortex_m3_assert_reset() to setting target->halt_issued and storing a time stamp. Introducing ocd_process_reset(_inner) made the setting of halt_issued and halt_issued_time useless. The Tcl function waits for halt of all targets if applicable. cortex_m_halt() and also target_halt() does not work as expected if the cached target state is TARGET_RESET (although the core could be out of reset and ready to be halted, just have not been polled). Explicit Tcl arp_poll must be issued in many scenarios. Remove the useless hack. Also remove the explicit error return from cortex_m_halt_one() in case of RESET_SRST_PULLS_TRST and asserted srst. If the communication with the target is gated by any reset, cortex_m_write_debug_halt_mask() fails. Propagate the error return of this call instead. Change-Id: I0da05b87f43c3d0facb78e54d8f00c1728fe7c46 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8098 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-02-11target/cortex_m: prevent asserting reset if examine is deferredTomas Vanek1-1/+2
In a corner case when debug_ap is not available, cortex_m_assert_reset() asserts reset to restore communication with the target. Prevent to do so on targets with defer_examine, as such targets need some special handling to enable them after reset anyway. The change makes possible to handle a multicore Cortex-M SoC with an auxiliary Cortex-M core(s) switched of by default even with 'reset_config srst_gates_jtag' Change-Id: I8cec7a816423e588d5e2e4f7904c81c776eddc42 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8097 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-02-11target/riscv: free dm and target_list structuresTomas Vanek1-0/+25
Fix memory leak on exit. Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: I6a89ac0c93b11da35b90eec3abcc5b6fd5d1be68
2024-02-09Merge pull request #1013 from riscv/dm-calls-cleanupJan Matyas1-10/+11
Cosmetic cleanup of dm_*() calls in riscv-013.c
2024-02-09Merge pull request #1008 from en-sc/en-sc/from_upstreamJan Matyas20-270/+303
Merge up to 9659a9b5e28dc615dfb508d301fdd8fa426c191b from upstream
2024-02-08jtag/adapter: retype adapter_gpio_config.{gpio,chip}_numVincent Fazio5-30/+34
Previously, the gpio_num and chip_num members of adapter_gpio_config were typed as 'int' and a sentinel value of -1 was used to denote unconfigured values. Now, these members are typed as 'unsigned int' to better reflect their expected value range. The sentinel value now maps to UINT_MAX as all adapters either define an upper bound for these members or, in the case of bcm2835gpio, only operate on a specific chip, in which case the value doesn't matter. Format specifiers have been left as %d since, when configured, valid values are within the positive range of 'int'. This allows unconfigured values to display as a more readable value of -1 instead of UINT_MAX. Change-Id: Ieb20e5327b2e2e443a8e43d8689cb29538a5c9c1 Signed-off-by: Vincent Fazio <vfazio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8124 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-02-06riscv/program: Removed dead code for restoring register valuesJan Matyas2-23/+0
Function riscv_program_exec() contains code for restoring of register values after progbuf execution. This code is not used anymore by current OpenOCD, and hence removed. Related discussion can be found under: https://github.com/riscv/riscv-openocd/issues/982 Change-Id: I4c79bec081522b6fc0d16367cef51ed19a131962 Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
2024-02-06Fixes and cleanup in riscv batch and related functionsJan Matyas5-81/+88
Fixes: - Data types of address & data parameters in riscv_batch_add_*() and riscv*_fill_dm*() changed to uint64_t and uint32_t. - Corrected the comparison in riscv_batch_full(). - Corrected assertions in riscv_batch_get_dmi_read_op() and riscv_batch_get_dmi_read_data(). Cleanup: - Simplified calloc() fail handling in riscv_batch_alloc(). - Added explicit NULL assignments in riscv_batch_alloc() for clarity and readability. Don't rely on calloc(). - Removed suffix `_u64` from riscv_*_fill_dm*() since it does not have any meaning. - Renamed *dmi_write_u64_bits() to *get_dmi_scan_length() which better describes its purpose. Change-Id: Id70e5968528d64b2ee5476f1c00e08459a1e291d Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
2024-02-05Cosmetic cleanup of dm_*() calls in riscv-013.cJan Matyas1-10/+11
Cleanup, non-functional changes: - Replaced one call of low-level function dm_op() by high-level dm_read(). - Made sure that truncation of values passed to dm_* is explicit. (Added explicit casts.) Change-Id: I1d1b2f29a822b6841373f3313de2b1e96f514116 Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
2024-02-04jtag/drivers/jlink: make jlink quiet polling target in -d 3Tomas Vanek1-2/+2
Jlink driver floods the debug log by a message per one poll interval. Avoid annoying messages, change their logging level to LOG_DEBUG_IO Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: I84ea6aa9cdfd44b5985c5393519d1efb7de9530a Reviewed-on: https://review.openocd.org/c/openocd/+/8116 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2024-02-02target/riscv: set `state` and `debug_reason` in `riscv_halt_go_all_harts()`Evgeniy Naydanov1-0/+6
If targets are in a halt group, and a target in the group reaches a breakpoint, the target's state was able to remain `TARGET_RUNNING`. Addresses issue #1010 Change-Id: I734bc6da71d289c4d05b417c8bf67a7d1a56574f Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2024-01-29Merge pull request #1006 from en-sc/en-sc/break-ll-revertJan Matyas7-41/+1
Revert "break from long loops on shutdown request"
2024-01-29Merge up to 9659a9b5e28dc615dfb508d301fdd8fa426c191b from upstreamEvgeniy Naydanov20-270/+303
Change-Id: I2fda9689d3465b3d8c8f3459b1ed954cb1d70fdc
2024-01-29contrib/firmware: Change USB interruption handling for JTAG/I2C communicationsAhmed BOUDJELIDA1-0/+0
Before this change, when we send an I2C Bulk data at the same time while Jtag bitbanging functions execute, the microcontroller puts JTAG bitbanging on wait and executes all I2C bitbanging function, which causes problems like loss of Ack in DAP responses and other errors. With this commit, When I2C interruption occurs, it sets a variable to true and continues JTAG bitbanging, when it finish it executes the I2C bitbang. Change-Id: Ia80bac21f8a259f4a1176b5346bf74ed0aa6e38b Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8074 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-29jtag/drivers: Add GPIO extender configuration function to ANGIE driverAhmed BOUDJELIDA2-4/+114
Add GPIO extender initial configuration that is needed to configure some important GPIOs and ensure that the dev board is ready to work. Add i2c_write function that make a write transfer to any slave device. Give a new Product ID to ANGIE to make it different than the non programmed ANGIE. Change-Id: I0a8dacb7fe218145b7d3ed1cb75f106ed6256714 Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8072 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-29jtag/drivers: give ANGIE a new PID after renumerationAhmed BOUDJELIDA2-6/+7
Give ANGIE a new PID after renumeration to be able to distinguish the two cases (programmed and not programmed) Change-Id: I30a91d8ed2e8e261221488b98d40a027ca41da52 Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7991 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-29jtag/drivers: correct the angie_reset functionAhmed BOUDJELIDA1-5/+7
remove angie_clear_queue function from executing before the angie_execute_queued_commands function and making it at the end of the reset function. Change-Id: Id8a0664fbd5b8f9730545ce0f8f272ae0b0e7e78 Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7990 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-29contrib/firmware: Add direction control for 'SCL' i2c signalAhmed BOUDJELIDA2-0/+0
We want to keep the tri-state buffers located between the FPGA and the board, in 'Z' state until we launch an i2c connection. We launch an i2c start condition, make the SCL direction 'OUT' to start the i2c protocol and at the end of the i2c connection at the stop condition, we re-make the tri-state buffers at 'Z' state. Change-Id: Ic597a70d0427832547f6b539864c24ce20a18c64 Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7989 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-29jtag/drivers: send bitstream size to firmware via libusbAhmed BOUDJELIDA1-10/+14
Send bitstream size to firmware to initialize the GPIF count registers, since we're going to send this size via GPIF, we need to give the exact number of bytes to be sent, then the GPIF counter will decrement with every clock cycle (every byte sent) until reaching zero and stops. Change-Id: Ib4e8e0f95a6a4a95ef4888ba8a04a0ea45567f5a Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7988 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-29target/mips32: fix false positive from clangAntonio Borneo1-8/+9
clang build triggers an error for an uninitialized value of the variable 'instr'. This is a false positive, as the macro #define MIPS32_CONFIG3_ISA_MASK (3 << MIPS32_CONFIG3_ISA_SHIFT) guarantees the switch/case already covers all the possible values with cases 0, 1, 2 and 3. Silent clang by adding a useless default case to the switch. While there, fix the indentation of the switch/case accordingly to OpenOCD coding style. Change-Id: I0ae316754ce7d091dd8366bf314b8e6ee780e313 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 7de4b1202d50 ("target/mips32: add cpu info detection") Reviewed-on: https://review.openocd.org/c/openocd/+/8065 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2024-01-29target/xtensa: enable xtensa algo supportianst3-4/+23
- Add extra error checking - Cache PS; lower PS.INTLEVEL to allow breakpoint trigger (LX) - Xtensa algo support functional on LX per functional flash driver - Test on NX via manual algo validation Change-Id: Ie7cff4933979a0551308b382fa33c33c66376f25 Signed-off-by: ianst <ianst@cadence.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8075 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com> Tested-by: jenkins
2024-01-29helper/command: pass command arguments also as Jim_ObjAntonio Borneo2-0/+7
Some OpenOCD command gets fragment of TCL scripts as command-line argument, fragments that will be kept and executed later on. E.g. the command 'configure' gets the body of an OpenOCD event: $TARGET configure -event halted {TCL code} These commands store the argument as a Jim_Obj and pass it to the jimtcl interpreter when the TCL fragment has to be executed. Using Jim_Obj as storage is relevant to let the jimtcl interpreter to recover extra info of the TCL fragment, like the file-name and the line-number that contain the fragment, that will be printed out in case of run-time errors. While converting the commands to COMMAND_HANDLER, we should avoid storing the argument as C strings otherwise we will loose precious info in case of run-time errors making challenging the debugging of such TCL fragments. Extend the struct command_invocation to contain the array that points to the Jim_Obj of the command arguments. This will be used while converting commands to COMMAND_HANDLER. Change-Id: If37c5f20e9a71349f77ba1571baf1e6778e28aa5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8057 Tested-by: jenkins
2024-01-29helper/command: inline run_command() in exec_command()Antonio Borneo1-25/+18
Simplify the command execution by inlining run_command() inside exec_command(). Change-Id: Id932b006846720cfd867d22d142cd35831dbd1a2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8056 Tested-by: jenkins
2024-01-29helper/command: simplify exec_command()Antonio Borneo1-29/+9
The jimtcl interpreter guarantees that the Jim objects in argv[] are not deallocated during the command execution. Thus, there is no need to copy the string content of argv[]. Simplify exec_command() by inlining its two sub-functions and dropping the strdup(). While there, add a LOG_ERROR() for out of memory. Change-Id: I3e21ed7da50ca0bd072edbd49fca9740c81f95b0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8055 Tested-by: jenkins
2024-01-29helper/command: simplify script_command_args_alloc()Antonio Borneo1-7/+4
The output parameter nwords is always equal to the input parameter argc, when the function succeeds. Drop the parameter nwords and let the caller use directly the value in argc. While there, convert some 'unsigned' to 'unsigned int'. Change-Id: Ie3d8ce1351792f3c07fe39cdcbcd180fd24dc928 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8054 Tested-by: jenkins
2024-01-29helper/command: drop unused variablesAntonio Borneo1-4/+2
In both functions script_debug() and script_command_args_alloc() the variable len is never used, and Jim_GetString() does not mandate it. Drop the variable and pass NULL to Jim_GetString(). Change-Id: I754b27a59c6087cde729496be42609d2a7145b0c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8053 Tested-by: jenkins
2024-01-29target: drop deprecated code for mem2array and array2memAntonio Borneo2-441/+35
Commit e370e06b724f ("target: Deprecate 'array2mem' and 'mem2array''") has already replaced the deprecated root versions of commands mem2array and array2mem with TCL proc's that use 'read_memory' and 'write_memory'. It has left the deprecated code of the target's version of the commands because the effort to code the TCL replacement was not considered valuable. To drop the last jim_handler commands, I consider much easier and less error-prone to code them in TCL instead of converting the deprecated code to COMMAND_HANDLER. Drop the code in target.c and extend the TCL proc's. While there, add the TCL procs to _telnet_autocomplete_skip. Change-Id: I97d2370d8af479434ddf5af68541f90913982bc0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8052 Tested-by: jenkins
2024-01-29LICENSES: drop SPDX tag 'GPL-2.0' and use 'GPL-2.0-only'Antonio Borneo1-1/+1
The SPDX tag 'GPL-2.0' has been deprecated in https://spdx.org/licenses/GPL-2.0.html and the preferred tag is now 'GPL-2.0-only' https://spdx.org/licenses/GPL-2.0-only.html Update the LICENSES documents and the SPDX of the only file that reports the deprecated tag. Change-Id: I3c3215438bc4378ff470bb9fa8fa962505a9ae50 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8064 Tested-by: jenkins
2024-01-29target/arc: skip over breakpoints in arc_resume()Evgeniy Didin1-1/+58
When requested by the core code (handle_breakpoints = true), arc_resume() should be able to advance over a potential breakpoint set at the resume address instead of getting stuck in one place. This is achieved by removing the breakpoint, executing one instruction, resetting the breakpoint, then proceeding forward as normal. With this patch applied, openocd is now able to resume from a breakpoint halt when debugging ARCv2 targets via telnet. This has previously been committed to the Zephyr project's openocd repo (see https://github.com/zephyrproject-rtos/openocd/pull/31). Change-Id: I17dba0dcea311d394b303c587bc2dfaa99d67859 Signed-off-by: Evgeniy Didin <didin@synopsys.com> Signed-off-by: Stephanos Ioannidis <root@stephanos.io> Signed-off-by: Artemiy Volkov <artemiy@synopsys.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7817 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-01-29target/arc: restore breakpoints in arc_resume()Evgeniy Didin1-0/+36
Presently, we rely on gdb to restore break/watchpoints upon resuming execution in arc_resume(). To match this behavior in absence of gdb (more specifically, when handle_breakpoints is true), this patch explicitly re-enables all breakpoints and watchpoints in arc_resume(). This has previously been committed to the Zephyr project's openocd repo (see https://github.com/zephyrproject-rtos/openocd/pull/31). Change-Id: I59e9c91270ef0b5fd19cfc570663dc67a6022dbd Signed-off-by: Evgeniy Didin <didin@synopsys.com> Signed-off-by: Stephanos Ioannidis <root@stephanos.io> Signed-off-by: Artemiy Volkov <artemiy@synopsys.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7816 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2024-01-29target/xtensa: extra debug info for "xtensa exe" failuresianst1-6/+12
- Read and display EXCCAUSE on exe error - Clean up error messages - Clarify "xtensa exe" documentation Signed-off-by: ianst <ianst@cadence.com> Change-Id: I90ed39f6afb6543c0c873301501435384b4dccbe Reviewed-on: https://review.openocd.org/c/openocd/+/7982 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-29cortex_m: add detection of MVE feature for Armv8.1-M coresTarek BOCHKATI2-19/+34
For Armv8.1-M based cores, detect if the core implements the optional M-profile vector extension (MVE), using MVFR1 register. While at there rework armv7m->fp_feature detection based on MVFR0 and MVFR1 registers. Change-Id: I92d5b1759aea9f7561d285f46acdec51d6efb7b4 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6950 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-01-29ipdbg: improve ipdbg-host speedDaniel Anselmi1-67/+209
By queuing multiple jtag transfers the connection speed between JTAG-Host and JTAG-Hub is improved. This is due to much less calls to OS functions. An improvement of about x30 has been measured with ftdi-based jtag adapters For this to work the JTAG-Host server needs to know if flow control is enabled on the JTAG-Hub ports. This is possible with newer JTAG-Hub/JtagCDC. For old JTAG-Hubs the queuing is not enabled so this change is backwards compatible. Change-Id: I8a5108adbe2a2c1e3d3620b5c9ff77a546bfc14e Signed-off-by: Daniel Anselmi <danselmi@gmx.ch> Reviewed-on: https://review.openocd.org/c/openocd/+/7978 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-29jtag/drivers/cmsis_dap: use oocd_libusb_dev_mem_alloc() helperTomas Vanek1-23/+18
On some systems (at least Windows/CYGWIN and macOS) libusb_dev_mem_alloc() simply returns NULL. The helper can fall-back to malloc() to allocate CMSIS-DAP pending command/response buffers. Fixes: fd75e9e54270 (jtag/drivers/cmsis_dap_bulk: use asynchronous libusb transfer) Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: I89660f6747ad9d494b8192711cbbee5764e058fa Reviewed-on: https://review.openocd.org/c/openocd/+/8044 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-01-29drivers/libusb_helper: introduce oocd_libusb_dev_mem_alloc() helperTomas Vanek2-0/+79
On some systems (at least Windows/CYGWIN and macOS) libusb_dev_mem_alloc() simply returns NULL. Use the result of the very first libusb_dev_mem_alloc() call to decide if the underlining system supports dev mem allocation or we should fall-back to plain heap malloc(). From the decision time on, keep using the selected type of memory allocator and deallocator. Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: Ia1f0965cea44b4bb6d936b02ec43f5a16a46f080 Reviewed-on: https://review.openocd.org/c/openocd/+/8059 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-28target/esirisc: free memory at OpenOCD exitAntonio Borneo1-0/+40
The target esirisc does not free the allocated memory resources, causing memory leaks at OpenOCD exit. Add esirisc_free_reg_cache() and esirisc_deinit_target() and use them to free all the allocated resources. Change-Id: I17b8ebff54906fa25a37f2d96c01d010a98cffbd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8094 Tested-by: jenkins Reviewed-by: Steven Stallion <sstallion@gmail.com>
2024-01-28target: get_gdb_arch() accepts target via const pointerEvgeniy Naydanov13-15/+15
The function in question does not need to change target state. It is a target-type-dependant function, however, IMHO, it is safe to assume that any target type would not need to change type-independant state of a target to figure out the arch. Change-Id: I607cb3aee6529cd5a97bc1200a0226cf6ef43caf Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8093 Tested-by: jenkins Reviewed-by: Jan Matyas <jan.matyas@codasip.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-28target: pass target to observers via const pointerEvgeniy Naydanov2-13/+13
There are quite a lot of "getters" in target interface. They do not change target structure, nevertheless the structure is passed to these functions via a plain pointer. The intention is to clarify the purpouse of these functions by passing the `target` structure as a pointer to constant data. Change-Id: Ida4a798da94938753b86a293a308d93b091d1bf3 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8092 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-01-26Revert "break from long loops on shutdown request"Evgeniy Naydanov7-41/+1
This reverts commits 2e920a212fbe2de705811d547c169c1ae1611a02 and 8dbb1250f587484774752e8610f04a98157ca10a. The reason is, after `openocd_is_shutdown_pending()` becomes true, arbitrary command may be executed: * In `target_destroy()` and the corresponding `target->type->deinit_target()`. * In user-specifyed `pre_shutdown_commands` list. Change-Id: Icd00d1d954cd45e255880a6f76c3a74c098d6a17 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2024-01-25Merge pull request #997 from en-sc/en-sc/priv-accessJan Matyas2-9/+14
target/riscv: move read redirection for `priv` to `riscv-013.c`
2024-01-25Merge pull request #1002 from en-sc/en-sc/arch-stateJan Matyas1-0/+8
target/riscv: report info about target during `poll`
2024-01-25Merge pull request #995 from en-sc/en-sc/ctx-fixJan Matyas2-5/+9
target/riscv: cleanup `get_riscv_debug_reg_ctx()`
2024-01-24target/riscv: report info about target during `poll`Evgeniy Naydanov1-0/+8
Addresses issue #196. Change-Id: I71146c7bc769cb9727e57da33e9f514eedef9ce4 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>