aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
6 daysMerge pull request #1267 from en-sc/en-sc/from_upstreamHEADlatestriscvEvgeniy Naydanov98-1215/+2274
Merge up to afbd01b0a46f3a81fe6076c002ad66973dcfb64c from upstream
10 daysMerge pull request #1274 from en-sc/en-sc/add-more-info-in-sample-memoryEvgeniy Naydanov1-2/+2
target/riscv: improve error messaging in case `sbasize` is zero
2025-08-06target/riscv: fix get mode filed for vsatp and hgatpMark Zhuang1-2/+4
Add the necessary get_filed and add a comment to indicate this section is for VU/VS mode
2025-08-06target/riscv: fix address translation in hypervisor modezhefan.lv1-17/+0
address translation don't need to care hstatus.HU
2025-07-07target/riscv: improve error messaging in case `sbasize` is zeroSriram Shanmuga1-2/+2
From: Sriram Shanmuga <sriramharshalee@gmail.com> RISC-V Debug Specification v1.0 [3.14.22. System Bus Access Control and Status (`sbcs`, at 0x38)] states in `sbasize` field description: > Width of system bus addresses in bits. (0 indicates there is no bus access support.) Before the patch, the error message did not include the information about `sbcs.sbasize` being zero wich made it quite undescriptive: ``` [riscv.cpu] Turning off memory sampling because it failed. ``` Fixes #1270 Change-Id: I5402dd57dc9a81f65ee4c67d24e11c366006427c Signed-off-by: Sriram Shanmuga <sriramharshalee@gmail.com> Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2025-06-12target/riscv: check nextdm address in abits rangeMark Zhuang1-0/+7
When abits not correctly configured, we hope to detect it as soon as possible.
2025-05-05Merge up to afbd01b0a46f3a81fe6076c002ad66973dcfb64c from upstreamEvgeniy Naydanov98-1215/+2274
Change-Id: I719167dc34a1a29ae32f8d4f27f2d3cd7a04e47b
2025-05-01stlink: simplify the use of deprecated HLA transportAntonio Borneo1-1/+6
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.: openocd -f interface/stlink-hla.cfg -f board/st_nucleo_f4.cfg 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
2025-05-01transport: allow transport name jtag/swd for hla and dapdirectAntonio Borneo1-29/+64
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
2025-05-01transport: store the transports sorted by alphabetic name orderAntonio Borneo1-3/+9
While this operation has no real interest so far, it will be used later to avoid listing twice protocols with the same name. Change-Id: I59f3634830f94dc992d28863cf29d5d869726918 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8685 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-05-01transport: use helper/list.h for the list of transportsAntonio Borneo2-8/+11
No behavioral change, just use the list's helpers. Change-Id: I69712648ef77689bfe6acc4811adad7293fb9009 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8684 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2025-05-01transport: validate the transport id's from the driverAntonio Borneo1-10/+26
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>
2025-05-01adapter: use bitmask for driver's transportsAntonio Borneo46-113/+129
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. Change-Id: I4976583f1a38fdcc1f85045023dc7c629001f743 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8675 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-05-01transport: use a bitmask for the transportAntonio Borneo7-31/+102
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. Change-Id: I6bdf7264d5979c355299f63fcf80bf54dcd95cee Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8674 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-05-01transport: deprecate auto-selection of transportAntonio Borneo1-3/+20
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
2025-05-01adapter: list supported transports beside adapter nameAntonio Borneo1-1/+13
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
2025-05-01adapter: replace 'interface' with 'adapter driver'Antonio Borneo1-9/+8
Comments and output strings still reference the term 'interface', while 'adapter driver' should be used. While there, drop the useless test if CMD_ARGV[0] is an empty string, as this is not possible when CMD_ARGC > 0. Change-Id: I7b46b5dd3cec53d8b5b7559d941ee9ae3bd1d89b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8808 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-05-01target: stm8: drop include file stm8.hAntonio Borneo3-66/+47
The file stm8.h is only included by stm8.c and provides some basic declaration that can be simply part of the C file. Drop the file stm8.h and move its content in stm8.c Replace the macro 'STM8_NUM_CORE_REGS' with the existing macro 'STM8_NUM_REGS'. While there: - drop the useless include of "hello.h". Change-Id: Iecd1a27f0630cdbbfd51033d34aa3d468aa63464 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8856 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-04-25flash/nor/rp2xxx: define macro BOOTROM_MAGIC_MASKTomas Vanek1-1/+2
and use it instead of magic value. Change-Id: I5d006aaf990d4ef3a82e622b1e41cd2bfec359f7 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reported-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8810 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2025-04-25flash/nor/rp2xxx: fix LOG_xxx messagesTomas Vanek1-31/+32
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
2025-04-25flash/nor/rp2xxx: fix flash operation after halt in RISC-V bootselLuke Wren1-0/+47
Calling ROM API set_bootrom_stack() function allows ROM API functionality after OpenOCD halt or reset halt in RISC-V bootloder (emulated ARM code) Change-Id: I3b255738d61876e876a94207804d9cbe1a7593c2 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Luke Wren <luke@raspberrypi.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8729 Tested-by: jenkins
2025-04-25flash/nor/rp2xxx: fix endianness errorTomas Vanek1-30/+29
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
2025-04-25flash/nor/rp2xxx: drop couple of Java-like constTomas Vanek1-3/+3
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>
2025-04-25flash/nor/rp2xxx: minor code improvementsTomas Vanek1-15/+34
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>
2025-04-25flash/nor/rp2040: refactoring: change rp2040 to rp2xxxTomas Vanek4-58/+50
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
2025-04-25flash/nor/rp2040: refactor finalizing calls and use them after eraseTomas Vanek1-36/+42
Invalidate cache and restore flash XIP mode after erase and also in error cleanup after write/erase. Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: If7e0c2d75f50f923e6bcbf0aa7bab53fe91b6cc8 Reviewed-on: https://review.openocd.org/c/openocd/+/8454 Tested-by: jenkins
2025-04-25flash/nor/rp2040: improve flash write buffer size computationTomas Vanek1-11/+18
While on it: Define the names for the fixed flash page/sector sizes and use them instead of magic values. Fix memory leak on error return. Partially backported from former upstream rp2040.c Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: If51c912f4d381ee47756a70f616ecdbee1ac0da7 Reviewed-on: https://review.openocd.org/c/openocd/+/8453 Tested-by: jenkins
2025-04-25flash/nor/rp2040: add missing TARGET_HALTED checksTomas Vanek1-0/+22
Flash erase and write require this guard, unfortunately it is also partially needed in the flash probe. Partially backported from former upstream rp2040.c Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: Ie8a240e66c3ed68e08f872cbbfdd90a6d80e1f1e Reviewed-on: https://review.openocd.org/c/openocd/+/8452 Tested-by: jenkins
2025-04-25flash/nor/rp2040: detect flash size including SFDPTomas Vanek1-15/+286
Also keep size override by FLASHSIZE Tcl variable possible. Partially backported from former upstream rp2040.c Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: I224c3644450e8b46e35714bfc5436219ffdee563 Reviewed-on: https://review.openocd.org/c/openocd/+/8451 Tested-by: jenkins
2025-04-25flash/nor/rp2040: flash bank target switching for RP2350Tomas Vanek1-19/+58
RP2350 can switch either core to Cortex-M33 or RISC-V. The different architectures have to be supported as distinct targets in OpenOCD. Introduce 'rp2xxx _switch target' Tcl command to adapt flash bank to architecture changes. Keep the target and priv pointers intact until a flash operation is finished to prevent sudden change in the middle of write/erase. Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: I764354ab469e253042128958dfe70c09d04d6411 Reviewed-on: https://review.openocd.org/c/openocd/+/8448 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-04-25flash/nor/rp2040: allow arbitrary ROM API call from TclTomas Vanek1-0/+87
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
2025-04-25flash/nor/rp2040: allow flash size override from cfgTomas Vanek1-1/+4
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>
2025-04-25flash/nor/rp2040: Fix incorrect erase bounds calculationLuke Wren1-1/+1
when erase region does not start at 0 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>
2025-04-25flash/nor/rp2040: Avoid ROM call timeout on long erases by splitting into chunksLuke Wren1-16/+47
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>
2025-04-25flash/nor/rp2040: Fix up ROM table lookup for RP2350 A2Luke Wren1-2/+2
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
2025-04-25flash/nor/rp2040: RP2350 A1 changesgraham sanderson1-7/+4
TV: cortex_m.c changes removed. Change-Id: I85830f2d64f8afb86690737f9ae70dde5e6143e1 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: graham sanderson <graham.sanderson@raspberrypi.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8442 Tested-by: jenkins
2025-04-25flash/nor/rp2040: Add RISC-V ROM algorithm batch call supportLuke Wren1-277/+599
And add support for A1 ROM table. TV: cortex_m smp change removed. Fixed style problems. 'uint' replaced by unsigned int Change-Id: Iff2710fa0734dc7074d8d490d8fae43dc27c0c2a Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Luke Wren <wren6991@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8441 Tested-by: jenkins
2025-04-25flash/nor/rp2040: add RP2350 supportgraham sanderson1-209/+274
TV: Extracted RP2040/2350 flash driver part only. Fixed style problems. Change-Id: I88a7d5aa0a239ae93d72bd5671686b19c6ca11ad Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: graham sanderson <graham.sanderson@raspberrypi.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8440 Tested-by: jenkins
2025-04-19flash: stellaris: fix deprecated commandAntonio Borneo1-1/+1
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. Update the TCL command to the new syntax. Change-Id: I2fc9ef9a209bae1d78951e253d54164b2ac00cdd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 4d99e77419e3 ("jtag/hla: Restructure commands") Reviewed-on: https://review.openocd.org/c/openocd/+/8832 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2025-04-19flash/stm32l4x: support STM32C05/09x devicesHAOUES Ahmed2-0/+36
STM32C05/09x devices are similar to STM32C03/07x devices Change-Id: I77c803356c32f06699c14622828585609c90a136 Signed-off-by: HAOUES Ahmed <ahmed.haoues@st.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8618 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2025-04-19target: drop unused parameter to target_create()Antonio Borneo36-42/+40
The parameter Jim_Interp to the target API target_create() is not used by any target. Drop it. Change-Id: I67c492078a6c808db974505f9e297c45165f64d0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8831 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2025-04-19target: rewrite function target_configure() as COMMAND_HELPERAntonio Borneo1-209/+225
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
2025-04-19target: rewrite commands 'configure' and 'cget' as COMMAND_HANDLERAntonio Borneo1-15/+21
Rewrite only the command, but still use the old jimtcl specific code shared with 'target create'. Change-Id: Ie5e1c9eb237531121c2d143d1732cf281dfdc9ff Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8828 Tested-by: jenkins
2025-04-19target: rewrite command 'target create' as COMMAND_HANDLERAntonio Borneo1-82/+65
Rewrite only the command, but still use the old jimtcl specific code shared with 'configure' and 'cget'. Change-Id: I7cf220e494f0ebbf123f8075b1feb9251fd7f569 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8827 Tested-by: jenkins
2025-04-19target: rewrite command 'invoke-event' as COMMAND_HANDLERAntonio Borneo1-22/+18
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
2025-04-19target: don't free working areas during 'configure -chain-position'Antonio Borneo1-1/+0
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
2025-04-19list: silent scan-build false positiveAntonio Borneo1-0/+4
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
2025-04-19command: rewrite command 'capture' as COMMAND_HANDLERAntonio Borneo1-79/+34
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
2025-04-19command: rewrite command 'command mode' as COMMAND_HANDLERAntonio Borneo1-18/+14
Another step to drop jim_handler. Change-Id: I85cb567386a5aceb36aa273f8b66cbfd4a637c3f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8586 Tested-by: jenkins Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2025-04-07Merge up to 6834f022b96fb1c7f5829166578e01a0ac223cb0 from upstreamEvgeniy Naydanov29-325/+1466
Change-Id: Idaef3f5911bde237bd47d1d921acc186a06ea8f8