]> www.infradead.org Git - users/borneoa/openocd-next.git/log
users/borneoa/openocd-next.git
10 hours agoconfigure.ac: Remove useless --enable-verbose-usb-io master next
R. Diez [Sun, 20 Jul 2025 08:39:02 +0000 (10:39 +0200)]
configure.ac: Remove useless --enable-verbose-usb-io

_DEBUG_USB_IO_ was not actually used anywhere.
Its last user was the old ft2232 driver removed in Nov 2016
with commit cc2d4f015f72d7c30d613b50572eb9f31fac515a
("Remove since long deprecated ft2232 driver").

Change-Id: I1a98db7c7b03a89cc9347c0a66ec2106d2168c3f
Signed-off-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9002
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agohelper/log: Rework 'debug_level' command
Marc Schink [Sun, 13 Jul 2025 07:05:40 +0000 (09:05 +0200)]
helper/log: Rework 'debug_level' command

The patch changes the following:

 - Use correct return value ERROR_COMMAND_ARGUMENT_INVALID is case an
   invalid debug level is provided.
 - Do not echo the selected debug level.
 - Remove the 'debug_level: ' prefix when the debug level is shown.
   This makes processing via Tcl easier.
 - Use command_print() in order to provide the error message to the
   caller.

Change-Id: Ida84a58c61060497fc36a1926eec7dd30c66cd72
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8996
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agotcl/board: add mikroe/clicker4-stm32f745vg
Ondřej Hošek [Sun, 13 Jul 2025 22:12:19 +0000 (00:12 +0200)]
tcl/board: add mikroe/clicker4-stm32f745vg

Add a board configuration file for the MikroElektronika Clicker 4 for
STM32F745VG (MIKROE-6331), which contains their CMSIS-DAP-compatible
on-board CODEGRIP programmer.

Place this into its own subdirectory, since MikroElektronika has quite a
few boards in their portfolio.

Change-Id: If24ca286d65e024f3c3a8522b67727e268ab0bc9
Signed-off-by: Ondřej Hošek <ondra.hosek@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8997
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agoadapter/stlink: Hide '(re)connect' message
Marc Schink [Fri, 11 Jul 2025 08:36:16 +0000 (10:36 +0200)]
adapter/stlink: Hide '(re)connect' message

Print a debug message rather than an info message because this
information is not of importance for normal users.

While at it, fix the 'EMBEDDED_FUNCTION_NAME' checkpatch issue.

Change-Id: I9d458a6dd6818fdedc488e39d2daa6d72a21b743
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8994
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agortt: Fix check for available down-channels
Marc Schink [Fri, 11 Jul 2025 12:39:45 +0000 (14:39 +0200)]
rtt: Fix check for available down-channels

The number of up-channels is erroneously checked instead of the number
of down-channels.

Change-Id: Iff5348387b3466ed66f34df81e1039918608ac77
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8995
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
10 hours agortt: Consider target endianness
Marc Schink [Tue, 8 Jul 2025 07:17:19 +0000 (07:17 +0000)]
rtt: Consider target endianness

Consider target endianness when reading control block and channel
information. Current implementation fails on big-endian devices.

Tested on TMS570 (big-endian) and on nRF52 (little-endian).

Note that in its current implementation RTT does not work properly on
TMS570 due to its missing support for background memory access.

Change-Id: Iab58804c42c85a932a750201a69ded35cebedd5d
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8993
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agoconfigure.ac: Turn parpoart-ppdev warning into an error.
R. Diez [Sun, 20 Jul 2025 10:12:36 +0000 (12:12 +0200)]
configure.ac: Turn parpoart-ppdev warning into an error.

Otherwise, it is easy to miss that configuration error.

Change-Id: I889d2c1cc0150f4d7f178daf4509f7943ebfd4de
Signed-off-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9004
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agoconfigure.ac: show the parallel port adapter in the config summary
R. Diez [Sun, 27 Jul 2025 11:20:43 +0000 (13:20 +0200)]
configure.ac: show the parallel port adapter in the config summary

Use the same processing logic as most other enable/disable options.

Change-Id: I994963fdab32a09c191f2e29620c9540136f980c
Signed-off-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9003
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agoconfigure.ac: Replace $build_dmem with $enable_dmem
R. Diez [Sun, 20 Jul 2025 14:31:52 +0000 (16:31 +0200)]
configure.ac: Replace $build_dmem with $enable_dmem

dmem uses now the standard option-handling logic,
which defines $enable_xxx instead of $build_xxx.

Change-Id: I810cf09241089b1dfbec0e2183e64f20050868be
Signed-off-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9005
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agotarget/armv8: Use 'bool' data type for cache validity flag
Marc Schink [Mon, 28 Jul 2025 07:34:39 +0000 (07:34 +0000)]
target/armv8: Use 'bool' data type for cache validity flag

The variable is already used as boolean value but has the wrong data
type.

Change-Id: Ia54cfbcdad00dc15e1181c05fb97fcbaa435bb21
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9059
Tested-by: jenkins
Reviewed-by: Richard Allen <rsaxvc@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agotarget/arvm7a: Use 'bool' data type where appropriate
Marc Schink [Mon, 21 Jul 2025 06:52:24 +0000 (06:52 +0000)]
target/arvm7a:  Use 'bool' data type where appropriate

The variables are already used as boolean value but have the wrong
data type.

Change-Id: I0f169cac83f6c4094e8d1acb2cb8f1017a96a5d8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9008
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
10 hours agotarget: Make use of str_enabled_disabled()
Marc Schink [Sun, 20 Jul 2025 11:33:38 +0000 (11:33 +0000)]
target: Make use of str_enabled_disabled()

The data type changes introduced in [1,2] lead to implicit casts from a
boolean to an integer value in the string selection between "enabled" and
"disabled".

Use str_enabled_disabled() to get rid of this implicit cast.

