Commit Graph

9967 Commits

Author SHA1 Message Date
Wolfram Sang c8f56b4f00 TODO: remove outdated AT91SAM92xx entry
SAM9260 gained good generic infrastructure since 2009. And we always
want "improvements", no need for a TODO item.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
Change-Id: I92551ef9d42ee47ad7441f2354587bbb45edc97e
Reviewed-on: https://review.openocd.org/c/openocd/+/7526
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-18 17:30:46 +00:00
Wolfram Sang e1b0d5759a tcl/board/at91sam9g20-ek: remove outdated FIXME
It was fixed by e94180571 ("at91sam9: factorise cpu support") in 2011.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
Change-Id: I95ea149b45a9902424bf9068b4a2830c17ddc6be
Reviewed-on: https://review.openocd.org/c/openocd/+/7525
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-03-18 17:30:26 +00:00
Tomas Deingruber fc30feb51a tlc/interface: does fix source of raspberrypi-gpio-connector.cfg
in raspberrypi-native.cfg

Fixes: bec6c0eb09 (tcl/interface: universal config for all Raspberry Pi models)
Signed-off-by: Tomas Deingruber <Deingruber.Tomas@gmail.com>
Change-Id: I632c8acd84974937849b5fdf2943239def17bd6d
Reviewed-on: https://review.openocd.org/c/openocd/+/7512
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-03 22:26:15 +00:00
Peter Collingbourne 0a20e78b75 jtag/drivers/cmsis_dap: run queue on reaching transaction limit
We currently fail the transfer when issuing more than 255 transactions
at once, e.g.

> read_memory 0x10000000 32 256
CMSIS-DAP transfer count mismatch: expected 257, got 1

This is because the protocol only supports 255 transactions per packet
(65535 for block transactions), and as a result we truncate the
transaction count when assembling the packet. Fix it by running the
queue when we hit the limit.

Change-Id: Ia9e01e3af5ad035f2cf2a32292c9d66e57eafae9
Signed-off-by: Peter Collingbourne <pcc@google.com>
Fixes: 40bac8e8c4 ("jtag/drivers/cmsis_dap: improve USB packets filling")
Reviewed-on: https://review.openocd.org/c/openocd/+/7483
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-02-26 10:03:42 +00:00
Antonio Borneo c99c043f3f helper: command: drop last LF ('\n') from sequence of command_print()
The OpenOCD commands produce their TCL text result through the
pair command_print() and command_print_sameline().
The latter is used to concatenate output in a single line.

At the end of a sequence of command_print(), the last LF is taken
as part of the command result, while it is not always needed, and
it is even annoying when the output of two commands needs to be
concatenate in a single line.

Using command_print_sameline() in place of the last call to
command_print() would solve the problem but it's quite expensive
in term of coding to fix all the existing commands.

Drop the last LF, if present.
Commands that would specifically need a LF as last char, can add
an extra LF at the end of the output.
Document this behavior in command.h.

Change-Id: I6757c20fbfce923dd393083146e8d5a1f3b790b4
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7471
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-02-26 10:00:52 +00:00
Daniel Anselmi 79caea8745 flash/nor/spi: add 25pe{10/20/40/80/16}
Change-Id: Ic5660bff83b8636ef397482a3313971ecdff72c0
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7416
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-02-18 18:09:22 +00:00
Andreas Bolsch 85ae73de03 new SPI memory devices, continuation code for manufacturer id
A bunch of new SPI flash (Adesto, Cypress, XTX Tech, mainly octal)
IDs and SPI FRAM (Infineon) IDs added. Backward compatible change
of ID interpretation: The previously unused 4th byte now acts
as continuation code (0x7F) count for manufacturer id, cf.
JEDEC JEP106BC. Currently this affects only some recent octal flash
and FRAM devices, which are only supported by stmqspi and cmspi
flash drivers.

