aboutsummaryrefslogtreecommitdiff
path: root/doc
AgeCommit message (Collapse)AuthorFilesLines
2022-09-22Improve oSCAN1 documentationmrv961-3/+16
Signed-off-by: mrv96 <mrv96@users.noreply.github.com>
2022-06-08Document `ftdi oscan1_mode` (#705)Tim Newsome1-0/+7
Change-Id: I29b001bc6b9f29f1976aac3f02e15e4490707a4b Signed-off-by: Tim Newsome <tim@sifive.com>
2022-06-06tcl: add Espressif riscv targets (ESP32-C2 & ESP32-C3) (#706)Erhan Kurubas1-0/+2
Change-Id: I48fead33f5fd5890a7724cd5f500f2d14e2a5ffa Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
2022-05-03Merge branch 'master' into from_upstreamTim Newsome1-3/+4
Conflicts: tcl/target/gd32vf103.cfg I kept our version, except I changed the flash device as happened in mainline. Once this file settles down in mainline, we can copy it wholesale into this fork. Change-Id: I4c5b21fec0734b5e08eba392883e006a46386b1c
2022-04-24flash/stm32f1x: add support for RISC-V GigaDevice GD32VF103Tomas Vanek1-0/+1
The device has compatible flash macro with STM32F1 family, reuse stm32f1x driver code. Detect non-ARM target - for simplicy test target type name 'riscv' and the address has 32 bits. In case of RISC-V CPU use simple chunked write algo - async algo cannot be used as the core implemented in this device doesn't allow memory access while running. Change-Id: Ie3886fbd8573652691f91a02335812a7300689f7 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6704 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com>
2022-04-23nds32: deprecate it, together with aice adapter driverAntonio Borneo1-3/+3
The target nds32 and its companion adapter aice have not received any real improvement since 2013. It has been hard to keep them aligned during the evolution of OpenOCD code, with no way for maintainers to really check if they are still working. No real documentation is present for them in OpenOCD. The arch nds32 has been dropped from Linux kernel v5.18-rc1. Deprecate both nds32 target and aice adapter with the target of dropping them for v0.13.0. Remove automatic build of aice, forcing user to select it. Change-Id: Ib465d676246fa3b4e95c3d399ba9a5cf1f8b3baf Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6887 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2022-04-20riscv: Add a option to specify the JTAG TAP tunnel IR (#690)Dolu19901-0/+5
* riscv: Add a option to specify the JTAG TAP IR used to access the bscan tunnel. Change-Id: Ice8798823313e2177e75473e62b06e7da74bbba2 Signed-off-by: Charles Papon <charles.papon.90@gmail.com> * risc-v: Add litex doc about the set_bscan_tunnel_ir command Change-Id: I1237213f32886d20fc7d60d5ca1e2124953eaeda Signed-off-by: Dolu1990 <charles.papon.90@gmail.com> * risc-v: remove tunnel ir length assert when ir is set by the user Change-Id: I2b33fc6205f37461ff1bd15601b460a2467ea32b Signed-off-by: Dolu1990 <charles.papon.90@gmail.com> * Open riscv: Add a option to specify the JTAG TAP tunnel IR Typo Co-authored-by: Tim Newsome <tim@sifive.com> * riscv: Add a option to specify the JTAG TAP tunnel IR typo Co-authored-by: Tim Newsome <tim@sifive.com> Co-authored-by: Tim Newsome <tim@sifive.com>
2022-04-11Merge branch 'master' into from_upstreamTim Newsome1-29/+155
Conflicts: src/server/server.c src/target/breakpoints.c src/target/semihosting_common.c src/target/target.c Change-Id: I48bd3608c688c69d8aac0667fc46e2de5466a9f1
2022-03-19semihosting: permit redirection of semihosting I/O to TCPTarek BOCHKATI1-0/+11
This command permits the usage of a TCP port to perform debug and stdio operations: - debug : READC, WRITEC and WRITE0 - stdio : READ, WRITE This will permit the separation of semihosting message from OpenOCD log, and separate semihosting messages per core. syntax: arm semihosting_redirect (disable | tcp <port> [debug|stdio|all]) this allows to select which operations to be performed via TCP (debug, stdio or all (default)). Note: for stdio operations, only I/O from/to ':tt' file descriptors are redirected. tested using netcat on ubuntu Change-Id: I37053463667ba109d52429d4f98bc98d0ede298d Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5562 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-03-12target: Deprecate 'array2mem' and 'mem2array''Marc Schink1-34/+5
Replace 'mem2array' and 'array2mem' with a Tcl wrapper that internally uses 'read_memory' and 'write_memory'. The target-specific 'mem2array' and 'array2mem' functions remain for now. Change-Id: If24c22a76ac72d4c26916a95f7f17902b41b6d9e Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/6308 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-03-12target/tcl: Add 'read_memory' and 'write_memory'Marc Schink1-0/+78
These functions are meant as replacement for 'mem2array' and 'array2mem'. The main benefits of these new functions are: * They do not use Tcl arrays but lists which makes it easier to parse (generate) the data. See the Python Tcl RPC code in contrib as a negative example. * They do not operate on Tcl variables but instead return (accept) the Tcl list directly. This makes the C and Tcl code base smaller and cleaner. * The code is slightly more performant when reading / writing large amount of data. Tested with a simple Python Tcl RPC benchmark. Change-Id: Ibd6ece3360c0d002abaadc37f078b10a8bb606f8 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/6307 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-03-05target/tcl: Add get_reg functionMarc Schink1-0/+36
Change-Id: Id1be9554d1df2c07cec3161a0fd3a586fdf18246 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/5312 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-03-05target/tcl: Add set_reg functionMarc Schink1-0/+30
Change-Id: I97a01b93046cb7af289792489f77f5580312585a Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/5313 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-03-03From upstream (#684)Tim Newsome1-0/+68
* flash/nor/atsame5: add LAN9255 devices Support Microchip LAN9255 devices with embedded SAME53J MCU. Signed-off-by: Hans-Erik Floryd <hans-erik.floryd@rt-labs.com> Change-Id: Ia811c593bf7cf73e588d32873c68eb67c6fafad7 Reviewed-on: https://review.openocd.org/c/openocd/+/6811 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> * tcl/board: Add EVB-LAN9255 config Config for EVB-LAN9255, tested using Atmel-ICE debugger on J10 connector. Signed-off-by: Hans-Erik Floryd <hans-erik.floryd@rt-labs.com> Change-Id: I8bcf779e9363499a98aa0b7d10819c53da6a19e7 Reviewed-on: https://review.openocd.org/c/openocd/+/6812 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * aarch64: support for aarch32 ARM_MODE_UND Fix: unrecognized psr mode: 0x1b cannot read system control register in this mode: (UNRECOGNIZED : 0x1b) Change-Id: I4dc3e72f90d57e52c0fe63cb59a7529a398757b3 Signed-off-by: Julien Massot <julien.massot@iot.bzh> Change-Id: Ifa5d21ae97492fde9e8c79ee7d99d8a2a871b1b5 Reviewed-on: https://review.openocd.org/c/openocd/+/6808 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * Combine register lists of smp targets. This is helpful when you want to pretend to gdb that your heterogeneous multicore system is homogeneous, because gdb cannot handle heterogeneous systems. This won't always works, but works fine if e.g. one of the cores has an FPU while the other does not. (Specifically, HiFive Unleashed has 1 core with no FPU, plus 4 cores with an FPU.) Signed-off-by: Tim Newsome <tim@sifive.com> Change-Id: I05ff4c28646778fbc00327bc510be064bfe6c9f0 Reviewed-on: https://review.openocd.org/c/openocd/+/6362 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * semihosting: use open mode flags from GDB, not from sys/stat.h Values defined in sys/stat.h are not guaranteed to match the constants defined by the GDB remote protocol, which are defined in https://sourceware.org/gdb/onlinedocs/gdb/Open-Flags.html#Open-Flags. On my local system (Manjaro 21.2.1 x86_64), for example, O_TRUNC is defined as 0x40, whereas GDB requires it to be 0x400, causing all "w" file open modes to misbehave. This patch has been tested with STM32F446. Change-Id: Ifb2c740fd689e71d6f1a4bde1edaecd76fdca910 Signed-off-by: Pavel Kirienko <pavel.kirienko@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6804 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * semihosting: User defined operation, Tcl command exec on host Enabling a portion (0x100 - 0x107) of the user defined semihosting operation number range (0x100 - 0x1FF) to be processed with the help of the existing target event mechanism, to implement a general-purpose Tcl interface for the target available on the host, via semihosting interface. Example usage: - The user configures a Tcl command as a callback for one of the newly defined events (semihosting-user-cmd-0x10X) in the configuration file. - The target can make a semihosting call with <opnum>, passing optional parameters for the call. If there is no callback registered to the user defined operation number, nothing happens. Example usage: Configure RTT automatically with the exact, linked control block location from target. Signed-off-by: Zoltán Dudás <zedudi@gmail.com> Change-Id: I10e1784b1fecd4e630d78df81cb44bf1aa2fc247 Reviewed-on: https://review.openocd.org/c/openocd/+/6748 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * target/smp: use a struct list_head to hold the smp targets Instead of reinventing a simply linked list, reuse the list helper for the list of targets in a smp cluster. Using the existing helper, that implements a double linked list, makes trivial going through the list in reverse order. Change-Id: Ib36ad2955f15cd2a601b0b9e36ca6d948b12d00f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6783 Tested-by: jenkins * helper/list: add list_for_each_entry_direction() Use a bool flag to specify if the list should be forward or backward iterated. Change-Id: Ied19d049f46cdcb7f50137d459cc7c02014526bc Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6784 Tested-by: jenkins * target/riscv: revive 'riscv resume_order' This functionality was lost in [1], which was merged as commit 615709d14049 ("Upstream a whole host of RISC-V changes."). Now it works as expected again. Add convenience macro foreach_smp_target_direction(). Link: [1] https://github.com/riscv/riscv-openocd/pull/567 Change-Id: I1545fa6b45b8a07e27c8ff9dcdcfa2fc4f950cd1 Signed-off-by: Tim Newsome <tim@sifive.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6785 Tested-by: jenkins * doxygen: fix some function prototype description Change-Id: I49311a643ea73143839d2f6bde976cfd76f8c67f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6830 Tested-by: jenkins * Cadence virtual debug interface (vdebug) integration Change-Id: I1bc105b3addc3f34161c2356c482ff3011e3f2cc Signed-off-by: Jacek Wuwer <jacekmw8@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6097 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * gdb_server: Include thread name as XML attribute Explicitly providing a thread name in the "thread" element produces better thread visualizations in downstream tools like IDEs. Signed-off-by: Ben McMorran <bemcmorr@microsoft.com> Change-Id: I102c14ddb8b87757fa474de8e3a3f6a1cfe10d98 Reviewed-on: https://review.openocd.org/c/openocd/+/6828 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * Fix small memory leak. See https://github.com/riscv/riscv-openocd/pull/672 Change-Id: Ia11ab9bcf860f770ea64ad867102c74b898f6b66 Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6831 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * server: remove remaining crust from dropped eCos code Commit 39650e2273bc ("ecosboard: delete bit-rotted eCos code") has removed eCos code but has left some empty function that was used during non-eCos build to replace eCos mutex. Drop the functions and the file that contain them. Change-Id: I31bc0237ea699c11bd70921660f960ee406ffa80 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6835 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> * rtos: threadx: Add hla_target support for ThreadX Tested with an AZ3166 dev board (which uses the STM32F412ZGT6) running the Azure RTOS ThreadX demonstration system. Signed-off-by: Ben McMorran <bemcmorr@microsoft.com> Change-Id: I44c8f7701d9f1aaa872274166321cd7d34fb1855 Reviewed-on: https://review.openocd.org/c/openocd/+/6829 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * .gitmodules: switch away from repo.or.cz The host repo.or.cz is often offline, creating issues for cloning and building OpenOCD from scratch. Already 'jimtcl' developer has dropped repo.or.cz, triggering the OpenOCD commit 861e75f54efb ("jimtcl: switch to github"). Change also the link of the remaining submodules 'git2cl' and 'libjaylink' to their respective main repository. Change-Id: Ib513237427635359ce36a480a8f2060e2fb12ba4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6834 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de> * flash/nor/stm32f2x: Fix erase of bank 2 sectors This commit corrects the erase function for stm32f2x when dealing with sectors in bank 2, for STM32F42x/43x devices with 1MB flash. On STM32F42x/43x with 1MB flash in dual bank configuration, the sector numbering is not consecutive. The last sector in bank 1 is number 7, and the first sector in bank 2 is number 12. The sector indices used by openocd, however, _are_ consecutive (0 to 15 in this case). The arguments "first" and "last" to stm32x_erase() are of this type, and so the logic surrounding sector numbers needed to be corrected. Since the two banks in dual bank mode have the same number of sectors, a sector index in bank 2 is larger than or equal to half the total number of sectors. Change-Id: I15260f8a86d9002769a1ae1c40ebdf62142dae18 Signed-off-by: Simon Johansson <ampleyfly@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6810 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> * target/cortex_m: fix target_to_cm() helper The third parameter of container_of() should point to the same member as target->arch_info points to, struct arm. It worked just because struct arm is the first member in struct armv7m_common. If you move arm member from the first place, OpenOCD fails heavily. Change-Id: I0c0a5221490945563e17a0a34d99a603f1d6c2ff Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6749 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * target/armv7m,cortex_m: introduce checked arch_info cast routines target_to_armv7m() and target_to_cm() do not match the magic number so they are not suitable for use outside of target driver code. Add checked versions of pointer getters. Match the magic number to ensure the returned value points to struct of the correct type. Change-Id: If90ef7e969ef04f0f2103e0da29dcbe8e1ac1c0d Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6750 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * target/cortex_m: add Cortex-M part number getter The getter checks the magic numbers in arch_info to detect eventual type mismatch. Change-Id: I61134b05310a97ae9831517d0516c7b4240d35a5 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6751 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> * flash/nor/stm32xx: fix segfault accessing Cortex-M part number Some of STM32 flash drivers read Cortex-M part number from cortex_m->core_info. In corner cases the core_info pointer was observed uninitialised even if target_was_examined() returned true. See also [1] Use the new and safe helper to get Cortex-M part number. While on it switch also target_to_cm()/target_to_armv7m() to the safe versions. This prevents a crash when the flash bank is misconfigured with non-Cortex-M target. Add missing checks for target_was_examined() to flash probes. [1] 6545: fix crash in case cortex_m->core_info is not set https://review.openocd.org/c/openocd/+/6545 Change-Id: If2471af74ebfe22f14442f48ae109b2e1bb5fa3b Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Fixes: f5898bd93ff8 (flash/stm32fxx.c: do not read CPUID as this info is stored in cortex_m_common) Reviewed-on: https://review.openocd.org/c/openocd/+/6752 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> * cpld: altera-epm240: Add additional IDCODEs This adds some additional IDCODEs from the datasheet. It also adds support for customizing the tap name. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Change-Id: I7cda10b92c229b61836c12cd9ca410de358ede2e Reviewed-on: https://review.openocd.org/c/openocd/+/6846 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * cpld: altera-epm240: Increase adapter speed According to the datasheet, the minimum clock period with Vccio1 = 1.5V (the lowest voltage supported) is 143ns, or around 6MHz. Set the default adapter speed to 5 MHz. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Change-Id: I21cad33fa7f1e25e81f43b5d2214d1fa4ec924de Reviewed-on: https://review.openocd.org/c/openocd/+/6847 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * target: Add support for ls1088a The LS1088A is an octo-core aarch64 processor from NXP in the layerscape family. The JTAG is undocumented, but I was able to figure things out from the output of `dap info`. This is the first in-tree example of using the hwthread rtos (as far as I know), so hopefully it can serve as an example to other developers. There are some ETMs, but I was unable to try them out because I got 'invalid command name "etm"' when trying to test things out. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Change-Id: I9b0791d27d8c41170a413a8d86431107a85feba2 Reviewed-on: https://review.openocd.org/c/openocd/+/6848 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * target: ls1088a: Add service processor Normally the service processor is not necessary for debugging. However, if you are using the hard-coded RCW or your boot source is otherwise corrupt, then the general purpose processors will never be released from hold-off. This will cause GDB to become confused if it tries to attach, since they will appear to be running arm32 processors. To deal with this, we can release the CPUs manually with the BRRL register. This register cannot be written to from the axi target, so we need to do it from the service processor target. This involves halting the service processor, modifying the register, and then resuming it again. We try and determine what state the service processor was in to avoid resuming it if it was already halted. The reset vector for the general purpose processors is determined by the boot logation pointer registers in the device configuration unit. Normally these are set using pre-boot initialization commands, but if they are not set then they default to 0. This will cause the CPU to almost immediately hit an illegal instruction. This is fine because we will almost certainly want to attach to the processor and load a program anyway. I considered adding this as an event handler for either gdb-attach or reset-init. However, this command shouldn't be necessary most of the time, and so I don't think we should run it automatically. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Change-Id: I1b725292d8a11274d03af5313dc83678e10e944c Reviewed-on: https://review.openocd.org/c/openocd/+/6850 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * board: Add NXP LS1088ARDB This adds a board file for the NXP LS1088ARDB. This only covers the "primary" JTAG header J55, and not the PCIe header (J91). The only oddity is that the LS1088A and CPLD are muxed by adding/removing a jumper from J48. Unfortunately, it doesn't look like OpenOCD supports this CPLD beyond determining the irlen, so it's not very useful. Those who are interested in experimenting can define CWTAP to access the CPLD, but the default is to access the CPU. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Change-Id: Ia07436a534f86bd907aa5fe2a78a326a27855a24 Reviewed-on: https://review.openocd.org/c/openocd/+/6849 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * gdb_server: fix double free Commit 6541233aa78d ("Combine register lists of smp targets.") unconditionally assigns the output pointers of the function smp_reg_list_noread(), even if the function fails and returns error. This causes a double free from the caller, that has assigned NULL to the pointers to simplify the error handling. Use local variables in smp_reg_list_noread() and assign the output pointers only on success. Change-Id: Ic0fd2f26520566cf322f0190780e15637c01cfae Fixes: 6541233aa78d ("Combine register lists of smp targets.") Reported-by: Michele Bisogno <michele.bisogno.ct@renesas.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6852 Tested-by: jenkins Reviewed-by: Michele Bisogno <michele.bisogno.ct@renesas.com> Reviewed-by: Tim Newsome <tim@sifive.com> * gdb_server: check target examined while combining reg list Commit 6541233aa78d ("Combine register lists of smp targets.") assumes that all the targets in the SMP cluster are already examined and unconditionally call target_get_gdb_reg_list_noread() that will in turn return error if the target is not examined yet. Skip targets not examined yet. Add an additional check in case the register list cannot be built, e.g. because no target in the SMP cluster is examined. This should never happen, but it's better to play safe. Change-Id: I8609815c3d5144790fb05a870cb0c931540aef8a Fixes: 6541233aa78d ("Combine register lists of smp targets.") Reported-by: Michele Bisogno <michele.bisogno.ct@renesas.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6853 Tested-by: jenkins Reviewed-by: Michele Bisogno <michele.bisogno.ct@renesas.com> Reviewed-by: Tim Newsome <tim@sifive.com> * flash/stm32l4x: fix maybe-uninitialized compiler error using gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 we get: error: ‘retval’ may be used uninitialized in this function fixes: 13cd75b6ecfd (flash/nor/stm32xx: fix segfault accessing Cortex-M part number) Change-Id: I897c40c5d2233f50a5385d251ebfa536023e5cf7 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6861 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * Fix build. Change-Id: Ia60246246dd859d75659a43d1c59588dbb274d46 Signed-off-by: Tim Newsome <tim@sifive.com> Co-authored-by: Hans-Erik Floryd <hans-erik.floryd@rt-labs.com> Co-authored-by: Julien Massot <julien.massot@iot.bzh> Co-authored-by: Pavel Kirienko <pavel.kirienko@gmail.com> Co-authored-by: Zoltán Dudás <zedudi@gmail.com> Co-authored-by: Antonio Borneo <borneo.antonio@gmail.com> Co-authored-by: Jacek Wuwer <jacekmw8@gmail.com> Co-authored-by: Ben McMorran <bemcmorr@microsoft.com> Co-authored-by: Simon Johansson <ampleyfly@gmail.com> Co-authored-by: Tomas Vanek <vanekt@fbl.cz> Co-authored-by: Sean Anderson <sean.anderson@seco.com> Co-authored-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2022-03-01riscv: implement maskisr steponly command (#681)Erhan Kurubas1-0/+7
* riscv: implement maskisr steponly command Change-Id: I1a3b666d466b064460c3acc307a36485ce165601 Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> * riscv: restore triggers and irq mask inside step function Change-Id: I4e1b0665f4f2f75e42a6191c61634bdfa19ae2fb Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> * doc: update for riscv set_maskisr command Change-Id: Ia7d3a6df846cfc4568d79558f719e93f038aee9b Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
2022-02-14Cadence virtual debug interface (vdebug) integrationJacek Wuwer1-0/+41
Change-Id: I1bc105b3addc3f34161c2356c482ff3011e3f2cc Signed-off-by: Jacek Wuwer <jacekmw8@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6097 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-02-05semihosting: User defined operation, Tcl command exec on hostZoltán Dudás1-0/+27
Enabling a portion (0x100 - 0x107) of the user defined semihosting operation number range (0x100 - 0x1FF) to be processed with the help of the existing target event mechanism, to implement a general-purpose Tcl interface for the target available on the host, via semihosting interface. Example usage: - The user configures a Tcl command as a callback for one of the newly defined events (semihosting-user-cmd-0x10X) in the configuration file. - The target can make a semihosting call with <opnum>, passing optional parameters for the call. If there is no callback registered to the user defined operation number, nothing happens. Example usage: Configure RTT automatically with the exact, linked control block location from target. Signed-off-by: Zoltán Dudás <zedudi@gmail.com> Change-Id: I10e1784b1fecd4e630d78df81cb44bf1aa2fc247 Reviewed-on: https://review.openocd.org/c/openocd/+/6748 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-01-28Merge branch 'master' into from_upstreamTim Newsome2-15/+30
Change-Id: I61e24edbdeceddba265514fd7e0a489ec23e2a4c
2022-01-22jtag: Add an option to ignore the bypass bitAdrien Grassein1-0/+4
Some CPU wrongly indicate the bypas bit in the codeid. It's the case of the NanoXplore NG-ULTRA chip that export a configurable (and potentially invalid) ID for one of its component. Add an option to ignore it. Signed-off-by: Adrien Grassein <adrien.grassein@gmail.com> Change-Id: Ic59743f23bfc4d4e23da0e8535fec8ca9e87ff1a Reviewed-on: https://review.openocd.org/c/openocd/+/6802 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2022-01-22doc: use the new jimtcl syntax for 'expr'Antonio Borneo2-12/+14
With jimtcl 0.81 the syntax of the TCL command 'expr' requires the multiple arguments to be within curly brackets. Update the examples in the documentation to follow the new syntax. While there, split one example to avoid it to exceed the line size during pdf document generation. Change-Id: I91cca419f8273415ccb0c2ce369fc6ac476e34e5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6809 Tested-by: jenkins
2022-01-05flash/nor/efr32: fixed lockbits and user dataDoug Brunner1-3/+12
Changed flash driver to support writing to the user data page, as well as to any portion of the lockbits page above 512 bytes (the amount used for the actual page lock words). The top part of the lockbits page is used on at least the EFR32xG1 chips for the SiLabs bootloader encryption keys. As presented to the user, the lockbits page is the same size as the other pages, but any attempt to write to its low 512 bytes is an error. To enforce this, efr32x_write is renamed to efm32x_priv_write and a wrapper function is provided in its place. If the user erases the lockbits page, the driver rewrites the cached lock words after the erase. When the driver erases the lockbits page in order to update the lock words, it first takes a copy of anything stored in the top part of the page, and re-programs it after the erase operation. There are now multiple instances of flash_bank for each target, and the flash_bank instances must share their cached lock words to operate as intended. Therefore, when a bank is created, the global flash bank list is used to find any other banks that share the same target. Since some banks in the global list are invalid at the time free_driver_priv is called, reference counting is used to decide when to free driver_priv. To avoid the need to find the lockbits flash_bank from another flash_bank, efm32x_priv_write and efm32x_erase_page now take an absolute address. There didn't seem to be any reason to prohibit unprotecting individual flash pages, so that limitation is removed from efm32x_protect(). This addresses ticket #185. Valgrind-clean, except for 2x 4kiB not freed/still reachable blocks that were allocated by libudev. No new Clang analyzer warnings, no new sanitizer warnings. Signed-off-by: Doug Brunner <doug.a.brunner@gmail.com> Change-Id: Ifb22e6149939d893f386706e99b928691ec1d41b Reviewed-on: https://review.openocd.org/c/openocd/+/6665 Tested-by: jenkins Reviewed-by: Fredrik Hederstierna <fredrik.hederstierna@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-12-28Merge branch 'master' into from_upstreamTim Newsome1-25/+150
Conflicts: doc/openocd.texi src/flash/nor/fespi.c Change-Id: Iaac61cb6ab8bba9df1d4b9a52671a09163eb50b2
2021-12-24Document how vector registers are exposed to gdb.Tim Newsome1-0/+37
See https://github.com/riscv/riscv-openocd/pull/570 Change-Id: Ie7cdef3717e107a9df0b48316cfbc547dea9a7fd Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6776 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-11doc: Updated RISC-V memory-related cmds in documentationJan Matyas1-3/+21
- "riscv set_prefer_sba" - removed from the doc, superseded by the latter - "riscv set_mem_access" - new command, new entry added into the doc This change only addresses the documentation. The corresponding implementation of the RISC-V commands is already merged. Change-Id: I3c07672cde94324407cf667504dba5402f63a543 Signed-off-by: Jan Matyas <matyas@codasip.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6743 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2021-12-11doc: Update doc for commands "riscv expose_csrs" and "riscv expose_custom"Jan Matyas1-8/+38
These commands were extended/improved in the last drop of RISC-V target updates. Update also the documentation to properly describe how the commands should be used now. Change-Id: I9e2ba6adbe1a4c032b96f5f8ff2d4791fa4c2527 Signed-off-by: Jan Matyas <matyas@codasip.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6738 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tim Newsome <tim@sifive.com>
2021-12-11doc/openocd.texi: Document find and ocd_find commandYasushi SHOJI1-0/+10
Document both find and ocd_find command under Config File Guidelines -> Interface Config Files. find command is used in the previous section as well but the previous section is more about using OpenOCD. The section added is "aimed at any user who needs to write a config file". Change-Id: I698207fe58d564c615a15b50756aa5547a5f40b7 Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6737 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-11doc/openocd.texi: Document command mode commandYasushi SHOJI1-0/+13
Document "command mode" command Server Configuration -> Configuration Stage. The text is taken from command's help string. In addition to the help string, this commit explain the words mismatch, the doc uses "stage" but the command and source code uses "mode" to describe the same thing. Change-Id: I1d5fc8c64a3a0b07ea8430bf016bcbd54e52da1c Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6736 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-11doc: document noinit commandTomas Vanek1-0/+7
Change-Id: I915c7d3231935fd44407b5fa65d86d4cb93e8db5 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6761 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-11doc: list internal commands called by initTomas Vanek1-1/+12
Change-Id: I5534c94a983906533a1b38c30ec3eb982e62dee7 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6760 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-03doc/openocd.texi: Document usage commandYasushi SHOJI1-0/+7
Document usage command under General Commands -> Server Commands. The text is taken from the command's help string. Change-Id: I957cb46cca98181c3c5e676228c5c103e47bb655 Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6735 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-03doc/openocd.texi: Document add_help_text and add_usage_textYasushi SHOJI1-0/+8
Document add_help_text and add_usage_text under Genral Commands -> Misc Commands. The text are taken from command's help strings. Change-Id: I2bbbee8e5faa8d9654227c304e0528f5144275e8 Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6734 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-03doc: document 'cmsis-dap cmd' commandTomas Vanek1-0/+10
Change-Id: I90b7f020ee2bf078fdf22e3d21423f333ae061ac Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6732 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-03doc: fix list of supported nRF52 devicesTomas Vanek1-3/+5
Change-Id: I64d6d851dd9333689556b7062b1ff38d41b5ad32 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6731 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-03doc: document 'atsamv gpnvm' commandTomas Vanek1-0/+15
Change-Id: I922c75e2d074447558f85bfda5421aa24a850be1 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6729 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-03doc: mention SWD multidropTomas Vanek1-0/+12
Change-Id: I361dc351c407b67613eadef4d29e27ed0e00bd05 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6744 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2021-11-30Merge branch 'master' into from_upstreamTim Newsome1-84/+63
Merged 1ad6ed38b6da09b1d5d9e56d1344fced2dce12bc Conflicts: src/rtos/rtos_standard_stackings.c Change-Id: Ica8109135de0f9aa87455353a4538b161b844b04
2021-11-28drivers: call adapter_get_required_serial() in jtag_libusb_open()Antonio Borneo1-1/+2
Now that adapter serial is handled independently from the adapter drivers, move inside jtag_libusb_open() the call to adapter_get_required_serial(), so every adapter that uses libusb will automagically get USB serial support. Extend the documentation to list the adapters involved. Change-Id: I75b3482d38f8ed3418329f3106c5e8b689fd460b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6663 Tested-by: jenkins
2021-11-28jtag/hla, jtag/stlink: switch to command 'adapter serial'Antonio Borneo1-11/+1
The driver hla defines the command 'hla_serial' to specify the serial string of the adapter. The driver st-link defines the command 'st-link serial' to specify the serial string of the adapter. Remove and deprecate the driver commands and use 'adapter serial'. Change-Id: I9505c398a77125b1ebf4ba71da7baf4d663b75be Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6657 Tested-by: jenkins
2021-11-28jtag/jlink: switch to command 'adapter serial'Antonio Borneo1-8/+2
The driver jlink defines the command 'jlink serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Note: in former code the commands 'jlink serial' and 'jlink usb' were mutually exclusive; running one of them would invalidate the effect of a previous execution of the other. The new code gives priority to 'adapter serial', even if executed before 'jlink usb'. Change-Id: I920b0c136716f459b6fd6f7da8a01a7fa1ed389f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6656 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2021-11-28jtag/xds110: switch to command 'adapter serial'Antonio Borneo1-7/+2
The driver xds110 defines the command 'xds110 serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Note: the original command 'xds110 serial' used a complex and undocumented conversion of the serial number through multibyte string, wide-character string and C cast. The XDS110 I can access and the lsusb dumps available through Google don't show any exotic USB serial that require such conversion. The original developer doesn't remember any constraint that mandates such conversion (see comments in https://review.openocd.org/4322/). The conversion is removed by this patch. Change-Id: I38909918079b2c1797ad85ebec2fea1b33743606 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6655 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2021-11-28jtag/vsllink: switch to command 'adapter serial'Antonio Borneo1-2/+2
The driver vsllink defines the command 'vsllink usb_serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: Iadcc018b8aa8974ccd7156915b84e58270fad29d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6654 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2021-11-28jtag/presto: switch to command 'adapter serial'Antonio Borneo1-5/+2
The driver presto defines the command 'presto serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: I1a69acce7d4910082d2029d5941ae84f9424314c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6653 Tested-by: jenkins
2021-11-28jtag/kitprog: switch to command 'adapter serial'Antonio Borneo1-7/+2
The driver kitprog defines the command 'kitprog_serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: I844cb815af01137392b6d12e1b5972fc77ac092d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6652 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2021-11-28jtag/ftdi: switch to command 'adapter serial'Antonio Borneo1-11/+2
The driver ftdi defines the command 'ftdi serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: Ia5b1f325b9fab8f58b5ea70f8b807e50b148b939 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6651 Tested-by: jenkins
2021-11-28jtag/ft232r: switch to command 'adapter serial'Antonio Borneo1-8/+2
The driver ft232r defines the command 'ft232r serial_desc' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: I0bd909923a668420604fed3c9f6a260716b044c7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6650 Tested-by: jenkins
2021-11-28jtag/cmsis_dap: switch to command 'adapter serial'Antonio Borneo1-7/+3
The driver cmsis_dap defines the command 'cmsis_dap_serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: I88e2d4de360a6c6f23529bb18494962a267250df Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6649 Tested-by: jenkins
2021-11-28jtag/adapter: add command 'adapter serial'Antonio Borneo1-0/+8
Several adapter define their own command to specify the USB serial number or serial string to be used during USB search. Define a general command 'adapter serial' to be proposed as replacement of the driver specific ones. No driver is changed so far to use it. Change-Id: I7631687a4163ccc63a9bdf3ad1fcb300fc483d3a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6647 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2021-11-23doc: fix typos in commands definitionAntonio Borneo1-9/+9
Change-Id: Ie07260f229c6bd227bae0bf3dd97d29bf84c72ec Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6725 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-11-23doc: remove non-existing command readgroupAntonio Borneo1-8/+0
The documentation included it in commit 4e79b48e2c7e ("Add new target type: OpenRISC"), but the command was never added. Remove it! Change-Id: Ice5fa1ee4086b5f5ceb942c3ce68bc9bbd75d19b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 4e79b48e2c7e ("Add new target type: OpenRISC") Reviewed-on: https://review.openocd.org/c/openocd/+/6723 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-11-23doc: remove non-existing command swd wcrAntonio Borneo1-5/+0
The commands has been dropped in commit 150b7d26f213 ("arm_adi_v5: Update DP (Debug Port) registers defined in ADIv5.2.") but the documentation still keeps it. Remove it! Change-Id: I4e88f481d943f064d919f8065562052244122bf0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 150b7d26f213 ("arm_adi_v5: Update DP (Debug Port) registers defined in ADIv5.2.") Reviewed-on: https://review.openocd.org/c/openocd/+/6722 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>