[1] https://review.openocd.org/c/openocd/+/8988
[2] https://review.openocd.org/c/openocd/+/8992

Change-Id: Ia98abdd43b42f394f5bf0aa845017dfbb0e087fd
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9007
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agotarget: Use 'bool' data type for {i,d_u}_cache_enabled
Marc Schink [Wed, 9 Jul 2025 12:06:59 +0000 (12:06 +0000)]
target: Use 'bool' data type for {i,d_u}_cache_enabled

The variables are already used as boolean value but have the wrong
data type.

Change-Id: Ia4c63d04fdd61bfd48e353fde9984b0e6cefbd8b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8992
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agotarget/cortex_a: Use 'bool' data type in cortex_a_mmu_modify()
Marc Schink [Wed, 9 Jul 2025 11:45:23 +0000 (11:45 +0000)]
target/cortex_a: Use 'bool' data type in cortex_a_mmu_modify()

The variables are already used as boolean value but have the wrong
data type.

Change-Id: Ia1660751063993fcf46c86246e93a75089629ab5
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8991
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
10 hours agotarget/cortex_a: Use 'bool' data type for cortex_a_*_memaccess()
Marc Schink [Tue, 8 Jul 2025 13:52:43 +0000 (13:52 +0000)]
target/cortex_a: Use 'bool' data type for cortex_a_*_memaccess()

Use 'bool' because it is the appropriate data type.

Change-Id: I543b153fe5f6af4d20988b95eb17f2357e706a76
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8990
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agotarget: Use 'bool' data type in mmu()
Marc Schink [Wed, 9 Jul 2025 11:37:30 +0000 (11:37 +0000)]
target: Use 'bool' data type in mmu()

The variable is already used in some parts of the code as boolean value
but have the wrong data type.

Change-Id: I50ccbf84c6f33a3034de989789c6b17312458ea8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8989
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
10 hours agotarget: Use 'bool' data type for 'mmu_enabled'
Marc Schink [Wed, 9 Jul 2025 11:31:37 +0000 (11:31 +0000)]
target: Use 'bool' data type for 'mmu_enabled'

The variables are already used in some parts of the code as boolean
value but have the wrong data type.

Change-Id: I2c4955a6ed463fabf63a1dbd79145cb63bc7a99c
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8988
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 hours agohelper: Add string_choices.h
Marc Schink [Sun, 20 Jul 2025 11:12:57 +0000 (11:12 +0000)]
helper: Add string_choices.h

Add the helper function str_enabled_disabled() to select between the two
strings 'enabled' and 'disabled' depending on a boolean value.

Additional functions for frequently used strings can be added in the future
if required.

Change-Id: I2d8ae96b141f87966836e6e4c3a2ed6d12b71fa5
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9006
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 days agoadapter/xds110: Hide '(dis)connected' message
Marc Schink [Tue, 8 Jul 2025 07:57:27 +0000 (07:57 +0000)]
adapter/xds110: Hide '(dis)connected' message

Print a debug message rather than an info message because this
information is not of importance for normal users.

Change-Id: Ie91565df455ffc0bfe976d1782dd4318bfd2d30b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8986
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 days agotcl: add support for stm32mp2xx targets and boards
Antonio Borneo [Fri, 4 Jul 2025 14:37:38 +0000 (16:37 +0200)]
tcl: add support for stm32mp2xx targets and boards

Add support for the targets stm32mp21x, stm32mp23x and stm32mp25x.
Add support for the boards stm32mp235f-dk and stm32mp257f-dk.

The board stm32mp215f-dk has no configuration file as it only
provides a generic JTAG/SWD connector for the stm32mp21x SoC.

Change-Id: I0256bebd8a5d5600066d8ae191d83344a35d3d37
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8985
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
8 days agotcl: stm32mp15x: modify handshake to open debug port, add hwthread
Antonio Borneo [Fri, 4 Jul 2025 14:34:29 +0000 (16:34 +0200)]
tcl: stm32mp15x: modify handshake to open debug port, add hwthread

Align the target script to the handshake implemented in the latest
version of stm32wrapper4dbg to get access to the debug port.

Use hwthread with the SMP node.

Allow ignoring/masking some CPU from the configuration with the
variables EN_<cpu>.

Change-Id: I7117dd7df20b4f6b6e28f911e3e91ee763bdd200
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8984
Tested-by: jenkins
8 days agotcl: stm32mp13x: modify handshake to open debug port
Antonio Borneo [Fri, 4 Jul 2025 14:29:47 +0000 (16:29 +0200)]
tcl: stm32mp13x: modify handshake to open debug port

Align the target script to the handshake implemented in the latest
version of stm32wrapper4dbg to get access to the debug port.

Change-Id: Ia1c7773330fda776abb4385331fddbf431d11c39
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8983
Tested-by: jenkins
8 days agotcl: move STM32 MPU files in vendor folder
Antonio Borneo [Fri, 4 Jul 2025 14:50:46 +0000 (16:50 +0200)]
tcl: move STM32 MPU files in vendor folder

Move the existing files for STM32MP13x and STM32MP15x in the
folder "st".
Rename the board files using the correct names.
While there, add the missing URL to one of the boards.

Change-Id: If8b92f55e3390ebc75df6a2ea09fcf798ea0b8cf
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8982
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
8 days agotcl: add microchip's pic64gx curiosity config
Liam Fletcher [Mon, 26 May 2025 09:42:56 +0000 (10:42 +0100)]
tcl: add microchip's pic64gx curiosity config

Microchip's PIC64GX Curiosity Board has a RISC-V core complex with 4
application processors and one monitor processor. The Curiosity kit also
has an on-board debug interface based around an FTDI 4232H device.

This patch adds basic target, interface and board support for PIC64GX
Curiosity Kit.