Change-Id: Ibdcac81a84c636dc68439add4461b959df429bca
Signed-off-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6929
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-02-12 09:04:15 +00:00
Marc Schink 1998b1e5a8 README: Remove statement about libjaylink Git submodule
Change-Id: I552c08979849c66d7f8f559ccfd49d27f8b68bb8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7470
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-02-03 22:49:16 +00:00
Marc Schink b6021e856a flash/nor/stm32l4x: Add revision 'Z' for STM32L552/562 devices
Change-Id: Icc6058ef1f43e969a2a9baadfaf382ac820a7b76
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7468
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-02-03 22:49:05 +00:00
Antonio Borneo 4a79372b6e target: arc: rewrite command 'arc add-reg' as COMMAND_HANDLER
While there, fix some coding style error and remove the now unused
function jim_arc_read_reg_name_field() and the macro
JIM_CHECK_RETVAL().

Change-Id: I140b4b929978b2936f2310e0b7d1735ba726c517
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7426
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:48:48 +00:00
Antonio Borneo 85f3b10a69 target: arc: rewrite command 'arc add-reg-type-struct' as COMMAND_HANDLER
Use a COMMAND_HELPER() to avoid memory leaks when the helper
COMMAND_PARSE_NUMBER() returns due to an error.

While there:
- fix potential SIGSEGV due to dereference 'type' before checking
  it's not NULL;
- fix an incorrect NUL byte termination while copying to
  type->data_type.id and to bitfields[cur_field].name;
- fix some coding style error;
- remove the now unused function jim_arc_read_reg_type_field().

Change-Id: I7158fd93b5d4742f11654b8ae4a7abd409ad06e2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7425
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:48:26 +00:00
Antonio Borneo 92ef27494c target: arc: rewrite command 'arc add-reg-type-flags' as COMMAND_HANDLER
Use a COMMAND_HELPER() to avoid memory leaks when the helper
COMMAND_PARSE_NUMBER() returns due to an error.

While there:
- fix potential SIGSEGV due to dereference 'type' before checking
  it's not NULL;
- fix an incorrect NUL byte termination while copying to
  type->data_type.id and to bitfields[cur_field].name;
- fix some coding style error.

Change-Id: Ide4cbc829871a6a523026ccc0d3100dadc2afd06
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7424
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:48:15 +00:00
Antonio Borneo ea6a99208e helper: nvp: add openocd nvp files
Long ago jim_nvp was part of jimtcl. When jimtcl dropped it,
OpenOCD kept copy of it in its code base. Current code of jim_nvp
is still related with jimtcl data types and functions.

With the target of better isolating OpenOCD code from jimtcl,
create a new file nvp.c that re-proposes only the core of the old
jim_nvp, dropping any link with jimtcl and removing the string
'jim' either from the filename and from the code.
Keep the same license from the old code, as the new files are
clearly derived from it.

Change-Id: I273448cf1f1484b10f6b6113ed7bb0fcf946482b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7423
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:47:40 +00:00
Antonio Borneo 18bafdce61 target: arc: fix error handling in command 'arc set-reg-exists'
The command is specified through COMMAND_HANDLER. It should not
return JIM_OK / JIM_ERR.

Change-Id: I56666414d49b0298ecc23ec7ef30c77e1e27afa8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7413
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:47:30 +00:00
Antonio Borneo da76ba610b target: arc: rewrite command 'arc num-actionpoints' as COMMAND_HANDLER
Also drop arc_cmd_jim_get_uint32() that is now unused.

Change-Id: Ic26c3f008376db3f01215bf736fca736dd1c1a4f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7412
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:47:17 +00:00
Antonio Borneo 996d6f383d target: arc: rewrite command 'arc get-reg-field' as COMMAND_HANDLER
This also fixes several incorrect return ERROR_xxx from a jim
command.

Change-Id: I34fe3552d3dc344eac67bf504c5d5709b707fdfd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7411
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:47:01 +00:00
Antonio Borneo f0cb5b0272 target: arc: rewrite command 'arc jtag set-core-reg' as COMMAND_HANDLER
This also fixes an incorrect return ERROR_OK from a jim command.

Change-Id: I72a522645f62b99b313573c8bad6d4f674c5ae53
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7410
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:46:46 +00:00
Antonio Borneo 16af56f600 target: arc: rewrite command 'arc jtag get-core-reg' as COMMAND_HANDLER
This also fixes an incorrect return ERROR_OK from a jim command.

