The following table lists the TargetInterface object's member functions.

TargetInterface.beginDebugAccess() puts the target into debug state if it is not already in order to carry out a number of debug operations. The idea behind beginDebugAccess and endDebugAccess is to minimize the number of times the target enters and exits debug state when carrying out a number of debug operations. Target interface functions that require the target to be in debug state (such as peek and poke) also use beginDebugAccess and endDebugAccess to get the target into the correct state. A nesting count is maintained, incremented by beginDebugAccess and decremented by endDebugAccess. The initial processor state is recorded on the first nested call to beginDebugAccess and this state is restored when the final endDebugAccess is called causing the count to return to it initial state.
TargetInterface.commReadWord() returns a word from the ARM7/ARM9 debug comms channel.
TargetInterface.commWriteWord(word) writes a word to the ARM7/ARM9 debug comms channel.
TargetInterface.crc32(address, length) reads a block of bytes from target memory starting at address for length bytes, generates a crc32 on the block of bytes and returns it.
TargetInterface.cycleTCK(n) provide n TCK clock cycles.
TargetInterface.delay(ms) waits for ms milliseconds
TargetInterface.downloadDebugHandler() downloads the debug handler as specified by the Debug Handler File Path/Load Address project properties and uses the debug handler for the target connection.
TargetInterface.endDebugAccess(alwaysRun) restores the target run state recorded at the first nested call to beginDebugAccess. See beginDebugAccess for more information. If alwaysRun is non-zero the processor will exit debug state on the last nested call to endDebugAccess.
TargetInterface.eraseBytes(address,length) erases a length block of target memory starting at address.
TargetInterface.error(message) terminates execution of the script and outputs a target interface error message to the target log.
TargetInterface.executeFunction(address, parameter, timeout) calls a function at address with the parameter and returns the function result. The timeout is in milliseconds.
TargetInterface.executeMCR(opcode) interprets/executes the opcode assuming it to be an MRC instruction and returns the value of the specified coprocessor register.
TargetInterface.executeMCR(opcode, value) interprets/executes the opcode assuming it to be an MCR instruction that writes value to the specified coprocessor register.
TargetInterface.expandMacro(string) returns the string with macros expanded.
TargetInterface.fillScanChain(bool, lsb, msb) sets bits from lsb (least significant bit) to msb (most significant bit) in internal buffer to bool value.
TargetInterface.getDebugRegister(address) returns the value of the ADIv5 debug register denoted by address. Address has the nibble sized access point number starting at bit 24 and the register number in the bottom byte.
TargetInterface.getICEBreakerRegister(r) returns the value of the ARM7/ARM9/ARM11/CortexA/CortexR debug register r.
TargetInterface.getProjectProperty(savename) returns the value of the savename project property.
TargetInterface.getRegister(registername) returns the value of the register, register is a string specifying the register to get and must be one of r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, sp, lr, pc, cpsr, r8_fiq, r9_fiq, r10_fiq, r11_fiq, r12_fiq, r13_fiq, r14_fiq, spsr_fiq, r13_svc, r14_svc, spsr_svc, r13_abt, r14_abt, spsr_abt, r13_irq, r14_irq, spsr_irq, r13_und, r14_und, spsr_und.
TargetInterface.getTDO() return the TDO signal.
TargetInterface.getTargetProperty(savename) returns the value of the savename target property.
TargetInterface.go() allows the target to run.
TargetInterface.idcode() returns the JTAG idcode of the target.
TargetInterface.implementation() returns a string defining the target interface implementation.
TargetInterface.isStopped() returns true if the target is stopped.
TargetInterface.message(message) outputs a target interface message to the target log.
TargetInterface.packScanChain(data, lsb, msb) packs data from lsb (least significant bit) to msb (most significant bit) into internal buffer.
TargetInterface.peekBinary(address, length, filename) reads a block of bytes from target memory starting at address for length bytes and writes them to filename.
TargetInterface.peekByte(address) reads a byte of target memory from address and returns it.
TargetInterface.peekBytes(address, length) reads a block of bytes from target memory starting at address for length bytes and returns the result as an array containing the bytes read.
TargetInterface.peekMultUint16(address, length) reads length unsigned 16-bit integers from target memory starting at address and returns them as an array.
TargetInterface.peekMultUint32(address, length) reads length unsigned 32-bit integers from target memory starting at address and returns them as an array.
TargetInterface.peekUint16(address) reads a 16-bit unsigned integer from target memory from address and returns it.
TargetInterface.peekUint32(address) reads a 32-bit unsigned integer from target memory from address and returns it.
TargetInterface.peekWord(address) reads a word as an unsigned integer from target memory from address and returns it.
TargetInterface.pokeBinary(address, filename) reads a block of bytes from filename and writes them to target memory starting at address.
TargetInterface.pokeByte(address, data) writes the byte data to address in target memory.
TargetInterface.pokeBytes(address, data) writes the array data containing 8-bit data to target memory at address.
TargetInterface.pokeMultUint16(address, data) writes the array data containing 16-bit data to target memory at address.
TargetInterface.pokeMultUint32(address, data) writes the array data containing 32-bit data to target memory at address.
TargetInterface.pokeUint16(address, data) writes data as a 16-bit value to address in target memory.
TargetInterface.pokeUint32(address, data) writes data as a 32-bit value to address in target memory.
TargetInterface.pokeWord(address, data) writes data as a word value to address in target memory.
TargetInterface.readBinary(filename) reads a block of bytes from filename and returns them in an array.
TargetInterface.reset() resets the target, optionally executes the reset script and lets the target run.
TargetInterface.resetAndStop(delay) resets the target by cycling nSRST and then stops the target. delay is the number of milliseconds to hold the target in reset.
TargetInterface.resetAndStopAtZero(delay) sets a breakpoint on the instruction at address zero execution, resets the target by cycling nSRST and waits for the breakpoint to be hit. delay is the number of milliseconds to hold the target in reset.
TargetInterface.resetDebugInterface() resets the target interface (not the target).
TargetInterface.runFromAddress(address, timeout) start the target executing at address and waits for a breakpoint to be hit. The timeout is in milliseconds.
TargetInterface.runFromToAddress(from, to, timeout) start the target executing at address from and waits for the breakpoint to be hit. The timeout is in milliseconds.
TargetInterface.runTestIdle() moves the target JTAG state machine into Run-Test/Idle state
TargetInterface.runToAddress(address, timeout) sets a breakpoint at address, starts the target executing and waits for the breakpoint to be hit. The timeout is in milliseconds.
TargetInterface.scanDR(length, count) scans length bits from the internal buffer into the data register and puts the result into the internal buffer (count specifies the number of times the function is done).
TargetInterface.scanIR(length, count) scans length bits from the internal buffer into the instruction register and puts the result into the internal buffer (count specifies the number of times the function is done).
TargetInterface.selectDevice(irPre, irPost, drPre, drPost) sets the instruction and data register (number of devices) pre and post bits.
TargetInterface.setDBGRQ(v) sets/clears the DBGRQ bit of the ARM7/ARM9 debug control register.
TargetInterface.setDebugInterfaceProperty("reset_debug_interface_enabled", bool) turn on/off the reset of the debug interface.
TargetInterface.setDebugInterfaceProperty("has_etm", bool) set the ARM7/ARM9 property to enable use of the ETM.
TargetInterface.setDebugInterfaceProperty("reset_delay", N) set the XScale reset delay property to N.
TargetInterface.setDebugInterfaceProperty("post_reset_delay", N) set the XScale post reset delay property to N.
TargetInterface.setDebugInterfaceProperty("post_reset_cycles", N) set the XScale post reset cycles property to N.
TargetInterface.setDebugInterfaceProperty("post_ldic_cycles", N) set the XScale ldic cycles property to N.
TargetInterface.setDebugInterfaceProperty("sync_exception_vectors", bool) turn on/off the XScale sync exception vectors property.
TargetInterface.setDebugInterfaceProperty("peek_flash_workaround", bool) turn on/off the ARMv6M/ARMv7M peek flash memory workaround debug property.
TargetInterface.setDebugInterfaceProperty("adiv5_fast_delay_cycles", N) set the ADIv5 fast delay cycles property to N (FTDI2232 target interfaces only).
TargetInterface.setDebugInterfaceProperty("use_adiv5_AHB", N, [start, size]) set the ARMv7A/ARMv7R debug property list to turn on/off usage of the ADIv5 AHB MEM-AP for 1+2+4 data sized accesses on the optional address range specified by start and size.
TargetInterface.setDebugInterfaceProperty("set_adiv5_AHB_ap_num", N) specify the ARMv6M/ARMv7A/ARMv7M/ARMv7R AHB AP number to use.
TargetInterface.setDebugInterfaceProperty("set_adiv5_APB_ap_num", N) specify the ARMv7A/ARMv7R APB AP number to use.
TargetInterface.setDebugInterfaceProperty("max_ap_num", N) set the ADIv5 debug property to limit the number of AP's to detect to N.
TargetInterface.setDebugInterfaceProperty("component_base", N) set the ADIv5 debug property that specifies the base address N of the CoreSight debug component.
TargetInterface.setDebugRegister(address, value) set the value of the ADIv5 debug register denoted by address. Address has the nibble sized access point number starting at bit 24 and the register number in the bottom byte.
TargetInterface.setDeviceTypeProperty(type) sets the target interface's Device Type property string to type. This would typically be used by a Connect Script to override the default Device Type property and provide a custom description of the connected target.
TargetInterface.setICEBreakerBreakpoint(n, address, addressMask, data, dataMask, control, controlMask) sets the ARM7/ARM9 watchpoint n registers.
TargetInterface.setICEBreakerRegister(r, value) set the value of the ARM7/ARM9/ARM11/CortexA/CortexR debug register r.
TargetInterface.setMaximumJTAGFrequency(hz) allows the maximum TCK frequency of the currently connected JTAG interface to be set dynamically. The speed setting will only apply for the current connection session, if you reconnect the setting will revert to the speed specfied by the target interface properties. Calls to this function will be ignored if adaptive clocking is being used.
TargetInterface.setNSRST(v) sets/clears the NSRST signal.
TargetInterface.setNTRST(v) sets/clears the NTRST signal.
TargetInterface.setRegister(registername, value) sets the register to the value, register is a string specifying the register to get and must be one of r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, sp, lr, pc, cpsr, r8_fiq, r9_fiq, r10_fiq, r11_fiq, r12_fiq, r13_fiq, r14_fiq, spsr_fiq, r13_svc, r14_svc, spsr_svc, r13_abt, r14_abt, spsr_abt, r13_irq, r14_irq, spsr_irq, r13_und, r14_und, spsr_und.
TargetInterface.setTDI(v) clear/set TDI signal.
TargetInterface.setTMS(v) clear/set TMS signal.
TargetInterface.setTargetProperty(savename) set the value of the savename target property.
TargetInterface.stop() stops the target.
TargetInterface.stopAndReset(delay) sets a breakpoint on any instruction execution, resets the target by cycling nSRST and waits for the breakpoint to be hit. delay is the number of milliseconds to hold the device in reset.
TargetInterface.trst() resets the target interface (not the target).
TargetInterface.type() returns a string defining the target interface type.
TargetInterface.unpackScanChain(lsb, msb) unpacks data from lsb (least significant bit) to msb (most significant bit) from internal buffer and returns the result.
TargetInterface.waitForDebugState(timeout) waits for the target to stop or the timeout in milliseconds.
TargetInterface.writeBinary(array, filename) write the bytes in array to filename.