Change-Id: I2234d8725744fbae00b3909773b370e5c18debd8
Signed-off-by: Liam Fletcher <liam.fletcher@microchip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8878
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 days agotcl: add embedded flashpro5 config
Liam Fletcher [Mon, 26 May 2025 09:54:40 +0000 (10:54 +0100)]
tcl: add embedded flashpro5 config

To support Microchips Embedded Flashpro5

Change-Id: I7861e0772fd4cbf0539725d238c59ae15bbcca41
Signed-off-by: Liam Fletcher <liam.fletcher@microchip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8879
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
8 days agotarget: add microchip polarfire soc config
Liam Fletcher [Mon, 26 May 2025 09:30:07 +0000 (10:30 +0100)]
target: add microchip polarfire soc config

Microchip's PolarFire SoC has a RISC-V core complex with four
application processors and one monitor processor. This basic
configuration can be used to attach to all proccessor's or a single
processor, specified by the run-time argument $COREID

It can be used with most FTDI based debug interfaces and has been tested
with interface/ftdi/olimex-arm-usb-tiny-h.cfg.

Change-Id: I75dd965f1ce550807706d00fe17de887d36f0b02
Signed-off-by: Liam Fletcher <liam.fletcher@microchip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8877
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 days agojtag: drivers: xlnx-axi-xvc: Add support for Xilinx XVC over direct bus interface...
Nicolas Derumigny [Tue, 5 Nov 2024 15:49:04 +0000 (15:49 +0000)]
jtag: drivers: xlnx-axi-xvc: Add support for Xilinx XVC over direct bus interface (AXI)

