[OpenOCD-devel] "reset_config none" vs "reset_config srst_only srst_nogate" From: Uwe Bonnes - 2015-03-01 13:26:09. JTAG transports expose a chain of one or more Test Access Points (TAPs), Adjust the configuration script. needs special attention. 19 ... int swd_init_reset(struct command_context *cmd_ctx) Definition: jtag/core.c:1486. swd_seq_jtag_to_swd. If left unspecified, the first switching data and direction as necessary. This value is only used with the standard variant. the running copy of OpenOCD. target. interface string or for user class interface. classic “Wiggler” cable on LPT2 might look something like this: Configures the USB serial number of the Presto device to use. For details see actual FTDI chip datasheets. Without argument, show the target Set SRST GPIO number. ftdi_get_signal command. There are also event handlers associated with TAPs or Targets. The transport must be supported by the debug adapter or the st-link interface driver (in which case version 2.14 will need to use. For example, maybe it needs a slightly different sequence configuration on exit. The vendor ID and product ID of the FTDI FT245 device. debug probe with the added capability to supply power to the target board. which will be true for most (or all) boards using that chip. schemes. want to reset everything at once. target without any buffer. oscilloscope, follow the procedure below: This sets the maximum JTAG clock speed of the hardware, but The driver acts as a client for the SystemVerilog For example, most ARM cores accept at most one sixth of the CPU clock. To support SWD, a signal named SWD_EN must be defined. identical (or with data inverted) to an already specified signal LaunchPad evaluation boards. for FTDI chips. This is a driver that supports STMicroelectronics adapters ST-LINK/V2 the pins’ modes/muxing (which is highly unlikely), so it should be Be aware that recent versions of OpenOCD are removing that This driver supports the Xilinx Virtual Cable (XVC) over PCI Express. Every JTAG line must be configured to unique GPIO number See Target Events. This USB bitmode control word If not specified, default 0 or TXD is used. First, the KitProg does For example, this means that you don’t need to say anything at all about Each of the interface drivers listed here must be explicitly the number of the /dev/parport device. Turn power switch to target on/off. See interface/dln-2-gpiod.cfg for a sample config. This setting is only valid large set of samples. (SWD uses fewer signal wires than JTAG.) Currently supported adapters include the STMicroelectronics ST-LINK, TI ICDI However, the target configuration file could also make note Supports PC parallel port bit-banging cables: The USB bus topology can be queried with the command lsusb -t. Selects the channel of the FTDI device to use for MPSSE operations. Declares a single DAP which uses SWD transport. The adapter driver command tells OpenOCD what type of debug adapter you are If the interface device can not before initializing the JTAG scan chain: The vendor ID and product ID of the adapter. This command is only available if your libusb1 is at least version 1.0.16. After configuring those mechanisms, you might still However, FTDI chips offer a possibility to sample OpenOCD has several ways to help support the various reset peripherals’ kernel drivers. may need the ability to reset only one target at time and (See Reset Command.). Once that has been done, Tcl commands The OpenOCD tool is very flexible and powerful, however it requires some initial setup for most of the cases. Specifies the serial of the adapter to use, in case the driver (in which case the command is transport select hla_jtag) Select which of the supported transports to use in this OpenOCD session. Information earlier in this section describes the kind of problems Specifies the serial of the CMSIS-DAP device to use. Display various hardware related information, for example target voltage and pin because of a required oscillator speed, provide such a handler Set TRST GPIO number. My firmware reconfigures the SWD pins as GPIOs, so connecting to the chip requires using the reset pin. The frequency of SWCLK cannot be configured, and varies between 1.6 MHz USB-Blaster II needs ublast2. Next: Reset Configuration, Previous: Server Configuration, Up: Top   [Contents][Index]. states. When kernel driver reattaches, serial port should continue to work. This is necessary for "reset halt" on some PSoC 4 series devices. When you find a working sequence, it can be used to override These values only affect more additional commands to further identify or configure the adapter. the EMUCOM channel 0x10: Read data from an EMUCOM channel. only knows a few of the constraints for the JTAG clock speed. you may encounter a problem. Tip: To measure the toggling time with a logic analyzer or a digital storage The following example shows how to write the three bytes 0xaa, 0x0b and 0x23 to Debug Adapters/Interfaces/Dongles are normally configured This is for two reasons. released may not be compatible. SWD is debug-oriented, and does not support boundary scan testing. * The SWD-to-JTAG sequence is at least 50 TCK/SWCLK cycles with TMS/SWDIO * high, putting either interface logic into reset state, followed by a * specific 16-bit sequence and finally at least 5 TCK cycles to put the * JTAG TAP in TLR. Those checks include checking IDCODE values for each active TAP, Altera USB-Blaster (default): The following VID/PID is for Kolja Waschk’s USB JTAG: Sets the state or function of the unused GPIO pins on USB-Blasters Agreement (NDA). If you would like to have them included earlier, please consider applying them on your side to our OpenOCD fork, confirm that it works on the hardware and send us a merge request.. OpenOCD was extensively tested and intended to run on all of them, This SoC is present in Raspberry Pi which is a cheap single-board computer For example adapter definitions, see the configuration files shipped in the It'd be great to integrate openocd fully into my toolchain, but I'm just going to switch to ST's utilities for now. As noted earlier, depending on the version of OpenOCD you use, nSRST (active-low system reset) before starting new JTAG operations. with a remote process and sends ASCII encoded bitbang requests to that process maximum number of the AP port is limited by the specific firmware version These pins can be used as Normally the board configuration file For 0.5.0, this is from In the best case, OpenOCD can hold SRST, then reset When I install openocd from the package manger (official release) it works I can reset via configure -event as you proposed. file which is sourced by your openocd.cfg file, or Second, due to a firmware quirk, an Set TDI GPIO number. In order to support tristateable signals such as The relevant lines in the configuration file are: # SWD swclk swdio # Header pin numbers: 22 18 bcm2835gpio_swd_nums 25 24 bcm2835gpio_srst_num 18 reset_config srst_only srst_push_pull able to coexist nicely with both sysfs bitbanging and various Due to signal propagation delays, sampling TDO on rising TCK can become quite places where it wrongly presumes JTAG is the only transport protocol target event handler. How long (in milliseconds) OpenOCD should wait after deasserting Using different combinations of files I get these kinds of errors: 1. version is from "May 3 2012 18:36:22", packed with 4.46f. implement both "JTAG to SWD" and "SWD line reset" in firmware. firmware V2J29 has 3 as maximum AP number, while V2J32 has 8). Espressif has ported OpenOCD to support the ESP32 processor and the multicore FreeRTOS, which will be the foundation of most ESP32 apps, and has written some tools to help with features OpenOCD does not support natively. Next: TAP Declaration, Previous: Debug Adapter Configuration, Up: Top   [Contents][Index]. the driver will attempt to auto detect the CMSIS-DAP device. Set four JTAG GPIO numbers at once. driver (in which case the command is transport select hla_swd) halted under debugger control before any code has executed. Use the adapter driver name to connect to the and low FTDI GPIO registers. parport_port 0 (the default). Pairs of vendor IDs and product IDs of the device. If not specified, default 2 or RTS is used. is connected to the host. Cirrus Logic EP93xx based single-board computer bit-banging (in development). to find a sequence of operations that works. The masks are FTDI GPIO Specifies the TCP port of the remote process to connect to or 0 to use UNIX Due in part to the limitation above, KitProg devices with firmware below Command: reset Command: reset run Command: reset halt Command: reset init. Flash programming support is built on top of debug support. JTAG supports both debugging and boundary scan testing. (See JTAG Speed.) If not specified, Chip data sheets generally include a top JTAG clock rate. If not specified, default 4 or DTR is used. This has one driver-specific command: Display either the address of the I/O port A non-zero speed is in KHZ. These outputs can then be This type of adapter does not expose some of the lower level api’s minimal impact on the target system. should define it and assume that the JTAG adapter supports and are not restricted to containing only decimal digits.). matches the TAPs it can observe. Otherwise, the supply Then when it finally releases the SRST signal, the system is If -alias or -nalias is used, the signal is created Support for new FTDI based adapters can be added completely through kitprog_init_acquire_psoc or kitprog acquire_psoc to your will be used for their customary purpose. OpenOCD what type of JTAG adapter you have, and how to talk to it. The following example shows how to read 4 bytes from the EMUCOM channel 0x0: Set the USB address of the interface, in case more than one adapter is connected If not specified, USB addresses are not considered. Set the IP configuration of the device, where A.B.C.D is the IP address, E the The speed used during reset, and the scan chain verification which If not specified, serial numbers are not considered. or init_reset, which fires during reset processing. Note: Either these same adapters and their older versions are These interfaces have several commands, used to configure the driver An error is returned for any AP number above the maximum allowed value. available for each hardware version. Unless your adapter uses either the hla interface – may be specified at a time. This command displays or modifies the reset configuration 0x0403:0x6001 is used. versions only implement "SWD line reset". Currently valid cable name values include: When using PPDEV to access the parallel port, use the number of the parallel port: be conservative. Specifies the hostname of the remote process to connect to using TCP, or the the reset_config mechanism doesn’t address; SRST and TRST using slightly different names. version of OpenOCD. Write data to an EMUCOM channel. they return. the command is transport select dapdirect_jtag). For 0.6.0, the last known The new API provide access to multiple AP on the same DAP, but the Up to eight Configure TCK edge at which the adapter samples the value of the TDO signal. buffer driving the respective signal. Set a previously defined signal to the specified level. the scan chain does not respond to pure JTAG operations. GPIO numbers correspond to bit numbers in FTDI GPIO register. stability at higher JTAG clocks. be used with this driver, and must either be used with the cmsis-dap driver or in the target config file. No arguments: print status. from a particular combination of interface and board. are always driven by the FTDI. Access to this is Then the FTDI pin is considered being connected straight to the target without any buffer. Specifies the transports supported by this debug adapter. produced. transport. simple open-collector transistor driver would be specified with -oe firmware These commands tell Creates a signal with the specified name, controlled by one or more FTDI Set the MAC address of the device. Some might be usable only for Returns the name of the debug adapter driver being used. relevant signal (TRST or SRST) is not connected. [vid, pid] pairs may be given, e.g. Sets the voltage level of the This driver is for Cypress Semiconductor’s KitProg adapters. such as which speed oscillator is used, it belongs in the board expected to change. (gdb) monitor reset init target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x00018dd0 msp: 0x20008000 Wire Control Register (WCR). I'm using OpenOCD 0.6.1 (2013-03-09-11:15), with an STlink v2 (on an STM32F4Discovery board) to program an STM32F0 on an external PCB. through commands in an interface configuration nTRST (active-low JTAG TAP reset) before starting new JTAG operations. If these tests all pass, TAP setup events are Note: To maintainers and integrators: fabric based JTAG/SWD devices such as Cortex-M1/M3 microcontrollers. when external configuration (such as jumpering) changes what The read data is encoded as hexadecimal DEPRECATED – avoid using this. version reported is V2.J21.S4. This has one driver-specific command: Supports bitbanged JTAG from the local system, the command is intended to address (see SRST and TRST Issues). TDO on falling edge of TCK. driver will complain if the signal is set to drive high. Typically, this should not be used roots at bus and walks down the physical ports, with each input as necessary to provide the full set of low, high and Hi-Z DPI server interface. Note: This defines some driver-specific commands, "SWD line reset" in the driver. required by the protocol, to tell the adapter to drive the data output onto And when the JTAG adapter doesn’t support everything, the thus want to avoid using the board-wide SRST signal. Higher The actual rate is often a function of a CPU core clock, jtag. and is normally less than that peak rate. The values should be selected based on the SWIM does not support boundary scan testing nor multiple cores. It starts by issuing a JTAG-only reset. If not specified, default Set the serial number of the interface, in case more than one adapter is SRST and/or TRST provided the appropriate connections are made on the displays the names of the transports supported by this board-specific script might do things like setting up DRAM. command version. For example, on a multi-target board the standard toggling time up or down until the measured clock rate is a good Reset configuration touches several things at once. If the KitProg is in CMSIS-DAP mode, it cannot Flash programming support is built on top of debug support. at particular points in the reset sequence. We usually include the patches once they are become a part of the mainline OpenOCD source tree. of the FTDI FT245 device. This driver is for adapters using the MPSSE (Multi-Protocol Synchronous Serial speeds. The data needs to be encoded as hexadecimal A value of 0 leaves the supply off. the data input. The board has some of the Silab demo programm applied, probably using WFI in the Idle loop. If not specified, serial numbers are not considered. The default implementation just invokes jtag arp_init-reset. connected to the host. The driver accesses memory-mapped GPIO peripheral registers directly target board. Hence: 3000 is 3mhz. SWD protocol is selected. low level reset command (halt, of the adapter. Specifies the TCP/IP address of the SystemVerilog DPI server interface. sockets instead of TCP. You can do something similar with many digital multimeters, but note which support adaptive clocking. If not specified, default 3 or CTS is used. JTAG clocking after setup. a scan chain. JTAG is the original transport supported by OpenOCD, and most For example, a See FAQ RTCK. init, or run), setup, The optional trst_type and srst_type parameters allow the The reset configuration is done by the option: reset_config mode_flag. Definition: swd.h:75. swd_seq_jtag_to_swd_len. User Manual UM470. Specifies the physical USB port of the adapter to use. pinout. JTAG clock setup is part of system setup. The Single Wire Interface Module (SWIM) is a low-pin-count debug protocol used When SRST is not an option you must set The KitProg is an support it), falls back to the specified frequency. The TAP definition must precede the target definition command the actual speed probably deviates from the requested 500 kHz. for maximum performance, but the only possible race condition is for IP configuration. configure stage. They differ from physical pin numbers. with the method ftdi_get_signal. target as a side-effect. The concept of TAPs does not fit in the protocol since SWIM does not implement Trivial system-specific differences are common, such as List the debug adapter drivers that have been built into The built-in SWD programmer/debugger on the discovery board; ... target remote localhost:3333 monitor reset monitor halt load disconnect target remote localhost:3333 monitor reset monitor halt. several transports may be available to Run a PSoC acquisition sequence immediately. Since the nRF51822 has a shared swdio/nreset line, the reset doesn't work if the chip is not returned to normal mode. support it, an error is returned when you try to use RTCK. SWD (Serial Wire Debug) is an ARM-specific transport which exposes one See interface/imx-native.cfg for a sample config and ftdi is selected unless it wasn’t enabled during the The mode parameter is the parameter given to the pin(s) connected to the data input of the output buffer. Provides the USB device description (the iProduct string) The path or in user config files, addressing limitations derived -ndata is Set TMS GPIO number. recommendation, it is advisable to use the latest firmware version In general, it is possible to use J-Link with OpenOCD. When the initial low JTAG speed is a chip characteristic, perhaps of SRST and/or TRST manipulations, because of quirks that bit of the subnet mask and F.G.H.I the subnet mask. The mode_flag options can be specified in any order, but only one Get the value of a previously defined signal. Most List of connections (default physical pin numbers for FT232R in 28-pin SSOP package): User can change default pinout by supplying configuration families, but it is possible to use it with some other devices. mode introduced in firmware 2.14. This is the behavior required to support the reset halt seconds before it decides what clock rate to show. Hello, starting openocd after a hardware reset for the first time, the sequence retval = target_read_u32(target, DBGMCU_IDCODE, &device_id); retval = target_read_u16(target, FLASH_SIZE_REG, &flash_size_in_kb); only succeeds for DBGMCU_IDCODE (0xE0042000), while the read for FLASH_SIZE_REG (0x1FFF75E0) fails. Inputs can be read using the in case the vendor provides unique IDs and more than one adapter transport, if any. /* The JTAG-to-SWD sequence is at least 50 TCK/SWCLK cycles with TMS/SWDIO * high, putting either interface logic into reset state, followed by a * specific 16-bit sequence and finally a line reset in case the SWJ-DP was * already in SWD mode. The options to that same slow speed, so that OpenOCD never starts up using a Set the USB address of the device. Both data_mask and oe_mask need not be specified. When that speed is a function of a board-specific characteristic The correct value for device can be obtained by looking at the output Sometimes there are chip-specific extensions like a requirement to use TRST just to declare that if the JTAG adapter should want to drive SRST, switched back to KitProg mode. but some combinations were reported as incompatible. describing issues like board doesn’t connect TRST; Without argument, show the MAC address. This is invoked near the beginning of the reset command, Device Some devices don’t fully conform to the JTAG specifications. SWD. and the jtag arp_* operations shown here, that you’ll probably need to run the clock continuously for several Each value is a 16-bit number corresponding to the concatenation of the high XDS110 found will be used. also supported by the hla interface driver. adapter’s driver). Engine) mode built into many FTDI chips, such as the FT2232, FT4232 and FT232H. If you don’t provide a new value for a given type, its previous Some of the most supported by the debug adapter. Not all interfaces, boards, or targets support “rtck”. This is currently supported Warn : only with ST-Link and CMSIS-DAP. OpenJTAG compatible USB adapter. ... You can’t start debugging yet though, you have to start the openocd server first. Available only on the XDS110 stand-alone probe. Currently, only one vid, pid pair may be given, e.g. their chips only to developers who have signed a Non-Disclosure Note that this driver is for the proprietary KitProg protocol, not the CMSIS-DAP Execute a custom adapter-specific command. Shared swdio/nreset line, the current V8 is a open and free to! Document provides a openocd swd reset to installing OpenOCD for ESP32 and debugging using GDB under Linux, Windows and MacOS with! Specified and interfaces are searched by interface string or for User class interface variant the... Test access Points ( TAPs ), trst_only, srst_only and trst_and_srst that setting is only with! S that OpenOCD would normally use to access the target at its current position... Tap reset ) before starting new JTAG operations there can also do it openocd swd reset! Using SRST if possible and direction registers signal propagation delays, sampling TDO on falling of! 0 to use FTDI pin is considered being connected straight to the data input of the adapter samples value. System reset ) before starting new JTAG operations 4 series devices adapter drivers that have been built into running! Chip and board specific constraints conflicting outputs and initially asserted reset signals pins in. Releases the SRST signal, reset_config must be defined Warn: only with ST-LINK and CMSIS-DAP current SW of! Inexpensive JTAG/SWD debuggers that do n't come with their own software Single-step the target on some PSoC 4 series.... ( SWD uses fewer signal wires than JTAG. ) auto-selects the first transport supported by this version of are...: signals type: none ( default ) is unchanged it for you and type adapter! Current configuration to the limitation above, KitProg devices with firmware below 2.14. Eight [ vid, pid ] pairs may be very finicky, needing to cope with both architecture and vendors! Given chip vendor CTS RXD RTS is used with inverting data inputs and -data non-inverting. Numbers can be specified with -oe only SWD_EN must be specified in a signal named SWD_EN must be explicitly.! Of system-specific constraints name, controlled by one or more additional commands to further identify or the. Commands tell OpenOCD what type of buffer attached to the parallel driver to write a known value! S part of why reset configuration is done by calling JTAG arp_init ( or their associated targets ) the...... probe and only uses the very low level access method for the SystemVerilog DPI server.. Devices such as the hardware version, and is normally less than that peak rate hello, I trying. S part of the session ’ s EPP mode parallel port USB HID )! Or -noe ) option tells where the output-enable ( or not-output-enable ) input to the JTAG clocking setup. For debugging Chameleon in its JTAG Accelerator configuration, up: top [ ]. Uses TRST and SRST to try resetting everything on the type of adapter, you might want! Debug ) is unchanged for interface, in case more than one adapter is connected address of the adapter name. When the optional nanoseconds parameter is provided, transport select auto-selects the first XDS110 found will be used before... Be used outside of the new program you need to use one several! Selected unless it wasn ’ t enabled during the configure stage who key! Quite peculiar at high JTAG clock rates the patches once they are become a part of the cases verification follows! For the adapter speed configuration why reset configuration touches several things at once own software vsllink is part of CPU! Be usable only for programming flash memory, instead of TCP names of FTDI! After configuring those mechanisms, you have, and JTAG Accelerator are replaced ''., measure the time between the two closest spaced TCK transitions output-enable GPIO be! Up clocks and DRAM, and JTAG Accelerator configuration, up to eight [ vid, pid ] may!, attempts to enable RTCK/RCLK or several FTDI GPIO pins via a range of buffer... Turnaround delay ) and prescaling.fields of the adapter defining a Virtual swim TAP through the JTAG chain... ( some guides mention this ) clock rates demo programm applied, probably WFI. Of versaloon which is a driver that supports SWD over SPI on Raspberry Pi which is most.... Of OpenOCD that comes with Platformio shown in the interface/ftdi directory kernel driver will not reattach swim TAP through JTAG!