[−][src]Crate jaylink
A crate for talking to J-Link debug probes connected via USB.
This crate allows access to the vendor-specific USB interface used to control JTAG / SWD operations and other functionality. It does not provide access to the virtual COM port functionality (which is a regular CDC device, so no special support is needed).
Inspired by libjaylink (though this library is not a port).
Pinout
J-Link uses a pinout based on the standard 20-pin ARM JTAG connector, extended for SWD compatibility and with pins for UART.
JTAG pinout:
┌───────────┐
VTref │ * 1 2 * │ NC
nTRST │ * 3 4 * │ GND
TDI │ * 5 6 * │ GND
TMS │ * 7 8 * │ GND
TCK ┌┘ * 9 10 * │ GND
RTCK └┐ * 11 12 * │ GND
TDO │ * 13 14 * │ GND
RESET │ * 15 16 * │ GND
DBGRQ │ * 17 18 * │ GND
5V-Supply │ * 19 20 * │ GND
└───────────┘
SWD (+ UART) pinout:
┌───────────┐
VTref │ * 1 2 * │ NC
- │ * 3 4 * │ GND
J-Link TX │ * 5 6 * │ GND
SWDIO │ * 7 8 * │ GND
SWCLK ┌┘ * 9 10 * │ GND
- └┐ * 11 12 * │ GND
SWO │ * 13 14 * │ GND
RESET │ * 15 16 * │ GND
J-Link RX │ * 17 18 * │ GND
5V-Supply │ * 19 20 * │ GND
└───────────┘
Reference
Segger has released a PDF documenting the USB protocol: "Reference manual for J-Link USB Protocol" (Document RM08001-R2).
The archive.org version is the most up-to-date one.
Structs
BitIter | An iterator over a received bit stream. |
Capabilities | Set of capabilities advertised by the device. |
CommunicationSpeed | Target communication speed setting. |
Error | The error type used by this library. |
HardwareVersion | A hardware version returned by |
Interfaces | Bitset of supported target interfaces. |
JayLink | A handle to a J-Link USB device. |
Speeds | J-Link CPU frequency info. |
UsbDeviceInfo | Generic info about a USB device. |
Enums
ErrorKind | List of specific errors that may occur when using this library. |
HardwareType | The hardware/product type of the device. |
Interface | List of target interfaces (JTAG / SWD). |
Functions
scan_usb | Scans for J-Link USB devices. |
Type Definitions
Result | A result type with the error hardwired to |