Change-Id: I1f9cf5d1dfa38b8a06042b5f54209e6ee2fc4e0e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7409
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:46:31 +00:00
Antonio Borneo 551d85b123 target: arc: rewrite command 'arc jtag set-aux-reg' as COMMAND_HANDLER
This also fixes an incorrect return ERROR_OK from a jim command.

Change-Id: Iab9bc7c25181341a632f608a8ef2d8b0bea72520
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7408
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:46:19 +00:00
Antonio Borneo 700cdbfac4 target: arc: rewrite command 'arc jtag get-aux-reg' as COMMAND_HANDLER
This also fixes an incorrect return ERROR_OK from a jim command.

Change-Id: I3c51355e7e05965327ce819a3114e370f2de5249
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7407
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
2023-02-03 22:45:56 +00:00
Daniel Serpell 9d97cace0e flash/nor/spi: Add some zbit flash chips.
I have a RP2020 board from aliexpress that uses the ZB25VQ32 flash, this
allows openocd to correctly identify it with the full flash size.

I also added other models, the datasheets can be found at:

Link: https://datasheet.lcsc.com/lcsc/2203210916_Zbit-Semi-ZB25VQ16ASIG_C2982491.pdf
Link: https://datasheet.lcsc.com/lcsc/2003141132_Zbit-Semi-ZB25VQ32BSIG_C495744.pdf
Link: https://datasheet.lcsc.com/lcsc/2003141132_Zbit-Semi-ZB25VQ64ASIG_C495745.pdf
Link: https://datasheet.lcsc.com/lcsc/2006151421_Zbit-Semi-ZB25VQ128ASIG_C609616.pdf

As noted by Andreas Bolsch, the devices supporting QSPI have different
ID in QPI mode than SPI, so two entries are needed in the table for each
one.

Use 0x0B as qread command, as this does not need the dummy M7-0
parameters.

Signed-off-by: Daniel Serpell <daniel.serpell@gmail.com>
Change-Id: Id99187b1963b02ac1a786b66bb352f5f48ed0ac2
Reviewed-on: https://review.openocd.org/c/openocd/+/7445
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2023-02-03 22:45:20 +00:00
Tomas Vanek 0b6f53e94c tcl/target: add rescue mode to RP2040 config
Integrate a rescue mode inspired by [1].

The current OpenOCD must be restarted before normal work with the RP2040
because the rescue debug port must not be activated (or the target
is reset every 'dap init'). To continue without restarting OpenOCD
we would need to switch off the configured rescue dap.

Change-Id: Ia05b960f06747063550c166e461939d92e232830
Link: [1] https://github.com/raspberrypi/openocd/blob/rp2040/tcl/target/rp2040-rescue.cfg
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7327
Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2023-01-28 15:57:24 +00:00
Tomas Vanek 4423e05d9d jtag/drivers/jlink: allow SWD multidrop
SW-DPv2 and SWJ-DPv2 devices do not reply to DP_TARGETSEL write cmd.

Ignore the received ACK after TARGETSEL write.

While on it, use swd_ack_to_error_code() for unified error code
translation of the received ACK value for all other commands.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: If978c88c8496e31581175385e59c32faebfd20aa
Reviewed-on: https://review.openocd.org/c/openocd/+/7383
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: zapb <dev@zapb.de>
2023-01-28 15:56:05 +00:00
Erhan Kurubas 227577ba76 rtos: remove config.h includes from stackings headers
And add its own header to the rtos_xxx_stackings.c

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I084130fde7ee8645129a7cf60bb7bf59448e2f39
Reviewed-on: https://review.openocd.org/c/openocd/+/7441
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:55:36 +00:00
Tomas Vanek bec6c0eb09 tcl/interface: universal config for all Raspberry Pi models
Speed calibration coeffs are computed from cpufreq/scaling_max_freq
and from the device-tree compatibility information.

Raspberry Pi linux offers /dev/gpiomem for non-root access
to the GPIO registers since ~2016.
Do not configure 'bcm2835gpio peripheral_base' as it is necessary
only if /dev/mem is used - it requires running OpenOCD as root
- it's a security risk so it should be avoided.

The configuration of the GPIO connector (40-pin header)
is factored out and ready to use in interface configuration
for other driver (e.g. linux gpiod).

Mark raspberrypi2-native.cfg as deprecated and redirect
it to raspberrypi-native.cfg

