[app][mdebug] update protocol for JTAG transactions

This commit is contained in:
Brian Swetland
2016-01-11 14:36:51 -08:00
parent 75a8ce0f63
commit 8fbbaccb2b

View File

@@ -57,11 +57,17 @@
#define CMD_BOOTLOADER 0x09 /* return to bootloader for reflashing */
#define CMD_SET_CLOCK 0x0A /* set SWCLK rate to n khz */
#define CMD_SWO_CLOCK 0x0B /* set SWOCLK rate to n khz, 0 = disable SWO */
#define CMD_JTAG_IO 0x0C /* op=0, arg=bitcount, data x (count/32) * 2 */
/* tms, tdi word pairs per 32bits */
#define CMD_JTAG_TX 0x0D /* tms=op.0, arg=bitcount, data x (count/32) words of tdi */
#define CMD_JTAG_RX 0x0E /* tms=op.0, tdi=op.1, arg=bitcount, return (count/32) words */
#define CMD_JTAG_VRFY 0x0F /* arg=bitcount, tms/tdi data/mask, error if tdo&mask != data */
/* valid: target to host */
#define CMD_STATUS 0x10 /* op=errorcode, arg=commands since last TXN_START */
#define CMD_SWD_DATA 0x11 /* op=0 arg=count, payload: data x count */
#define CMD_SWO_DATA 0x12 /* op=0 arg=bytecount, payload: ((arg + 3) / 4) words*/
#define CMD_SWO_DATA 0x12 /* op=0 arg=count, payload: ((count+3)/4) words */
#define CMD_JTAG_DATA 0x14 /* op=0 arg=bitcount, payload: (arg/32) words */
/* valid: target to host async */
#define CMD_DEBUG_PRINT 0x20 /* arg*4 bytes of ascii debug output */
@@ -79,11 +85,13 @@
#define ERR_TIMEOUT 2
#define ERR_IO 3
#define ERR_PARITY 4
#define ERR_BAD_MATCH 5
#define RSWD_VERSION 0x0101
#define RSWD_VERSION 0x0102
#define RSWD_VERSION_1_0 0x0100
#define RSWD_VERSION_1_1 0x0101
#define RSWD_VERSION_1_2 0x0102
// Pre-1.0
// - max packet size fixed at 2048 bytes
@@ -94,6 +102,9 @@
//
// Version 1.1
// - CMD_SWO_DATA arg is now byte count, not word count
//
// Version 1.2
// - CMD_JTAG_IO, CMD_JTAG_RX, CMD_JTAG_TX, CMD_JTAG_VRFY, CMD_JTAG_DATA added
/* CMD_SWD_OP operations - combine for direct AP/DP io */
#define OP_RD 0x00