Commit Graph

10748 Commits

Author SHA1 Message Date
Antonio Borneo 54d07de86e jtag: bitbang: drop useless typedef bb_value_t
No need to use a typedef for an enum.
Drop it.

Change-Id: I8800c95f97d2bafe27c699d7d451fb9b54286d99
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8707
Tested-by: jenkins
2025-02-16 16:22:33 +00:00
Antonio Borneo 8a5c331831 jtag: remote_bitbang: drop useless typedef flush_bool_t
No need to use a typedef for an enum.
Drop it.

Change-Id: I122784ddd7b81ccd86da258b08526685c3d70033
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8706
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2025-02-16 16:22:18 +00:00
Antonio Borneo 894a39eda3 target_request: drop useless typedef target_req_cmd_t
No need to use a typedef for an enum.
Drop it.

Change-Id: Ib5a872b52a6f3d7379d2662e4ff84f32c2bd2ef8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8705
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2025-02-16 16:22:03 +00:00
Antonio Borneo c50b541471 target: trace: drop useless typedef trace_status_t
No need to use a typedef for an enum.
Drop it.

Change-Id: I31e0e3869c7277bcb14e05cfcac82c9655963ae6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8704
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2025-02-16 16:21:48 +00:00
Antonio Borneo ff5fb8f610 target: etm: drop useless typedefs
No need to use a typedef for an enum.
Drop etmv1_pipestat_t and etmv1_branch_reason_t.

Change-Id: I03ae4de3efe699d9635fc4f162649f6bedcef4c0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8703
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2025-02-16 16:21:31 +00:00
Antonio Borneo b023c4c6c5 nor: lpc2000: drop useless typedef lpc2000_variant
No need to use a typedef for an enum.
Drop it.

Change-Id: Iec690ebf6704f346d010cad1e6c65496f7bcc218
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8702
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2025-02-16 16:21:16 +00:00
Antonio Borneo e325b482b1 target: esp_algorithm: drop useless typedefs
There is no need to use extra typedef for the functions in struct
esp_algorithm_run_data.
Declare the type of the functions in the struct.
Split the comment lines to stay in the line limits.

Change-Id: I0afa6242e57133f8bf1b13ba541abd6b067350b0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8701
Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Tested-by: jenkins
2025-02-16 16:20:58 +00:00
Antonio Borneo 4140fa2a81 drivers: rshim: drop useless typedef
Use 'struct name' instead of typedef.

Change-Id: Ifff56811f53a260c314c8f5473d368599e0912e6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8700
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2025-02-16 16:20:42 +00:00
Antonio Borneo 3e4512d62d openocd: drop useless typedef
There is no need to use typedef for the array of functions.
Drop it.

While there, move the declaration outside the function and use the
array size to drop the error-prone sentinel to NULL.

Change-Id: I424964a6ef82ed1a7b27e78fbd19aa9f985b52c7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8699
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2025-02-16 16:20:30 +00:00
Antonio Borneo 6e39af3b0e rtt: drop useless typedefs
There is no need to use extra typedef for the rtt functions.
Declare the type of the functions in the struct.

Change-Id: Idf2fee6e63ec3b3add38d042bbebe8d74613627c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8698
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2025-02-16 16:20:12 +00:00
Samuel Obuch 73e9b7898f github/workflow: build jimtcl from sources
JimTCL submodule was deprecated, this patch modifies
the GitHub snapshot action to build from sources instead.

Change-Id: Ie9ab20dbfd70506992d11a91489e82a9fa6e13ce
Signed-off-by: Samuel Obuch <samuel.obuch@espressif.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8751
Reviewed-by: Marc Schink <dev@zapb.de>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com>
2025-02-12 16:49:24 +00:00
Richard Pasek d09f53a930 driver/linuxspidev: Clear queue on allocation
SWD idle clocks are added to the queue by advancing the queue index
assuming the queue is zeroed. If the queue isn't zeroed, these idle
clocks end up being filled with junk data. Lets clear the queue and
associated buffers on queue allocation.