This change allow to use direct mapping of the JTAG interface using
Xilinx Virtual Cable (XVC) over AXI. This merges the existing XVC PCIe
code and the patch proposed by Jeremy Garff
(https://review.openocd.org/c/openocd/+/6594).

This is useful when using on a Zynq/ZynqMP/uBlaze host with direct
access to the debug bridge over AXI.  You can then use the debug bridge
Xilinx IP (AXIXVC) to debug a remote device.

Signed-off-by: Nicolas Derumigny <nicolas.derumigny@inria.fr>
Change-Id: I934591b489e30b400b87772b1437e6030440904c
Reviewed-on: https://review.openocd.org/c/openocd/+/8595
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 days agodriver: jtag: rename xlnx-pcie-xvc to xlnx-xvc
Nicolas Derumigny [Mon, 30 Jun 2025 09:21:18 +0000 (11:21 +0200)]
driver: jtag: rename xlnx-pcie-xvc to xlnx-xvc

Rename xlnx-pcie-xvc.c to xlnx-xvc.c in provision for AXI support

Signed-off-by: Nicolas Derumigny <nicolas.derumigny@inria.fr>
Change-Id: I287fdcb8edf97f48c6f8614ac4c456f8ba197011
Reviewed-on: https://review.openocd.org/c/openocd/+/8980
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
3 weeks agoflash/nor/stm32l4x: fix permanent write protection on STM32U5
Tomas Vanek [Thu, 3 Jul 2025 04:52:29 +0000 (06:52 +0200)]
flash/nor/stm32l4x: fix permanent write protection on STM32U5

Unlike other devices supported by this driver STM32U5 devices
have a new UNLOCK bit in FLASH_WRP1AR, WRP1BR, WRP2AR, WRP2BR
registers. Writing zero to this bit makes the write protection
block permanent with no way to unprotect.

Commit 6554d176e926 ("flash/stm32l4x: support STM32U59/U5Ax devices")
and later commits with additional U5 devices lack support for
the UNLOCK bit and therefore makes write protection permanent
without warning.

Introduce the new bit flag F_WRP_HAS_LOCK and mark U5 devices by it.
Set UNLOCK bit in stm32l4_write_one_wrpxy() if F_WRP_HAS_LOCK is set.

Change-Id: I26b97d855e094a21540e3377f367520683af2eac
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8981
Tested-by: jenkins
4 weeks agotarget/arm_adi: add URLs of latest ARM ADI spec
Tomas Vanek [Fri, 3 Jan 2025 17:23:07 +0000 (18:23 +0100)]
target/arm_adi: add URLs of latest ARM ADI spec

While on it warn about screwed SWD diagrams in ADI spec
and add reference to a SWD timing diagram.

Change-Id: I628d707ebf8ce7c22ba19bdcfd06028d4eaa60f8
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8690
Tested-by: jenkins
4 weeks agojtag/swd: extend ap_delay_hint parameter comments
Tomas Vanek [Fri, 3 Jan 2025 14:04:43 +0000 (15:04 +0100)]
jtag/swd: extend ap_delay_hint parameter comments

Assure that zero is passed in ap_delay_hint in case of DP r/w.

Change-Id: I5cd53b99950a7f1398b88f7394b3e66530803479
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8689
Tested-by: jenkins
4 weeks agotcl/board/ti_*_swd_native.cfg: Add explicit transport info
Nishanth Menon [Mon, 23 Jun 2025 17:41:04 +0000 (12:41 -0500)]
tcl/board/ti_*_swd_native.cfg: Add explicit transport info

We use swd emulation in direct memory operations. Instead of relying
on deprecated autoselect of transport, explicitly state swd as
transport scheme.

Change-Id: Iec7e2ad18edd365992cd7ba88558494bccf49fd2
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8975
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
4 weeks agoconfigure.ac: show the dmem adapter in the config summary
R. Diez [Sat, 21 Jun 2025 19:41:38 +0000 (21:41 +0200)]
configure.ac: show the dmem adapter in the config summary

Also enable this adapter by default (auto).

Change-Id: I61597c8572115f838ab0c92021163436eb7b0d59
Signed-off-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8971
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
4 weeks agojtag/drivers: dmem: fix build on Linux 32 bits
Antonio Borneo [Sun, 22 Jun 2025 09:03:41 +0000 (11:03 +0200)]
jtag/drivers: dmem: fix build on Linux 32 bits

On 32 bits machine both 'uintptr_t' and pointers are 32 bit.
The cast
(volatile uint32_t *)((uintptr_t)dmem_emu_virt_base_addr + addr)
fails with error
error: cast to pointer from integer of different size
[-Werror=int-to-pointer-cast]
in lines 100 and 109 because:
- 'addr' is a 'uint64_t';
- adding 'uintptr_t' and 'uint64_t' returns a 64 bit value;
- cast the 64 bit to 'uint32_t *' is an error.

In the code the value passed to 'addr' is always 32 bit wide, so
there is no need to pass it as 'uint64_t'.

Change the type of 'addr' to 'uint32_t'.
Fix also some format string to fit both 32 and 64 bits machines.

Change-Id: I90ff7cd3731cb24a0fc91fe7b69c532b5c698ba0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8974
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: jenkins
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
4 weeks agogdb_server: Improve info message.
Tim Newsome [Thu, 10 Nov 2022 18:32:23 +0000 (10:32 -0800)]
gdb_server: Improve info message.

Add target name and state to "Not running when halt was requested"
message.

Imported from
https://github.com/riscv-collab/riscv-openocd/pull/763

Change-Id: Ic84e9a884b57caa270cfee0ca6fa6a0dd8e5d2bd
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8916
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 weeks agodoc: fix bp usage
Tomas Vanek [Mon, 26 May 2025 05:54:05 +0000 (07:54 +0200)]
doc: fix bp usage

Commit c8926d14579528bfcead1e179baf7cb846513db4
("cortex_a hybrid & context breakpoints") missed doc update.

Add info about settig hybrid & context breakpoints to chapter
15.5 Breakpoint and Watchpoint commands

Change-Id: I4a6fdc83a4c30ad8437c49796de8e6d8c6375c0c
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8934
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
4 weeks agoflash/nor/rp2xxx: save ACCESSCTRL over ROM API calls
Tomas Vanek [Wed, 18 Jun 2025 10:01:08 +0000 (12:01 +0200)]
flash/nor/rp2xxx: save ACCESSCTRL over ROM API calls

Especially after the flash probe (used in gdb-attach event)
we need to completely restore the original security state to allow
'resume' or gdb 'continue' without injecting strange errors
to application code.

Save all ACCESSCTRL registers potentially changed by triggering CFGRESET.
Restore them at cleanup.

Fixes: commit ea775d49fc71 ("flash/nor/rp2040: add RP2350 support")
Change-Id: I964886d5b1d0269497c343811ee4dcd5c31953db
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8961
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 weeks agoflash/nor/rp2xxx: save security state over target algo
Tomas Vanek [Wed, 18 Jun 2025 07:44:03 +0000 (09:44 +0200)]
flash/nor/rp2xxx: save security state over target algo

RP2040 and RP2350 flash driver runs a ROM API target algorithm
in probe to setup QSPI command interface. The Cortex-M33 core
of RP2350 has to be in secure mode with SAU and MPU switched off
to ensure ROM API call working properly.

Especially after the flash probe (used in gdb-attach event)
we need to completely restore the original security state to allow
'resume' or gdb 'continue' without injecting strange errors
to application code.

Use cortex_m support to set secure mode and to restore it back.

Fixes: commit ea775d49fc71 ("flash/nor/rp2040: add RP2350 support")
Change-Id: I72096bfecbb45a8aa4d3a7a37ad140532b3b00b2
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8960
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 weeks agotarget/cortex_m: introduce security manipulation routines
Tomas Vanek [Tue, 17 Jun 2025 14:23:12 +0000 (16:23 +0200)]
target/cortex_m: introduce security manipulation routines

Running target algorithms on ARMv8M may require core in secure
mode with SAU and MPU off (as set after reset).

cortex_m_set_secure() forces this mode with optional save of
the previous state.

cortex_m_security_restore() restores previously saved state.

Change-Id: Ia71826db47ee7b0557eaffd55244ce13eacbcb4b
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8959
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 weeks agoconfigure.ac: rename M4 macro 'adapter' to prevent accidental conflicts
R. Diez [Sat, 21 Jun 2025 20:05:17 +0000 (22:05 +0200)]
configure.ac: rename M4 macro 'adapter' to prevent accidental conflicts

Also remove a comment about such a conflict which had been already noticed.

Change-Id: I6f301ccbd1261ea1c15c44a02d3f34f0cf5cb9f4
Signed-off-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8972
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
4 weeks agohelper: types: fix proper return type in example of ARRAY_SIZE()
Antonio Borneo [Sat, 21 Jun 2025 10:11:24 +0000 (12:11 +0200)]
helper: types: fix proper return type in example of ARRAY_SIZE()

The example in the comment above the declaration of the macro
ARRAY_SIZE() assigns the value to a variable of type 'unsigned'
that is not allowed by the coding style (should be 'unsigned int')
and is not correct since the macro uses 'sizeof()' and the type
returned is 'size_t'.

Fix the comment.

Change-Id: I18c32b5328a229ab74b56dafab46a064ce5d23c5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8970
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
4 weeks agojtag: drivers: xlnx-pcie-xvc: use correct TMS polarity during pathmove
Henrik Brix Andersen [Wed, 11 Dec 2024 08:34:57 +0000 (09:34 +0100)]
jtag: drivers: xlnx-pcie-xvc: use correct TMS polarity during pathmove

The xlnx_pcie_xvc_execute_pathmove() function checks whether TMS
should be high or low for transitioning from the current state to the
next state, but then calls xlnx_pcie_xvc_transact() with the opposite
level, leading to invalid state transitions.

Fix the polarity of TMS in the calls to xlnx_pcie_xvc_transact() to
match the required TMS level.

Change-Id: I2383e41fb70063e26aa69fabcf728df597607934
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8613
Reviewed-by: Moritz Fischer <moritzf@google.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Nicolas Derumigny <nicolas.derumigny@inria.fr>
4 weeks agotcl/board: Add config for TMS570LS12x development kit
Marc Schink [Fri, 20 Jun 2025 09:18:03 +0000 (11:18 +0200)]
tcl/board: Add config for TMS570LS12x development kit

Tested on the corresponding hardware.

Change-Id: Ic98141c450bb981cc7853c93b38195c7930bc7d3
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8969
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 weeks agotarget/armv4: Use command_print() instead of LOG_ERROR()
Marc Schink [Fri, 20 Jun 2025 08:47:23 +0000 (10:47 +0200)]
target/armv4: Use command_print() instead of LOG_ERROR()

Use command_print() in order to provide an error message to the caller.

Change-Id: I9f1a2ef07a102e1d6e755f3680bed0f7183b5c9c
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8968
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
4 weeks agotarget/armv4: Use LOG_TARGET_xxx()
Marc Schink [Fri, 20 Jun 2025 08:44:21 +0000 (10:44 +0200)]
target/armv4: Use LOG_TARGET_xxx()

Use LOG_TARGET_xxx() for log messages as it is used for other targets.

While at it, rework the log messages. For example by removing spaces or
punctuation marks at the end of the message.

Change-Id: I295001876d40527ec8f35c2aec8d562a29e57b26
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8967
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 weeks agotarget/armv7a: Use LOG_TARGET_xxx()
Marc Schink [Fri, 20 Jun 2025 08:30:03 +0000 (10:30 +0200)]
target/armv7a: Use LOG_TARGET_xxx()

Use LOG_TARGET_xxx() to indicate which target the message belongs to.

Change-Id: Ic40c61a779c1a1ebdc96ebc56b27541fff5e6205
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8966
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
4 weeks agotarget/armv7a: Hide multiprocessing support message
Marc Schink [Fri, 20 Jun 2025 08:53:09 +0000 (10:53 +0200)]
target/armv7a: Hide multiprocessing support message

Print a debug message about missing multiprocessing support rather than
an error message.

Change-Id: Ia1581f7284747d8a92096d6f5515f891c8069f71
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8965
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 weeks agotarget/arm_dpm: Use LOG_TARGET_xxx()
Marc Schink [Fri, 20 Jun 2025 08:17:12 +0000 (10:17 +0200)]
target/arm_dpm: Use LOG_TARGET_xxx()

Use LOG_TARGET_xxx() to indicate which target the message belongs to.

While at it, rework the log messages. For example, using correct format
specifiers.

Change-Id: I05031e0ae25fe9e7bc38dfb781b6623a967fd533
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8964
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 weeks agoopenocd.c: 'init' should fail if GDB service cannot be created
Jan Matyas [Tue, 17 Jun 2025 11:17:23 +0000 (13:17 +0200)]
openocd.c: 'init' should fail if GDB service cannot be created

If it is not possible to create a GDB service for a certain target
(for example the given TCP port is already occupied), the "init"
command should fail, but it currently does not.

Fix this by checking the return code of gdb_target_add_all().

Steps to reproduce:

1) Make the port 3333/tcp occupied. For example by:

   nc -l 3333