Change-Id: Icce856fb660b45374e94174da279feb51f529908
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7264
Tested-by: jenkins
Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:55:10 +00:00
Tomas Vanek 2dde7e914b jtag/drivers/bcm2835gpio: refactor delays to inline function
No functional change, the delay is unchanged.

Change-Id: I5b5e837d741ac01fc573657357c5fe61ad901319
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7262
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:54:32 +00:00
Tomas Vanek b4dd8dbc37 jtag/drivers/bcm2835gpio: use rounding in delay math
After setting adapter speed to some values, the driver
shows the real speed little bit higher.
Although it does not impose a problem from technical point
of view because the difference is smaller than usual speed error,
it looks at least strange to the user. The documentation reads
that real frequency should be same or lower than requested.

Use proper rounding in speed -> delay and delay -> speed
conversions.

Change-Id: I1831112cc58681875548d2aeb688391fb79fa37f
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7261
Tested-by: jenkins
Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:54:17 +00:00
Tomas Vanek 148bc7e215 jtag/drivers/bitbang: avoid mostly harmless glitch on SWDIO
bitbang_swd_exchange(rnw=true,...) calls bitbang_interface->swd_write()
with swdio clamped to 0.
bitbang_swd_write_reg() reads 1 turnaround bit, 3 ack bits
and 1 turnaround by one call to bitbang_swd_exchange()
and then switches SWDIO to output.
AFAIK all bitbang interfaces switch SWDIO GPIO direction immediately
in bitbang_interface->swdio_drive().
The GPIO now drives SWDIO line to the value stored in the output register
which is always zero from previous bitbang_swd_exchange(rnw=true,...).
In case the following data bit (bit 0) is 1 we can observe a glitch
on SWDIO:
                                         _____ out 1 ____
HiZ/pull-up ----\                       /
                 \                     /
                  \______ out 0 ______/
          swdio_drive(true)   swd_write(0,1)

The glitch fortunately takes place far enough from SWCLK rising edge
where SWDIO is sampled by the target, so I believe it is harmless
except some corner cases where the reflected wave is delayed on long
line.

Anyway keeping electrical signals glitch free is a good practice.
To keep performance penalty minimal, pre-write the first data
bit to SWDIO GPIO output buffer while clocking the turnaround bit.
Following swdio_drive(true) outputs the pre-written value
and the same value is rewritten by the next swd_write()
instead of glitching SWDIO.

Change-Id: I72ea9c0b2fae57e8ff5aa616859182c67abc924f
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7260
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:53:21 +00:00
N S 20285b9100 jtag/drivers/openjtag: fix annoying num_cycles > 16 warning
The OpenJTAG driver logs "num_cycles > 16 on run test" warning
whenever the JTAG_RUNTEST operation cycle count is larger than 16.

Instead of logging the warning and only running the first 16 TCLK
cycles, remove the warning and queue up multiple operations of up
to 16 cycles each.

Signed-off-by: N S <nlshipp@yahoo.com>
Change-Id: Id405fa802ff1cf3db7a21e76bd6df0c2d3a0fe61
Reviewed-on: https://review.openocd.org/c/openocd/+/7420
Tested-by: jenkins
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:52:54 +00:00
Andreas Fritiofson d032e7ec8c rtos: Fix constness of struct rtos_type
Change-Id: Iaa89f2ff4036c23f944ffb4f37fe0c7afaf5069b
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6680
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:52:25 +00:00
Andreas Fritiofson 43c8aa28cb rtos: Support rt-kernel
Works for the proprietary rt-kernel from rt-labs.