TEST: Connects successfully and ran the following TCL command:
  dump_image /dev/null 0x20000000 0x42000
  Host: Unnamed Qualcomm SoC with QUPv3 based SPI port
  Target: RT500

Signed-off-by: Richard Pasek <rpasek@google.com>
Change-Id: Ie660c10c27c4d0937ab0629138935ddbf5aeb0ae
Fixes: 83e0293f7b ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8730
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Jonathon Reinhart <jrreinhart@google.com>
Tested-by: jenkins
2025-02-11 11:57:58 +00:00
Tomas Vanek 82277462b9 drivers/linuxspidev: fix use of uninitialized speed variable
Valgrind reported
== Syscall param ioctl(generic) points to uninitialised byte(s)
==    at 0x4ABF990: ioctl (ioctl.S:26)
==    by 0x19D00B: spidev_speed (linuxspidev.c:181)
==    by 0x19D00B: spidev_init (linuxspidev.c:307)

Indeed, spidev_init() uses adapter_get_speed(), it calls
adapter_khz_to_speed() and it returns early without setting
the output parameter if adapter is not initialized.
Of course the adapter initialized flag is not set until
spidev_init() returns.

Simply drop this code as the adapter infrastructure initializes
adapter speed just after spidev_init() return.

Change-Id: I26f011ae59fc942a34d9bb517f467c22f735091d
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Fixes: 83e0293f7b ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8733
Tested-by: jenkins
Reviewed-by: Richard Pasek <rpasek@google.com>
2025-02-11 11:56:39 +00:00
Tomas Vanek 7dd875900e drivers/linuxspidev: fix minor memory leak
free() strduped spi_path on quit.
Found by valgrind.

Change-Id: Iaa59c7258c920b5e60d615df790dfe815831b925
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Fixes: 83e0293f7b ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8732
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Richard Pasek <rpasek@google.com>
2025-02-11 11:56:09 +00:00
Marc Schink 7f2db80ebc rtos/hwthread: Use LOG_TARGET_xxx()
Use LOG_TARGET_xxx() to indicate which target the message belongs to.

While at it, fix some coding style issues.

Change-Id: Iac0296498557a689468a4a19d0bc64f03178a0d0
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8727
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2025-02-11 11:53:59 +00:00
Sergey Matsievskiy eb6f2745b7 flash/nor: add DesignWare SPI controller driver
Driver for DesignWare SPI controller, found on many SoCs (see compatible
list in Linux device tree bindings
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml). This
implementation only supports MIPS as it was the only one available for the
tests, however, adding support for other architectures should require only
few adjustments. Driver relies on flash/nor/spi.h to find Flash chip info.
Driver internal functions support 24bit addressing mode, but due to
limitations of flash/nor/spi.h, it is not used. The reported writing speed
is about 60kb/s.
Lint, sanitizer and valgrind reported warnings were not related to the
driver.

Change-Id: Id3df5626ab88055f034f74f274823051dedefeb1
Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8400
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2025-01-31 03:25:53 +00:00
Paul Fertser ce38758e3d rtos: chibios: replace malloc+sprintf with alloc_printf
This makes it safer and simpler at the same time.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: Ie294f1f6033ffc9f46b39210e2f7fc2f648e80ac
Reviewed-on: https://review.openocd.org/c/openocd/+/8598
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2025-01-31 03:21:32 +00:00
Marc Schink a510d51a78 bootstrap: Do not set up Git submodules by default
Building OpenOCD with jimtcl and libjaylink Git submodules is deprecated
and will be removed in the upcoming releases. The remaining 'git2cl'
submodule is only required during the OpenOCD release process.

Only set up Git submodules when the 'with-submodules' argument is used,
for example during the OpenOCD release process or for the transition
period until all submodules are replaced by external dependencies.

We keep the existing 'nosubmodule' argument in order to not break
automatic testing with Jenkins.

Change-Id: Ia4fd765e3a2d6b2c40b084a1ffdf919d5f4f35bb
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8381
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
2025-01-25 16:17:00 +00:00
Marc Schink 77c904fd13 Deprecate jimtcl Git submodule
jimtcl was integrated as Git submodule for convenience and probably also
because packages were not widely available at the time. Today, jimtcl is
available in many popular package repositories [1] and the integration
as Git submodule adds unnecessary complexity to the OpenOCD build
process. For details, see the discussion on the mailing list in [2].

