SWD_RAW_SEND

The SWD_RAW_SEND function writes raw data on the SWD pins. Sending data with this function bypasses XJTAG's handling of the bidirectional nature of the protocol, and will clock in the next bitLength bits irrespective of the state of the interface.

For instance this function should be used to send the Switching Mechanism Select Sequence required to enable SWD operation if the SWD block function does not succeed for a particular device.

If SWD pins are shared with JTAG TAP pins, the first JTAG access after using SWD_RAW_SEND will reset the JTAG chain.

Syntax

SWD_RAW_SEND( INT bitLength, INT data );

Parameters

bitLength
The number of bits of data to send. Must be at least 1, and a maximum of 65520.
data
The data to send (LSB is the first sent). If the data length is smaller than bitLength, the rest of the data sent will be made up of 0's.

Examples

// Switch device to SWD operation using 16-bit 'Switching Mechanism' select sequence.
SWD_RAW_SEND(50, ~0[49..0]);
SWD_RAW_SEND(16, 0xE79E);
SWD_RAW_SEND(50, ~0[49..0]);
SWD_RAW_SEND(5, 0);

// Switch device to JTAG operation using 16-bit 'Switching Mechanism' select sequence.
SWD_RAW_SEND(55, ~0[54..0]);
SWD_RAW_SEND(16, 0xE73C);
SWD_RAW_SEND(5, ~0[4..0]);

See also

  • SWD_RAW_RECEIVE
  • More details of how to use the Arm Debug Interface SWD Protocol are available from Arm