See: https://rt-labs.com/product/rt-kernel/
Change-Id: Id2c2e292c15fb17eab25e3d07db05014daa2a2b0
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6668
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:52:03 +00:00
Erhan Kurubas cf50bcb841 rtos/nuttx: add stacking info for Espressif Xtensa chips
ESP32, ESP32-S2 and ESP32-S3 stack register offsets added

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Ic6215c1d0152853fd08f82cbd3c138c7d62dbc46
Reviewed-on: https://review.openocd.org/c/openocd/+/7443
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:51:15 +00:00
Erhan Kurubas 59bc761d56 rtos: add custom stack read function
This is optional field for the targets which has to implement
their custom stack read function.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Icbc9ed66a052fc2cc0ef67e3ec4d85ab0c2c1b94
Reviewed-on: https://review.openocd.org/c/openocd/+/7442
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:50:50 +00:00
Erhan Kurubas dfbbfac4d7 rtos/nuttx: add riscv stacking info
Tested with Espressif ESP32-C3 MCU

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Ia71ace4909f2dc93ddc07a2ec5524cf374f1937c
Reviewed-on: https://review.openocd.org/c/openocd/+/7251
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:50:33 +00:00
Erhan Kurubas 463df95215 rtos/nuttx: move stacking info to the new nuttx stackings file
Other OSes have separate files to keep stack register offsets.
Adding them for NuttX as well will provide a clearer way to expand.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I1428fefefa199a95431f2073c0279dd7028ad8da
Reviewed-on: https://review.openocd.org/c/openocd/+/7250
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:43:02 +00:00
Erhan Kurubas 41231db3f0 doc:usb_adapters: add lsusb dump of esp_usb_jtag
Also, esp_usb_jtag added to the supported driver list of
"adapter serial" command.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Ie65cbf9b44f5de6d7995102d1a281161468f6103
Reviewed-on: https://review.openocd.org/c/openocd/+/7440
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:22:04 +00:00
N S 98d816ff77 doc: fix broken link to IgnoreHardwareSerialNumber in README.Windows
URL for Microsoft documentation on IgnoreHardwareSerialNumber
   redirects to generic USB driver landing page instead of specific
   article. Update link to go to correct page.

Signed-off-by: N S <nlshipp@yahoo.com>
Change-Id: Ifac6c730a1438242cdfe0a0a2867e043e03ceec7
Reviewed-on: https://review.openocd.org/c/openocd/+/7439
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28 15:17:48 +00:00
Andreas Fritiofson bc3c07b176 stm32f3x: Allow overriding the flash bank size
Same mechanism as in stm32f1x.cfg reused here.

Change-Id: I81f02feb2b655e8259341b22180f3a8b82e28d05
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7438
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-21 22:58:16 +00:00
Marian Buschsieweke 6e67f1473a helper: Add generic little endian CRC32 function
This generalizes the little endian CRC32 function used in the OR1K
target and moves it to a common helper, so that other places do not need
to reinvent the wheel. It is directly used in the OR1K target.

Change-Id: I0e55340281a5bfd80669bb1994f3a96fecc1248a
Signed-off-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7415
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-21 22:57:33 +00:00
Tomas Vanek 92dd917f5a flash/nor/psoc4: drop jtag_poll_mask() from flash write
Polling the target makes no harm during PSoC 4 flash write in the current
OpenOCD code. Don't mask it.

Change-Id: I6625ded0162ee3a96b92188844d0d2d6c30101c2
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7162
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-21 22:56:32 +00:00
Antonio Borneo cda39f929e jtag: hla: use generic helper for commands 'jtag newtap' 'swd newdap'
The commands 'jtag newtap' and 'swd newdap' have to work either on
HLA transport and on standard JTAG/SWD. Having a dedicated
implementation for HLA is a non-sense.

Reuse the generic code jim_jtag_newtap() and drop the files
hla_tcl.[ch] as they are now empty.

Change-Id: I9dabbdc2a6f338f23b2fd3ed1a4dc3da0200c080
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7428
Tested-by: jenkins
2023-01-15 15:12:05 +00:00
Antonio Borneo 7a890a8f25 jtag: parse command options in 'swd newdap'
The same code is currently used for commands 'jtag newtap' and
'swd newdap' (plus dapdirect versions), but for SWD case the code
skips the parsing of the command line as not every flag is used.
This has the drawback that syntax errors get unchecked.

Move the check about the transport so the command line get always
parsed even when the corresponding flags are not useful.

Change-Id: I596c3beb04e9e8a9ebe6ee68a61395b679d43b3e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7427
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-01-15 15:11:50 +00:00
Marian Buschsieweke 69571354f4 .gitignore: Add .cache and compile_commands.json
Enhancing the editor / IDE experience with the use of the language
server protocol (lsp) is getting more and more common. The most widely
used lsp implementation for C/C++ outside of Redmond is clangd.