2) In another terminal, launch OpenOCD. Use the gdb_port
   3333 (which is the default). For example:

   path/to/your/openocd \
      -c "adapter driver ..." \
      -c "jtag newtap ..."
      -c "target create ..."

3) Observe the outcome:

   Before this patch:

   Error "couldn't bind gdb to socket on port 3333: Address already in use"
   is displayed but OpenOCD keeps running.

   After this patch:

   The error message is displayed and OpenOCD exits - as expected.

Change-Id: I63c283a9a1095167b78e69e9ee879c378a6b9f2a
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8957
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 weeks agortos: sort the rtos by alphabetic order
Antonio Borneo [Sat, 14 Jun 2025 13:07:50 +0000 (15:07 +0200)]
rtos: sort the rtos by alphabetic order

Add comments to require the list of rtos to be kept sorted.

Change-Id: Iecf9250a14f6593d0a24a9f9b8930c0ec8d74bd2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8953
Tested-by: jenkins
4 weeks agotarget: use array size to constraint the loop
Antonio Borneo [Sat, 14 Jun 2025 13:02:04 +0000 (15:02 +0200)]
target: use array size to constraint the loop

Instead of using NULL terminated arrays to determine the last
element of the array, use the size of the array.

Change-Id: I3cdc0f6aef8a5110073aeef333c439e61fc54032
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8952
Tested-by: jenkins
Reviewed-by: Brandon Martin
4 weeks agotarget: sort the targets by alphabetic order
Antonio Borneo [Sat, 14 Jun 2025 12:51:43 +0000 (14:51 +0200)]
target: sort the targets by alphabetic order

Add comments to require the list of targets to be kept sorted.

Change-Id: Ie3d7e3f5d55a9f9214dc179c5c986b6682f59412
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8951
Tested-by: jenkins
4 weeks agojtag: interfaces: sort the drivers by alphabetic order
Antonio Borneo [Sat, 14 Jun 2025 12:39:37 +0000 (14:39 +0200)]
jtag: interfaces: sort the drivers by alphabetic order

Add comments to require the list of drivers to be kept sorted.
While there:
- align the check on BUILD_PRESTO and BUILD_USB_BLASTER;
- fix indentation of the closing parenthesis.

Change-Id: Ic78281b1cdfb5bf72ea41427233e76516001b429
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8950
Tested-by: jenkins
4 weeks agoflash: nand: use array size to constraint the loop
Antonio Borneo [Sat, 14 Jun 2025 11:58:38 +0000 (13:58 +0200)]
flash: nand: use array size to constraint the loop

Instead of using NULL terminated arrays to determine the last
element of the array, use the size of the array.

