aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2020-11-04target: handle command 'target current' when no target is presentAntonio Borneo1-1/+3
Is it possible to run OpenOCD without any target, for example to only dump the rom-tables of an arm dap, or to perform low level jtag operations. But without any target created, the command 'target current' causes OpenOCD to abruptly exit. Handle in command 'target current' the case of no targets. Change-Id: Ide15cb13bec84b88ccc3e7126523c04a6d70e636 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5881 Tested-by: jenkins
2020-11-04gdb_server: allow multiple GDB connections to selected targetsAntonio Borneo3-4/+28
The default way of working is to have a single GDB attached to one target, so OpenOCD accepts only one connection to the GDB port of each targets and rejects any further connection. There are some barely safe use cases in which it could get useful having a second GDB connection to the same target. One such use case is while using GDB as a 'non-intrusive memory inspector', as explained in the OpenOCD documentation. One GDB can be left running an infinite loop to dump some memory area, or even analysing the content, while keeping a second GDB ready for user interaction or spot memory check. Add a target configure option to specify the maximum number of GDB connections allowed for that target, keeping the default to 1. Change-Id: I4985a602e61588df0b527d2f2aa5b955c93e125e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5865 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-11-04target/arm_cti: use adiv5_jim_mem_ap_spot_configure()Antonio Borneo2-101/+47
To avoid code duplication, reorganize the code to replace cti_configure() with adiv5_jim_mem_ap_spot_configure(). Reorganize 'struct arm_cti_object' and its sub-'struct arm_cti' moving DAP and mem-AP info in a 'struct adiv5_mem_ap_spot'. Replace cti_configure() with adiv5_jim_mem_ap_spot_configure(). Deprecate the use of '-ctibase' in favor of '-baseaddr'. Change-Id: I43740a37c80de67c0f5e4dc79c3400b91a12e9e8 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5869 Tested-by: jenkins
2020-11-04target/arm_adi_v5: add helper to get mem_ap spot in configure/cgetAntonio Borneo2-85/+135
This is somehow an extension of existing adiv5_jim_configure(), but includes the 'address' in the mem_ap. Rewrite adiv5_jim_configure() using the new helper. Change-Id: Ia7effeeece044004d459b45126ed4961a98b8568 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5857 Tested-by: jenkins
2020-11-04jtag/tcl: fix memory leak in error returnTomas Vanek1-0/+5
Clang static analyzer reported: Warning: line 196, column 3 Potential leak of memory pointed to by 'fields' Free allocated memory pointed by 'fields' and fields[i].in_value Change-Id: I0b3935d9a235544afc03e39a4648319047e65815 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5906 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
2020-11-04gdb_server: fix clang static analyzer warningTomas Vanek1-1/+1
Warning: line 373, column 15 Assigned value is garbage or undefined Most probably a false warning, building the hex string byte per byte seems too complicated for static analyze. Change malloc to calloc to silence the warning. Change-Id: I746d43fa51abf05582ccf2680ed72dc557798a7a Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5905 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
2020-11-04helper/command: fix clang static analyzer warningTomas Vanek1-28/+18
Warning: line 955, column 3 Argument to free() is the address of a global variable, which is not memory allocated by malloc() It is definitely a false alarm. Simplify concatenation of arguments and allocate a string always to silence the warning. Change-Id: I5ac4cc610fc35224df0b16ef4f7102700363249f Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5904 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2020-11-04flash/nor/atsamv: fix clang static analyzer warningTomas Vanek1-0/+3
Warning: line 679, column 4 4th function call argument is an uninitialized value Change-Id: If62d96e1595be945c8e17885bb402e820fb1ec7b Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5903 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
2020-10-30jtag: xlnx-pcie-xvc: Declare function staticMoritz Fischer1-1/+1
The xlnx_pcie_xvc_execute_stableclocks() function can and should be static. Change-Id: I45fb1363caee1f1762b0b1ac2c6bc1bb0153b15b Signed-off-by: Moritz Fischer <moritzf@google.com> Reviewed-on: http://openocd.zylin.com/5889 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-30jtag/drivers/stlink_usb: fix SWO prescalerCliff L. Biffle1-6/+6
The config_trace function has an out-parameter for generating the prescaler for the TPIU. The STLink implementation wasn't always writing it, causing the tpiu command to load uninitialized stack memory (minus one) into the TPIU's prescaler register when 'external' was requested. This change ensures that the out-parameter (and the other one, trace_freq, which hadn't caused any buggy behavior for me) are written every time. Signed-off-by: Cliff L. Biffle <cliff@oxide.computer> Change-Id: I222975869b1aa49cc6b1963c79d5ea0f46522b8c Reviewed-on: http://openocd.zylin.com/5656 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-30target: restore last run state after profilingChristopher Head1-1/+13
Now that it’s possible to start profiling from either a running or a halted state, rather than unconditionally halting after profiling finishes, it makes more sense to restore the processor to whatever state (running or halted) it was in before profiling started. Change-Id: If6f6e70a1a365c1ce3b348a306c435c220b8bf12 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/5237 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-30target/cortex_m: reduce duplication in profilingChristopher Head3-47/+24
The Cortex-M implementation of profiling contains a bunch of conditionals and checks to handle both chips which have PCSR and chips which do not. However, the net effect of the non-PCSR branches is actually exactly the same as what target_profiling_default does. Rather than duplicating this code, just detect the situation where PCSR isn’t available and delegate to target_profiling_default. Change-Id: I1be57ac77f983816ab6bf644a3cfca77b67d6f70 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/5236 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-30target: allow profiling from runningChristopher Head2-4/+6
There are a handful of implementations of profiling. There is the default implementation, which repeatedly halts and resumes the target, sampling PC each time. There is the Cortex-M implementation, which uses PCSR if available, otherwise falling back to halting and resuming and sampling PC. There is the OR1K implementation, which reads NPC repeatedly. Finally, there is the NDS32 implementation which uses some kind of AICE commands with which I am unfamiliar. None of these (with the possible exception of the NDS32 implementation) actually require the target to be halted when starting profiling. The Cortex-M and OR1K actually resume the target as pretty much their first action. The default implementation doesn’t do this, but is written in such a way that the target just flips back and forth between halted and running, and the code will do the right thing from either initial state. The NDS32 implementation I don’t know about. As such, for everything except NDS32, it is not really necessary that the target be halted to start profiling. For the non-PCSR Cortex-M and default implementations, there is no real harm in such a requirement, because profiling is intrusive anyway, but there is no benefit. For the PCSR-based Cortex-M and the OR1K, requiring that the target is halted is annoying because it makes profiling more intrusive. Remove the must-be-halted check from the target_profiling function. Add it to the NDS32 implementation because I am not sure if that will break when invoked with a running target. Do not add it to any of the other implementations because they don’t need it. Change-Id: I479dce999a80eccccfd3be4fa192c904f0a45709 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/5235 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-28flash/nor/nrf5: unify size of HWIDTomas Vanek1-5/+6
HWID is a part of 32 bit CONFIGID register. hwid member of struct nrf5_info was typed uint32_t to enable direct CONFIGID read and masked afterwards. Change to uint16_t to unify with hwid in struct nrf5_device_spec and RM description. Change-Id: Ib720d3ce23c301aee41d074ea78a6f00a23aed68 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5589 Tested-by: jenkins
2020-10-28flash/nor/nrf5: improve handling of nRF52 flash errorsTomas Vanek1-2/+2
nRF52 devices indicate a flash error by emitting hard fault exception (unlike nRF51 series). Change error message when NVMC READY read fails. A hard fault from flash erase/write operation is detected here. Check exit point of the flash write algo to ensure a failed write is recognised. Change-Id: I637eda268a6bf45f7f41bcb9dcd82db8f5cb41b4 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5587 Tested-by: jenkins
2020-10-28flash/nor/nrf5: check protection before flash erase/write on nRF51Tomas Vanek1-48/+98
nRF51 devices have a clumsy flash protection based on UICR CLENR0. A code running in RAM can write to a protected flash region without any hint the protection gets violated. NVMC flash page erase obeys protection setting but fails absolutely silently. Before this change the first problem was not addressed in the code. To justify the second one, protection was loaded during probe, after protection setting and after a mass erase. Move protection updates to the beginning of erase/write operation and limit them to nRF51 series only. Check for protected sectors before write. The change also fixes the problem of 'nrf5 mass_erase' on nRF52833/840 devices. They use ACL flash protection, which is not supported in nrf5 driver. mass_erase then looked like it failed. Change-Id: Ie58cda68eb104d410b02777c3df5b343408e2666 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5522 Tested-by: jenkins
2020-10-28flash/nor/nrf5: fix protection setting on nRF51Tomas Vanek1-26/+50
Protection setting has not ever worked. UICR CLENR0 register cannot be simply written but has to programmed because it resides in UICR page of the flash. Enable flash programming before writing CLENR0 and set back to r/o afterwards. Inform the user that reset might be required. Change-Id: Ib0f96c74ba3583ac33f4394ddb57d8c8895adf53 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5586 Tested-by: jenkins
2020-10-24server/telnet: Handle Ctrl+KBrian Brooks1-1/+11
Handle Ctrl+K shortcut which clears the line from the cursor position to the end of line. Change-Id: I2ecff5284473cef7c11cf9cb7e1c0c97d55f6c1c Signed-off-by: Brian Brooks <brooks.brian@gmail.com> Reviewed-on: http://openocd.zylin.com/5868 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de>
2020-10-24target/arc: introduce watchpoints supportEvgeniy Didin1-3/+165
With help of actionpoint mechanism now it is possible to introduce watchpoints support for ARC. Change-Id: I5887335d0ba38c15c377bc1d24a1ef36e138cf65 Signed-off-by: Evgeniy Didin <didin@synopsys.com> Reviewed-on: http://openocd.zylin.com/5867 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-24Enable hla_serial for TI ICDI devicesJohn Pham1-18/+10
Used jtag_libusb_open from libusb_helper.h instead of libusb_open_device_with_vid_pid to get device handle, as well as managing context, i.e. similar to stlink_usb. Direct calls to libusb1 are left in for the moment. (When this Gerrit revision was originally created, the jtag_libusb_ wrappers did not return error conditions.) Tested w/ a TM4C123GXL board Change-Id: I71e9a366356c125444d4813e58ddd9b6c6498bf0 Signed-off-by: John Pham <jhnphm@gmail.com> Signed-off-by: Matthew Trescott <matthewtrescott@gmail.com> Reviewed-on: http://openocd.zylin.com/2527 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-22flash/stm32l4: add support of STM32G4 category 4 devices (G491/G4A1)Tarek BOCHKATI1-1/+18
STM32G4 cat.4 devices are up to 512 KB of flash memory (single bank) organized into pages of 2KB each. Reference: RM0440 rev.4 Change-Id: I0f510e2806c8f824fff8083e2d4f90d68f01046b Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5793 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-10-22cortex_m: support control.FPCASylvain Chouleur3-7/+7
Bit 2 of control register is used if the processor includes the FP extension Change-Id: Ie21bc9de8cae5bad9d841e1908eff3aa0bb29d4b Signed-off-by: Sylvain Chouleur <schouleur@graimatterlabs.ai> Reviewed-on: http://openocd.zylin.com/5853 Reviewed-by: Sylvain Chouleur <sylvain.chouleur@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-10-14riscv: fix compile errorAntonio Borneo1-2/+2
The commit b68674a1da72 ("Upstream tons of RISC-V changes.") was proposed well before commit 3ac010bb9f10 ("Fix debug prints when loading to flash"), but the merge got in different order. After latest merge, the master branch fails to compile. Fix the compile error. Change-Id: Ia3bd21d970d589343a3b9b2d58c89e0c49f30015 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5856 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins Reviewed-by: Jan Matyas <matyas@codasip.com>
2020-10-14Upstream tons of RISC-V changes.Tim Newsome15-2659/+7227
These are all the changes from https://github.com/riscv/riscv-openocd (approximately 91dc0c0c) made just to src/target/riscv/*. Some of the new code is disabled because it requires some other target-independent changes which I didn't want to include here. Built like this, OpenOCD passes: * All single-RV32 tests against spike. * All single-RV64 tests against spike. * Enough HiFive1 tests. (I suspect the failures are due to the test suite rotting.) * Many dual-RV32 (-rtos hwthread) against spike. * Many dual-RV64 (-rtos hwthread) against spike. I suspect this is an overall improvement compared to what's in mainline right now, and it gets me a lot closer to getting all the riscv-openocd work upstreamed. Change-Id: Ide2f80c9397400780ff6780d78a206bc6a6e2f98 Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/5821 Tested-by: jenkins Reviewed-by: Jan Matyas <matyas@codasip.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-10-14flash/nor/at91sam4: ATSAMG55x19 Rev.BBenedikt-Alexander Mokroß1-2/+70
Add support for ATSAMG55x19 Rev.B. Both chips have nearly the same cidr, however, Rev.B has an incremented version. Change-Id: I5939c41fa5d54c4d3bfb850964974b878f709d13 Signed-off-by: Benedikt-Alexander Mokroß <mokross@gessler.de> Reviewed-on: http://openocd.zylin.com/5825 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2020-10-11target/aarch64: fix use of 'target->private_config'Antonio Borneo1-0/+5
The function adiv5_jim_configure() casts the void pointer 'target->private_config' to a struct adiv5_private_config pointer. This is tricky in case of aarch64, where the private data are in a struct aarch64_private_config that has as first element the struct adiv5_private_config. While the current solution is working fine, it's not clean and requires special attention for any further code development. Override 'target->private_config' to the correct pointer while calling adiv5_jim_configure(). Change-Id: Ic2fc047dd1e57013943d96e6d5879a919d1eb7b3 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5847 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-10-11target/aarch64: Use apnum settingKevin Yang1-10/+14
Change aarch64 to use ap-num setting if provided. Fall back to original behavior of using first AP when ap-num is invalid. Change-Id: I0d3624f75c86ba5fd5a322ac60856dbbb6e71eaf Signed-off-by: Kevin Yang <kangyang@google.com> Reviewed-on: http://openocd.zylin.com/5831 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-03drivers/jlink: fix (again) calculate_swo_prescaler formulaAntonio Borneo1-2/+1
The prescaler computation should round at the nearest integer value, not to the next integer value. Change-Id: I957e0774421211f3c4ba4b312738b1c67b87c4a2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 051e80812b1b ("drivers/jlink: fix calculate_swo_prescaler formula") Reviewed-on: http://openocd.zylin.com/5846 Tested-by: jenkins Reviewed-by: Adrian M Negreanu <adrian.negreanu@nxp.com>
2020-10-03Update user dir config file search pathAndreas Fritiofson1-22/+58
Search in XDG_CONFIG_HOME as per XDG Base Directory Specification in addition to $HOME/.openocd. On Darwin, search in ~/Library/Preferences/org.openocd/ which appears to be one of the conventional locations. Make $OPENOCD_SCRIPTS highest priority on all platforms, previously it was only higher on WIN32. Update the documentation to reflect the search order. Change-Id: Ibaf4b59b51fdf452712d91b47ea2b5312bb5ada9 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3890 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-03FreeRTOS: strip duplicate line returnsKarl Palsson1-10/+10
Log lines already print a new line, so these superfluous \r\n result in blank lines being printed in the log. Remove per review comment request. Change-Id: I8f5b20776634cf70ce4490fc4f732c916130928a Signed-off-by: Karl Palsson <karlp@etactica.com> Reviewed-on: http://openocd.zylin.com/5843 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2020-10-03FreeRTOS: properly read on big endian systems.Karl Palsson1-42/+41
Remember, don't cast your pointers between types of different sizes! While the FreeRTOS handlers attempt to account for different pointer and list widths, the types used are always fixed, so this will _remain_ broken if/when someone targets FreeRTOS on 8/16/64 bit targets. (Note that this patch does not _change_ that, it was fixed to 32bit before as well) In the meantime, this properly handles 32bit reads on a mips BE system (ath79) as well as remaining fully functional on x86_64. Change-Id: I677bb7130e25dccb7c1bee8fabaee27371494d00 Signed-off-by: Karl Palsson <karlp@etactica.com> Reviewed-on: http://openocd.zylin.com/5842 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2020-10-03ARM|Driver: Add DPI Driver for emulationKevin Burke3-0/+418
This driver provides support for Cadence JTAG BFM The "jtag_dpi" driver implements a JTAG driver acting as a client for the SystemVerilog Direct Programming Interface (DPI) for JTAG devices. DPI allows OpenOCD to connect to the JTAG interface of a hardware model written in SystemVerilog, for example, on an emulation model of target hardware. Tested on Ampere emulation with Altra and Altra Max models Change-Id: Iaef8ba5cc1398ee2c888f39a606e8cb592484625 Signed-off-by: Kevin Burke <kevinb@os.amperecomputing.com> Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com> Reviewed-on: http://openocd.zylin.com/5573 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-03target/cortex_m.c: vector_catch command checks if a target is examinedDaniel Trnka1-0/+5
If a target is not examined, command vector_catch crashes while accessing the debug_ap NULL pointer. maskisr and reset_config commands don't require this check. Change-Id: I949b6f6e8b983327dd98fbe403735141f8f0b5d6 Signed-off-by: Daniel Trnka <daniel.trnka@gmail.com> Reviewed-on: http://openocd.zylin.com/5813 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-10-03target/aarch64: a64 disassemblerMete Balci4-1/+218
Add A64 (AArch64) Disassembler using Capstone framework. Change-Id: Ia92b57001843b11a818af940a468b131e42a03fd Signed-off-by: Mete Balci <metebalci@gmail.com> [Antonio Borneo: Rebased on current HEAD] Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5004 Tested-by: jenkins
2020-09-27drivers/jlink: fix calculate_swo_prescaler formulaAdrian Negreanu1-7/+5
a) TPIU_ACPR is defined as: SWO_baudrate = TRACECLKIN/(TPIU_ACPR +1) b) TPIU_ACPR is set by armv7m_trace_tpiu_config() target_write_u32(target, TPIU_ACPR, Prescaler-1), so TPIU_ACPR = Prescaler-1 Replacing TPIU_ACPR in a), we get: SWO_baudrate = TRACECLKIN/Prescaler, so c) Prescaler = TRACECLKIN/SWO_baudrate The Prescaler calculated by calculate_swo_prescaler() is greater by 1: Prescaler = TRACECLKIN/SWO_baudrate + 1 The second problem is that even in situations when an exact baudrate match is possible, the resulting TRACECLKIN/Prescaler already has a 3% deviation. For example, TRACECLKIN=88000000, SWO_baudrate=500000, calculate_swo_prescaler will return Prescaler=171. The correct value should be Prescaler=176 (TPIU_ACPR=175). Might be related to https://sourceforge.net/p/openocd/tickets/263/ Change-Id: Ib4d6df6e34685a9be4c2995cb500b2411c76e39b Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com> Reviewed-on: http://openocd.zylin.com/5807 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-09-27Add support of STM32H72x/73x 1M (0x483)Tarek BOCHKATI1-2/+23
STM32H72x/73x flash is similar to STM32H74x/75x, except STM32H72x/73x devices have only one single flash bank. Change-Id: I3d3422dc60234f8273172924f426200210f388cc Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5792 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-09-27Use capstone for ARM disassemblerMarc Schink4-1615/+112
Change-Id: I1c9bf3f8178d4a06babe23a918e4411833ebc418 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/4812 Tested-by: jenkins Reviewed-by: Fredrik Hederstierna <fredrik@hederstierna.com> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-09-20cortex_m: add detection of Cortex M35P and M55Tarek BOCHKATI2-3/+9
Change-Id: I52599b2b09c2dc50c95d64059213c832d380ea31 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5799 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-09-20cortex_m: read and display core security stateTarek BOCHKATI3-1/+25
Change-Id: I0fce3c66af7e98df2dc2258daf0d6af661e29ae7 Signed-off-by: Laurent LEMELE <laurent.lemele@st.com> Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5798 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-09-20armv8-m: add SecureFault exceptionTarek BOCHKATI3-1/+12
Change-Id: I4e1963631e834b6334bc917e956c2db4464b7b08 Signed-off-by: Laurent LEMELE <laurent.lemele@st.com> Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5797 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-09-05target: avoid checking for non NULL pointer to free itAntonio Borneo11-87/+43
The function free() can be called with a NULL pointer as argument, no need to check the argument before. If the pointer is NULL, no operation is performed by free(). Remove the occurrences of pattern: if (ptr) free(ptr); In target/openrisc/jsp_server.c, an error is logged if the ptr was already NULL. This cannot happen since the pointer was already referenced few lines before and openocd would have been already SIGSEGV in that case, so remove the log. Change-Id: I290a32e6d4deab167676af4ddc83523c830ae49e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5809 Tested-by: jenkins
2020-09-05drivers/buspirate: remove empty lines at end of fileAntonio Borneo1-2/+0
Change split from http://openocd.zylin.com/5172/ to avoid conflicts with other pending changes in gerrit. Change-Id: Id3e21c92b3da7ddce7b00664280da2143c06f172 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5604 Tested-by: jenkins
2020-09-05jtag: avoid checking for non NULL pointer to free itAntonio Borneo23-122/+60
The function free() can be called with a NULL pointer as argument, no need to check the argument before. If the pointer is NULL, no operation is performed by free(). Remove the occurrences of pattern: if (ptr) free(ptr); Change-Id: I2938e333bd1eac5218bd67aefb9d8f373da017a8 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5810 Tested-by: jenkins
2020-09-05openrisc: Fix segv jsp due to free of unallocated dataStafford Horne1-6/+0
The prompt pointer in the jtag serial port is never zero'd or allocated. Completely remove it since there is not much use for it as the target software will provide the actual prompt. Change-Id: Id95d8ccb9f725e53b9d03386b11d91eba1cd6ef4 Signed-off-by: Stafford Horne <shorne@gmail.com> Reviewed-on: http://openocd.zylin.com/4093 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-09-05openocd: fix command's usage stringAntonio Borneo4-7/+7
The usage string should contain only the command parameters. OpenOCD will automatically prepend the command name to the usage string while dumping the usage or help message. Remove the repeated command name from the usage string. Change-Id: If10a0f1c254aee302b9ca08958390b7f21cdb21b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5824 Tested-by: jenkins
2020-09-05jtag/aice: fix command's usage stringAntonio Borneo1-13/+13
The usage string should contain only the command parameters. OpenOCD will automatically prepend the command name to the usage string while dumping the usage or help message. Remove the repeated command name from the usage string. Change-Id: Idbc301b34fab19e221131d232577c1629568e6ea Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5823 Tested-by: jenkins
2020-09-05target/arc: fix command's usage stringAntonio Borneo1-10/+10
The usage string should contain only the command parameters. OpenOCD will automatically prepend the command name to the usage string while dumping the usage or help message. Remove the repeated command name from the usage string. Change-Id: I691094a6395acb0e4ea3bea2347ff38379002464 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5822 Tested-by: jenkins
2020-09-05openocd: use proper format with uint32_tAntonio Borneo5-14/+14
Modify the format strings to properly handle uint32_t data types. Change-Id: I4de49bf02c9e37b72240224c23fc83abe8a4fa83 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5819 Tested-by: jenkins
2020-09-05target: use proper format with uint32_tAntonio Borneo30-121/+121
Modify the format strings to properly handle uint32_t data types. While there, fix prototype mismatch between header and C file of the function armv7a_l1_d_cache_inval_virt(). Change-Id: I434bd241fa5c38e0c15d22cda2295097050067f5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5818 Tested-by: jenkins
2020-09-05flash: use proper format with uint32_tAntonio Borneo38-142/+141
Modify the format strings to properly handle uint32_t data types. Change the type of variable retval in 'nor/ambiqmicro.c' to match both the value to carry and the returned type of the function. Fix the prototype mismatch of function lpc2900_address2sector() between the header and the C file. Change-Id: I68ffba9bd83eec8132f83bff3af993861fd09d84 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5816 Tested-by: jenkins