Disable the jimtcl Git submodule by default and announce it as
deprecated feature that will be removed in the next release. This gives
package maintainers time to adapt to the change and, if necessary,
build a package for jimtcl.

[1] https://repology.org/project/jimtcl/versions
[2] https://sourceforge.net/p/openocd/mailman/message/58786630/

Change-Id: I07930ac07f7d7a6317c08b21dc118f4f128b331c
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8380
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-01-25 16:16:26 +00:00
Antonio Borneo fceccde0b3 helper/log: Fix build using _DEBUG_FREE_SPACE_
The glibc API 'mallinfo' is deprecated and the new 'mallinfo2'
should be used from glibc 2.33 (2021-02-01).

Throw an error when '--enable-malloc-logging' is used on systems
that compile without glibc.
Detect the glibc version and, for backward compatibility, define
'mallinfo2' as the old 'mallinfo'. Define a macro for the format
of 'fordblks'.

Change-Id: I68bff7b1b58f0ec2669db0b911f19c1c5a26ed30
Reported-by: Steven J. Hill <steven.hill@konsulko.com>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8589
Tested-by: jenkins
2025-01-25 10:36:51 +00:00
Antonio Borneo 8038e2f754 configure: allow --enable-malloc-logging only with glibc
The feature for 'malloc-logging' uses functionalities that are
available only in GNU libc.

Detect in 'configure' if OpenOCD is being compiled with glibc.
Set the macro '_DEBUG_FREE_SPACE_' only in case of glibc.

Change-Id: I43e9b87c7ad47171cfe3e7c1e5f96f11e19f98d0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8592
Tested-by: jenkins
2025-01-25 10:36:28 +00:00
Antonio Borneo ac18b8cd6a configure: make more robust the check for elf 64
The check if 'elf.h' defines the type 'Elf64_Ehdr' is currently
done through 'grep' on the file. While there is no false positive,
so far, such test could incorrectly find the text inside a comment
or in a block guarded by #if/#endif.

Use the autoconf macro AC_CHECK_TYPE() to detect if the type is
properly declared.

Change-Id: Ibb74db3d90ac6d1589b9dc1e5a7ae59e47945e78
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8591
Tested-by: jenkins
2025-01-25 10:36:11 +00:00
Evgeniy Naydanov 345473f3ce helper/options: handle errors in `-l`
Before the patch an error in opening the log file (e.g. can't write a
file) was ignored when specified via `-l`.
E.g.:
```
> touch log
> chmod -w log
> openocd -l log -c shutdown
...
failed to open output log "log"
shutdown command invoked
> echo $?
0
```

After the patch:
```
...
> openocd -l log -c shutdown
...
failed to open output log "log"
> echo $?
1
```

Change-Id: Ibab45f580dc46a499bf967c4afad071f9c2972a2
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8666
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-01-25 10:34:15 +00:00
Evgeniy Naydanov 778d2dc4bb helper/options: drop redundant argument checks
In case the option is passed with a single `:` in `optstring` argument,
the call to `getopt_long()` should return `?`.

Therefore the check on `optarg` is redundand in case of `l` and `c`.

Change-Id: I1ac176fdae449a34db0a0496b69a9ea65ccd6aec
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reported-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8718
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-01-25 10:33:56 +00:00
Marek Vrbka 0b97973bfb vdebug: Fix socket comparison warning on Windows
On GCC version 13.2,
the previous code emitted the following warning on Windows:

openocd/src/jtag/drivers/vdebug.c:254:19: warning: comparison of integer expressions of different signedness: 'int' and 'long long unsigned int' [-Wsign-compare]
  254 |         if (hsock == INVALID_SOCKET)

This patch fixes it and brings it in line with other socket handling code.

Change-Id: I7e05f83c6905cfaf66b68e8988c783e80cee4a48
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8717
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Jacek Wuwer <jacekmw8@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
2025-01-25 10:33:23 +00:00
Tomas Vanek 77f9da7626 flash/nor/kinetis: fix assertion during flash write
If the device has at lest one FlexNVM bank and it is set as EE backup
only, the bank has no protection blocks.