Change-Id: I532a51a223061348e57bae3bd66ee6b346c1b070
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8949
Tested-by: jenkins
Reviewed-by: Brandon Martin
4 weeks agoflash: nand: sort the drivers by alphabetic order
Antonio Borneo [Sat, 14 Jun 2025 11:53:50 +0000 (13:53 +0200)]
flash: nand: sort the drivers by alphabetic order

Add comments to require the list of drivers to be kept sorted.

Change-Id: I21b52cc1f5e679b0ebf7797e204248507f53557b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8948
Tested-by: jenkins
4 weeks agoflash: nor: use array size to constraint the loop
Antonio Borneo [Sat, 14 Jun 2025 12:02:25 +0000 (14:02 +0200)]
flash: nor: use array size to constraint the loop

Instead of using NULL terminated arrays to determine the last
element of the array, use the size of the array.

Change-Id: Ia3d739b0a9f201ba2e7b1d1244d60c8e5546c9c1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8947
Reviewed-by: Brandon Martin
Tested-by: jenkins
4 weeks agoflash: nor: sort the drivers by alphabetic order
Antonio Borneo [Sat, 14 Jun 2025 10:36:07 +0000 (12:36 +0200)]
flash: nor: sort the drivers by alphabetic order

Add comments to require the list of drivers to be kept sorted.

Change-Id: I57382605edc6a38d6c1ac18393421b18ae72215b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8946
Tested-by: jenkins
6 weeks agotcl/target/lsch3_common: Remove 'mem2array'
Marc Schink [Thu, 19 Jun 2025 08:28:36 +0000 (10:28 +0200)]
tcl/target/lsch3_common: Remove 'mem2array'

The 'mem2array' function is deprecated and replaced by 'read_memory'.

Change-Id: Iea54a390d67978d20dbb99ab6f7f4178dda481c2
Reported-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8962
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 weeks agojlink: add nickname support
Vitaly Cheptsov [Sun, 18 May 2025 05:49:30 +0000 (08:49 +0300)]
jlink: add nickname support

Using nicknames provides a human-readable alternative to serial
numbers for convenience purposes. Allow matching adapter serial
with device nickname.

Change-Id: I03b8d28a6c89412a825d42f4f66b3b528f217d9c
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8886
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: zapb <dev@zapb.de>
6 weeks agodoc: Fix 'add_help_text' and 'add_usage_text' usage
Marc Schink [Thu, 19 Jun 2025 21:44:23 +0000 (23:44 +0200)]
doc: Fix 'add_help_text' and 'add_usage_text' usage

Remove the quotation marks as they are used for strings and not
parameter names.

Change-Id: I7bb25eb251427e89256b73cf697d8ec5c1b401dc
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8963
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 weeks agodoc: Fix 'find' and 'ocd_find' usage
Marc Schink [Mon, 16 Jun 2025 08:04:44 +0000 (10:04 +0200)]
doc: Fix 'find' and 'ocd_find' usage

Remove the quotation marks as they are used for strings and not
parameter names.

Change-Id: Ib0629e1465f821f91cd1e837f4ef8c752013b6b7
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8955
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 weeks agodoc: Fix 'add_script_search_dir' usage
Marc Schink [Sun, 15 Jun 2025 20:44:53 +0000 (22:44 +0200)]
doc: Fix 'add_script_search_dir' usage

The 'directory' parameter is not optional.

Change-Id: Ifbc7b311692157dae0621dfa6d35a24b8fe8cbb2
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8954
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
6 weeks agotarget/cortex_m: fix debug reason after reset halt
Tomas Vanek [Sat, 14 Jun 2025 10:18:53 +0000 (12:18 +0200)]
target/cortex_m: fix debug reason after reset halt

[1] removed target_halt() from cortex_m_assert_reset()
It broke debug_reason tracking and the previous reason
was shown after reset halt.

Set debug_reason to DBG_REASON_DBGRQ during reset halt
preparation.

Fixes: [1] commit 226085065bdf ("target/cortex_m: drop useless target_halt() call")
Reported-by: Marc Schink <dev@zapb.de>
Change-Id: I685618ed158abde11f6e00eeeee1dfa8ed90952d
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8945
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
6 weeks agoconfigure.ac: show 5 ARM adapters in config summary
R. Diez [Sun, 8 Jun 2025 08:37:21 +0000 (10:37 +0200)]
configure.ac: show 5 ARM adapters in config summary

Adapters: bcm2835gpio, imx_gpio, am335xgpio, ep93xx and at91rm9200
Allow the user to enable them regardless of the target architecture.

Change-Id: I9fbc7cbefe770ea2e2239b95a3305fd29127fa85
Signed-off-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8892
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
6 weeks agotarget/armv8: update MPIDR decoding
Daniel Goehring [Tue, 18 Jan 2022 17:34:25 +0000 (12:34 -0500)]
target/armv8: update MPIDR decoding

Update MPIDR decode to support the multithreading (MT) bit.

If detected, socket, cluster, core and multithread affinity levels are
decoded and displayed.

Change-Id: I43569141fa0eef8ee8fc16c187a4af3c23e97db8
Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7190
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 weeks agojep106: update to revision JEP106BM Jun 2025
Antonio Borneo [Sat, 14 Jun 2025 07:52:57 +0000 (09:52 +0200)]
jep106: update to revision JEP106BM Jun 2025

Update to latest available document.

Change-Id: Ic1c892b42d3efbb35ad4a6c85deb17ab31ad9997
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8944
Tested-by: jenkins
7 weeks agoconfigure.ac: remove usage of obsolete Automake macro AM_PROG_CC_C_O
R. Diez [Sun, 8 Jun 2025 09:22:39 +0000 (11:22 +0200)]
configure.ac: remove usage of obsolete Automake macro AM_PROG_CC_C_O