Clangd uses compile_commands.json, that contains the compiler invocation
for each compilation unit, to get the required $CFLAGS to successfully
located header files etc. This is best automatically generated from with
bear on Makefile based build systems. Hence, there is little value in
adding it to the git repo.

In addition, clangd generates cache files in the .cache folder. Again,
there is no reason in tracking it with git.

Change-Id: Ic5165d10aca3a1cc9e9398af9dd2fbf0977608b3
Signed-off-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7414
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15 15:11:21 +00:00
Marc Schink dbb42ca18d flash/nor/stm32l4x: Add revision 'X' and 'C' for STM32U575/585 devices
Change-Id: I4d950dc0a1421036418f2e5c1f0ed8eca86efc1a
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7390
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15 15:10:59 +00:00
Antonio Borneo a3ed12401b tcl/target: enable -rtos hwthread
The rtos hwthread has been merged in 2019 with commit 85ba2dc4c6
("rtos/hwthread: add hardware-thread pseudo rtos").
During review in patchset 19 the name of the rtos has been changed
from 'hawt' to 'hwthread'.

Some target config file was already merged ready for hwthread, but
keeping the relevant lines commented and still reporting the old
name.

Enable rtos hwtread to the target that were supposed to use it.
Fix the name of the rtos.

Change-Id: I877862dcdba39f26462bb542bac06d1a5f5f222d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7384
Tested-by: jenkins
2023-01-15 15:10:42 +00:00
Tomas Vanek 5292c7eae9 jtag/drivers/cmsis_dap: prevent conn/discon workaround before line reset
The line reset SWD sequence is used quite often in SWD multidrop mode.
Prevent the ugly connect/disconnect adapter firmware bug workaround
to be called before each line reset.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Id85bff075dba9077e4e501e2cdcfd64d5d9d0531
Reviewed-on: https://review.openocd.org/c/openocd/+/7381
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15 15:10:16 +00:00
Tomas Vanek 630cb5ea4d jtag/drivers/cmsis_dap: speed up long transfers using DAP_TransferBlock
DAP_TransferBlock command saves n - 3 bytes in comparison to DAP_Transfer,
where n is number of transfers.

Use DAP_TransferBlock optionaly to save some USB bandwidth.

The change increases the speed of the write transfer
from 40 KiB/s to 42 KiB/s @ USB FS, adapter speed 1000.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Ifde0159cfd44481d2b81b90daa088e731c03e26d
Reviewed-on: https://review.openocd.org/c/openocd/+/7372
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15 15:09:47 +00:00
Tomas Vanek 40bac8e8c4 jtag/drivers/cmsis_dap: improve USB packets filling
DAP write transaction occupies 5 bytes of a command packet.
DAP read transaction needs just one byte in a command packet
and expect 4 bytes in a response.

The fixed maximal number of transactions in a packet caused
packet filling less than optimal.

Compute both command and expected response sizes based on
read or write direction of each transaction.
Run the queue if one of sizes does not fit into a packet.

The change increases the speed of the mostly read transfer
from 36 KiB/s to almost 40 KiB/s @ USB FS, adapter speed 1000
due to reduction of adapter inserted RDBUFF reads.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Ib70812600eaae0403b8ee8673b6f897348496569
Reviewed-on: https://review.openocd.org/c/openocd/+/7364
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15 15:09:07 +00:00
Tomas Vanek 3d3d35c9b8 jtag/drivers/cmsis_dap: introduce packet_usable_size
USB bulk backend needs to avoid zero sized USB packets
sent after each full sized packed for performance reasons.

HID backend uses fixed size HID reports so the full size
of the report can be utilized.

Introduce packet_usable_size to reflect it.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I34094c9edac5730624480711cbd6aa65883c47c7
Reviewed-on: https://review.openocd.org/c/openocd/+/7363
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15 15:08:49 +00:00
Tomas Vanek 600d0165cc jtag/drivers/cmsis_dap: use unsigned types
Not all variables converted, JTAG part is left as is.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Ie9cc890769a2f53cb3a07fd457030e1b98910d44
Reviewed-on: https://review.openocd.org/c/openocd/+/7362
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15 15:08:05 +00:00