kinetis_fill_fcf() collects protection data from all banks before
flash write of the sector containing FCF block. In case it encountered
a FlexNVM bank with no protection blocks assert failed.

Failed flash write of previously erased FCF block could cause
engaging debugging lock (if the device was run or reset).

Skip banks with zero protection blocks.
Replace assert() by LOG_ERROR() as we have to finish FCF write.

Change-Id: Ibe7e7ec6d0db4453b8a53c8256987621b809c99d
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Suggested-by: Jasper v. Blanckenburg <jazzpi@users.sourceforge.net>
Fixes: https://sourceforge.net/p/openocd/tickets/448/
Reviewed-on: https://review.openocd.org/c/openocd/+/8719
Tested-by: jenkins
Reviewed-by: Jasper v. Blanckenburg <jasper@mezzo.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-01-25 10:32:45 +00:00
Antonio Borneo 3099547069 OpenOCD: fix code indentation
Fix checkpatch errors

	ERROR:SUSPECT_CODE_INDENT: suspect code indent for
	conditional statements

Change-Id: I94d4fa5720c25dd2fb0334a824cd9026babcce4e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8497
Tested-by: jenkins
2025-01-25 10:31:06 +00:00
Antonio Borneo 8e89a8af63 target: cortex_m: add support of ARMv8.1-M register 'vpr'
The register 'vpr' is present when MVFR1.MVE is not zero.
For the moment, reuse the existing flag 'fp_feature'. To be
reviewed for the case of MVE supported without floating point.

The documentation of GDB [1] reports that the register 'vpr'
should be represented as 3 fields.

Tested on Cortex-M55 based STM32N6570.

Change-Id: I8737a24d01a13eeb09a0f2075b96be400f9f91c6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Link: [1] https://sourceware.org/gdb/download/onlinedocs/gdb.html/ARM-Features.html#M_002dprofile-Vector-Extension-_0028MVE_0029
Reviewed-on: https://review.openocd.org/c/openocd/+/8681
Tested-by: jenkins
2025-01-25 10:30:37 +00:00
Antonio Borneo 41f7d18161 target: armv7m: add support of per register data_type
Extend the struct armv7m_regs to include the optional pointer
to a struct reg_data_type.

Update armv7m_build_reg_cache() to check for the new optional
field and to use it.

Change-Id: I57c7f9abefd614308be8aa8419d687477b44679d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8680
Tested-by: jenkins
2025-01-25 10:30:15 +00:00
Richard Pasek 83e0293f7b Add Linux SPI device SWD adapter support
To alleviate the need to bitbang SWD, I've written a SWD SPI
implementation. This code is inspired by the work of luppy@appkaki.com
as shown at github.com/lupyuen/openocd-spi but with the desire to be
more generic. This implementation makes use of the more common 4 wire
SPI port using full duplex transfers to be able to capture the SWD ACK
bits when a SWD TX operation is in progress.

TEST:
  Connects successfully with the following combinations:
  Hosts:
    Raspberry Pi 4B
    Unnamed Qualcomm SoC with QUPv3 based SPI port
  Targets:
    Raspberry Pi 2040
    Nordic nRF52840
    NXP RT500

Change-Id: Ic2f38a1806085d527e6f999a3d15aea6f32d1019
Signed-off-by: Richard Pasek <rpasek@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8645
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2025-01-22 15:21:10 +00:00
Antonio Borneo 26f2df80c3 helper: list: rename macro clashing with sys/queue.h
The macro named LIST_HEAD() clashed with a macro of same name in
the GNU libc file sys/queue.h.
This causes a warning in MacOS build due to some other system file
including sys/queue.h.

Rename LIST_HEAD() as OOCD_LIST_HEAD().

Checkpatch-ignore: MACRO_ARG_REUSE
Change-Id: Ic653edec77425a58251d64f56c9f5f6c645ba0cd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reported-by: Andrew Shelley <ashelley@btinternet.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8683
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Andy <andrewjohnshelley@gmail.com>
2025-01-12 11:09:31 +00:00
R. Diez 0ed03df6e9 amend angie build definitions to fix make dist
"make dist" was broken because GNU Make was using a built-in rule
to try to build angie from angie.c . This is a limitation in Automake
when you add a whole subdir with the same name to EXTRA_DIST.
The Automake doc actually discourages adding whole subdirs.

Change-Id: I85ea4ecbd529b060c70f83bcfda7522e1730480d
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8600
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-01-12 11:09:12 +00:00
R. Diez 8b5ea720da make bitbang_interface const
Change-Id: I5e187250d231aeefc7a206b7f7917c3b2e858d5a
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8535
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-01-12 11:08:38 +00:00
Tomas Vanek d4b3b4ea82 target: free private_config if target initialisation fails
Fixes private_config memory leak when xx_deinit_target() is not called

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Ie7cce7f24af24695e7d2c1cd1882474c6863b80d
Reviewed-on: https://review.openocd.org/c/openocd/+/8642
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2025-01-09 20:16:22 +00:00
Tomas Vanek cf115c1e2b drivers/cmsis_dap_usb_bulk: allow waiting for bulk write
No driver directly working with the USB hardware needs additional
time to complete the write op, they always return transfer complete
status immediately after submitting the transfer.

Although there is implemented correct waiting path in cmsis_dap_usb_write()
it was marked by error logs to catch any suspicious behaviour during
debugging of asynchronous libusb transfers.

However there are drivers which need waiting to finish write op:
at least usbipd-win, IP tunnelled USB driver, was reported
to flood the log with the related errors.

Change LOG_ERROR to LOG_DEBUG_IO in the code waiting to finish write op.

Reported-by: Quentis Ghyll <quentisgh@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Iedf2c96d851f22e694efaf13a2d6a2a408cee1ad
Reviewed-on: https://review.openocd.org/c/openocd/+/8640
Tested-by: jenkins
2025-01-09 20:15:59 +00:00
Tomas Vanek 23796efa38 drivers/cmsis_dap: use blocking flag instead of wait timeout
CMSIS-DAP bulk backend read op used two timeouts: transfer timeout
used in libusb_fill_bulk_transfer() and wait timeout used optionally
in libusb_handle_events_timeout_completed().

The real usage is limited to two cases only:
1) blocking read: the same timeout is used for both transfer
and wait
2) non-blocking read: transfer timeout is used in
libusb_fill_bulk_transfer(),
libusb_handle_events_timeout_completed() is called with zero timeout.

Use blocking flag as read op parameter to distinguish between
these two cases.

See also [1]

Link: [1] 8596: jtag: cmsis_dap: include helper/time_support.h | https://review.openocd.org/c/openocd/+/8596
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Ia755f17dc72bb9ce8e02065fee6a064f8eec6661
Reviewed-on: https://review.openocd.org/c/openocd/+/8639
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2025-01-09 20:15:33 +00:00
David (Pololu) 250ab1008b flash/stm32l4x: add STM32C071xx support
I successfully programmed a NUCLEO-C071RB with these changes.

Change-Id: Ib57a77fa18f8a0e8c882e2250d6111c588d76887
Signed-off-by: David (Pololu) <dev-david@pololu.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8525
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2025-01-06 05:01:21 +00:00
Antonio Borneo 5233312ea5 configure: fix dependency of bitbang from dummy adapter
The commit bb2fc63357 ("configure.ac: enable the Dummy adapter
by default") breaks the building dependency between bitbang code
and dummy adapter.

Fix it.

Change-Id: I47587ef61d6b57b2547f6c2600d8404cad87f584
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reported-by: Jonathan Forrest <jonyscathe@gmail.com>
Fixes: bb2fc63357 ("configure.ac: enable the Dummy adapter by default")
BugLink: https://sourceforge.net/p/openocd/tickets/446/
Reviewed-on: https://review.openocd.org/c/openocd/+/8682
Reviewed-by: Andrzej Sierżęga <asier70@gmail.com>
Tested-by: jenkins
Reviewed-by: Andy <andrewjohnshelley@gmail.com>
2025-01-02 14:15:02 +00:00
Marc Schink 4f2744d0fe target/arc: 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: I3dd4314d354b5628144f98325540926981778616
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8665
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-30 15:58:26 +00:00
Marc Schink a75feb0bfd target/armv7m: Use LOG_TARGET_xxx()
Use LOG_TARGET_xxx() to indicate which target the message belongs to.

Change-Id: Ib1cd37fe6eca2ea42095d2d371116446a936e20a
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8664
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-30 15:58:10 +00:00
Marc Schink 78bc6f34d4 target/esirisc: Use LOG_TARGET_xxx()
Use LOG_TARGET_xxx() for log messages as it is used for other targets.

Change-Id: Ia7e9629d89f2e6cb3f9c156e74ac1a02960f9373
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8663
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-30 15:57:45 +00:00
Marc Schink 4193322315 target/mem_ap: Use LOG_TARGET_xxx()
Use LOG_TARGET_xxx() for log messages as it is used for other targets.

Change-Id: I2f937c937a5c09d91dc82b4323be3276ab60b01a
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8662
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-30 15:57:27 +00:00
Marc Schink e4ad10e0a1 helper/log: Add LOG_TARGET_USER()
Add a target-related log function for user messages as it already
exists for other log levels.

Change-Id: I9076677d6451b900332583e748bab3f83df56d3b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8661
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-30 15:57:01 +00:00
Tomas Vanek 5284a5f3ec tcl/interface: Find proper alias for RP1 on Raspberry Pi 5
Previously, Linux assigned gpiochip numbers sequentially depending on
when the chip driver was probed. As RP1 is on the end of a PCIe link, it
is probed later than the on-board chips (including expanders connected
over SPI/I2C). This meant that RP1's gpiochip assignment was at an
offset that could potentially change.

A downstream kernel patch now assigns fixed offsets for RP1 and the
onboard gpiochips. Query the device tree to get proper GPIO_CHIP index.

Change-Id: I759978d4b3021c815a7d9febb41961cd1d3d185c
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8650
Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Tested-by: jenkins
2024-12-29 07:27:45 +00:00
Marc Schink 15d90dd21c tcl/target: Add config for STM32U0x
Tested with NUCLEO-U083RC development board.

Change-Id: Iec668b45166543adcd1fa5077d41c57a35d3becf
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8648
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-12-29 07:26:13 +00:00
Marc Schink 66faa420a4 flash/nor/stm32l4x: Add support for STM32U0 series
Tested flash programming / erasing and write protection feature on the
STM32U083RC microcontroller.

Change-Id: I3af51452f76d1f046d34d61b22d51abe2d0db3e8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8647
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2024-12-29 07:25:36 +00:00
Marc Schink 7d5a0b6a27 tcl/board: Add nRF54L15-DK config file
This patch adds support for the nRF54L15 development kit from Nordic
Semiconductor.

Change-Id: I5e362227fed3982ef21f36e41aade196e0ac7031
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8610
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-22 09:57:21 +00:00
Marc Schink 4d1b3cbafc tcl/target: Add support for Nordic nRF54L series
The RISC-V coprocessor is currently not supported. It is attached to the
DAP via AP#2 but the AP implementation is unknown.

The nRFL54L series uses resistive RAM (RRAM) as non-volatile memory
which can be programmed directly. Since it does not fit in the current
flash memory infrastructure of OpenOCD there is no NVM support so far.

Change-Id: I9934af4fd3bb8b7272954fc4b17638c7dabbbee0
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8609
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-22 09:57:09 +00:00
Marc Schink 1f2db5d59a rtos/rtos: Remove 'ERROR: ' prefix in error log
Remove the prefix since it is redundant.

Change-Id: Ib064d1031f5ad14ed7711c09bb5f5254d0054d59
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8633
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-22 09:55:56 +00:00
Marc Schink 3be1bee753 target/mips: Remove 'ERROR: ' prefix in error log
Remove the prefix since it is redundant.

Change-Id: Ieecfb3583d484847514f1298e819ccf6d26abd84
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8632
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-22 09:55:35 +00:00