Macro AM_PROG_CC_C_O has been obsolete since Automake 1.14,
released in June 2013 (12 years ago).

It used to check whether the C compiler supports the -c and -o options,
but that is now included in AC_PROG_CC.

Increase the minimum required Automake version to 1.14 accordingly.

Also remove the "not a GNU package" comment,
which does not really make sense.

Change-Id: I987ba8686721c7f36fba81e100f1c3ddf77f636d
Signed-off-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8942
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 weeks agocmsis-dap: Fix freeing pending transfers on close
kryvosheiaivan [Wed, 28 May 2025 13:52:42 +0000 (16:52 +0300)]
cmsis-dap: Fix freeing pending transfers on close

Freeing pending transfers on shutdown is done in openOCD
and on libusb side. This created concurrency in freeing
memory and segmentation faults:
https://github.com/libusb/libusb/issues/1627
Bug is reproduced better if many targets are laucnhed.
Bug was reproduced with CMSIS-DAP on targets:
cyw20829, psoc4, stm32l5 if launching multiple times.
Proposed working fix: if some transfers pending/in-flight
on 'shutdown' then apply libusb_handle_events_timeout_completed()
to make transfer complete. In all cases transfer completed
due to tests.

Change-Id: I44621ac6096791714910220d04614d0a19ce47bd
Signed-off-by: kryvosheiaivan <Ivan.Kryvosheia@infineon.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8876
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 weeks agoadapter: Deprecate Gateworks GW16012 driver
Marc Schink [Wed, 9 Oct 2024 09:14:21 +0000 (11:14 +0200)]
adapter: Deprecate Gateworks GW16012 driver

The adapter is not available for years now. There is also no information
about this device from Gateworks. The poor hardware availability and the
lack of users prevents testing, maintenance and adaptations to future
changes.

Mark the adapter as deprecated as a first step to give potential users
the opportunity to upgrade the hardware until the next OpenOCD release.

Change-Id: I037325a6b018b26608733a36bef30db2785858f8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8651
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 weeks agoadapter: Deprecate Amontec JTAG Accelerator driver
Marc Schink [Wed, 9 Oct 2024 09:13:42 +0000 (11:13 +0200)]
adapter: Deprecate Amontec JTAG Accelerator driver

The adapter is not available for years now and Amontec is not even a
company anymore. The poor hardware availability and the lack of users
prevents testing, maintenance and adaptations to future changes.

Mark the adapter as deprecated as a first step to give potential users
the opportunity to upgrade the hardware until the next OpenOCD release.

Change-Id: Idd9fb75588246bc39e12ea17a71435ed77f0f50b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8349
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 weeks agoHACKING: describe keeping the 'Change-Id' on new patch versions
Antonio Borneo [Tue, 3 Jun 2025 09:52:59 +0000 (11:52 +0200)]
HACKING: describe keeping the 'Change-Id' on new patch versions

We often get on Gerrit a new version of an old patch with a new
'Change-Id' value. This breaks the history of the review, adding
more work to the review process.

Describe in HACKING why the hook 'commit-msg' is required and how
to handle the 'Change-Id' on new patch versions.

Change-Id: I5c060b19f966add7422704912b38e1ab2f788e5f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8940
Tested-by: jenkins
7 weeks agotcl/board/orange_pi_zero_3: Add Orange Pi Zero 3 board
Electric Worry [Thu, 29 May 2025 10:31:59 +0000 (11:31 +0100)]
tcl/board/orange_pi_zero_3: Add Orange Pi Zero 3 board

The Orange Pi Zero 3 is an SBC that uses an Allwinner H618
SoC. As such, JTAG support is fully available, however the
SoC multiplexes JTAG function with UART1 and microSD.
Unfortunately Xunlong has used UART1 for the Wifi-BT
chip, leaving JTAG accessible only via the microSD using
a microSD breakout board (for example).

Change-Id: I0dc078cd2f3176815271917eb5e948cc8ef94525
Signed-off-by: Electric Worry <me@electricworry.net>
Reviewed-on: https://review.openocd.org/c/openocd/+/8938
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 weeks agotarget: add support for Allwinner H618 SoC
Electric Worry [Thu, 29 May 2025 09:51:59 +0000 (10:51 +0100)]
target: add support for Allwinner H618 SoC

The Allwinner H618 is an updated H616 but appears functionally
equivalent. It is used in small boards such as Orange Pi Zero 3.

Change-Id: I299a42be746189f3e8e31070aa26b83ab7d806a4
Signed-off-by: Electric Worry <me@electricworry.net>
Reviewed-on: https://review.openocd.org/c/openocd/+/8936
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 weeks agoflash/bluenrg-x: support programming without loader
HAOUES Ahmed [Tue, 27 May 2025 10:42:42 +0000 (11:42 +0100)]
flash/bluenrg-x: support programming without loader

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>
7 weeks agoflash/bluenrg-x: fix programming for devices with 512k flash
HAOUES Ahmed [Thu, 29 May 2025 09:01:20 +0000 (10:01 +0100)]
flash/bluenrg-x: fix programming for devices with 512k flash

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>
7 weeks agoflash/bluenrg-x: Support STM32WB09 AKA BlueNRG-LPF device
HAOUES Ahmed [Tue, 27 May 2025 10:34:24 +0000 (11:34 +0100)]
flash/bluenrg-x: Support STM32WB09 AKA BlueNRG-LPF device

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>
7 weeks agoflash/bluenrg-x: Add blueNRG alternate names
HAOUES Ahmed [Tue, 27 May 2025 10:22:09 +0000 (11:22 +0100)]
flash/bluenrg-x: Add blueNRG alternate names

BlueNRG-LP -> STM32WB07
BlueNRG-LPS -> STM32WB05

Change-Id: I8e05ea29e84d3a7842e145fb66f448d0c82bd004
Signed-off-by: HAOUES Ahmed <ahmed.haoues@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8880
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
8 weeks agoconfigure: hide build issue of amt_jtagaccel driver by disabling it
Antonio Borneo [Tue, 3 Jun 2025 08:34:29 +0000 (10:34 +0200)]
configure: hide build issue of amt_jtagaccel driver by disabling it

With commit d8a2f6dbcf5f ("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
8 weeks agoconfigure: fix for missing include files on Linux
Antonio Borneo [Wed, 28 May 2025 14:58:44 +0000 (16:58 +0200)]
configure: fix for missing include files on Linux

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] 7214c8be46f7 ("configure: show adapter Xilinx XVC/PCIe in the configuration summary")
Link: [2] 83e0293f7ba3 ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8935
Tested-by: jenkins
8 weeks agotarget/armv8: Handle modeswitch for aarch32 secure EL3
Kevin Yang [Mon, 12 Oct 2020 20:22:47 +0000 (13:22 -0700)]
target/armv8: Handle modeswitch for aarch32 secure EL3

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>
8 weeks agotcl: fix broken Raspberry Pi website links
Jonathan Bell [Wed, 21 May 2025 14:37:25 +0000 (15:37 +0100)]
tcl: fix broken Raspberry Pi website links

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>
8 weeks agodoc: bcm2835gpio: remove broken link and clarify usage
Jonathan Bell [Wed, 21 May 2025 14:26:20 +0000 (15:26 +0100)]
doc: bcm2835gpio: remove broken link and clarify usage

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>
8 weeks agoflash/nor/tcl: Add 'read_memory' command
Marc Schink [Sat, 23 Nov 2024 14:43:51 +0000 (14:43 +0000)]
flash/nor/tcl: Add 'read_memory' command

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
8 weeks agojtag/vdebug: implement a polling mechanism
Jacek Wuwer [Wed, 24 Apr 2024 08:15:38 +0000 (10:15 +0200)]
jtag/vdebug: implement a polling mechanism

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
8 weeks agotcl/target/stm32f4x: Enable the trace port clock
Marc Schink [Tue, 1 Apr 2025 04:34:27 +0000 (04:34 +0000)]
tcl/target/stm32f4x: Enable the trace port clock

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
8 weeks agoflash/nor/spi: add puya p25q flash devices
Matthias Breithaupt [Thu, 25 Apr 2024 14:36:20 +0000 (16:36 +0200)]
flash/nor/spi: add puya p25q flash devices

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>
8 weeks agohelper: configuration: check for empty search dirs
Antonio Borneo [Thu, 22 May 2025 00:02:19 +0000 (02:02 +0200)]
helper: configuration: check for empty search dirs

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
8 weeks agotcl/board: Add config for nRF5340 development kit
Marc Schink [Thu, 24 Apr 2025 07:51:42 +0000 (07:51 +0000)]
tcl/board: Add config for nRF5340 development kit

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>
8 weeks agotcl/board: Add config for nRF9160 development kit
Marc Schink [Thu, 24 Apr 2025 06:24:24 +0000 (06:24 +0000)]
tcl/board: Add config for nRF9160 development kit

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>
8 weeks agotcl/board: Deprecate nordic_nrf52_ftx232.cfg
Marc Schink [Mon, 21 Apr 2025 18:10:20 +0000 (18:10 +0000)]
tcl/board: Deprecate nordic_nrf52_ftx232.cfg

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>
8 weeks agotcl/board: Deprecate old nordic configuration files
Marc Schink [Mon, 12 May 2025 08:43:19 +0000 (10:43 +0200)]
tcl/board: Deprecate old nordic configuration files

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>
8 weeks agotcl/board: Move nordic configuration files
Marc Schink [Mon, 12 May 2025 08:42:11 +0000 (10:42 +0200)]
tcl/board: Move nordic configuration files

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>
8 weeks agotcl/board: Use moved nordic target files
Marc Schink [Mon, 12 May 2025 08:54:49 +0000 (10:54 +0200)]
tcl/board: Use moved nordic target files

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>
8 weeks agotcl/target: Deprecate old nordic configuration files
Marc Schink [Mon, 12 May 2025 04:53:16 +0000 (06:53 +0200)]
tcl/target: Deprecate old nordic configuration files

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>
8 weeks agotcl/target: Move nordic configuration files
Marc Schink [Mon, 12 May 2025 04:47:22 +0000 (06:47 +0200)]
tcl/target: Move nordic configuration files

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
8 weeks agostartup.tcl: extend the file search in vendor folders
Antonio Borneo [Wed, 21 May 2025 13:19:28 +0000 (15:19 +0200)]
startup.tcl: extend the file search in vendor folders

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
8 weeks agotcl/target: Add support for TMS570LS1xxx
Lucien Dufour [Tue, 20 May 2025 15:39:19 +0000 (17:39 +0200)]
tcl/target: Add support for TMS570LS1xxx

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>
8 weeks agocortex_a: Use endianness for soft breakpoints
Lucien Dufour [Thu, 15 May 2025 12:31:25 +0000 (14:31 +0200)]
cortex_a: Use endianness for soft breakpoints

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
8 weeks agortos/hwthread: use printf format specifier
Tomas Vanek [Mon, 19 May 2025 15:10:00 +0000 (17:10 +0200)]
rtos/hwthread: use printf format specifier

instead of typecast.

Change-Id: I62e3a0faebd915615f6b72a456667c49970a4091
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8926
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 weeks agortos/hwthread: Nicer debug message in hwthread_update_threads()
Tim Newsome [Sun, 18 May 2025 09:11:07 +0000 (11:11 +0200)]
rtos/hwthread: Nicer debug message in hwthread_update_threads()

Imported from
https://github.com/riscv-collab/riscv-openocd/pull/763

Change-Id: Ia5931a772476a2ae186ed87cd70d7e4be2f196fb
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8917
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins