summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomek CEDRO <cederom@tlen.pl>2011-11-02 03:46:25 +0000
committerTomek CEDRO <cederom@tlen.pl>2011-11-02 03:46:25 +0000
commitbc4f1620779fb64fe5a9bedeefcd9513770473b7 (patch)
tree3fa2b5c5024e9dc7bfd7c5dea7b12329d9b73bfa /src
parent7374dbc98dd075953cf76cb465e88ebe9e356c3c (diff)
downloadopenocd+libswd-bc4f1620779fb64fe5a9bedeefcd9513770473b7.tar.gz
openocd+libswd-bc4f1620779fb64fe5a9bedeefcd9513770473b7.tar.bz2
openocd+libswd-bc4f1620779fb64fe5a9bedeefcd9513770473b7.tar.xz
openocd+libswd-bc4f1620779fb64fe5a9bedeefcd9513770473b7.zip
driver/ft2232: Added raw-wire level debug of data read/written by ft2232. This might help debug bugs in drivers ;-)
Diffstat (limited to 'src')
-rw-r--r--src/jtag/drivers/ft2232.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c
index df5c5e35..4d417899 100644
--- a/src/jtag/drivers/ft2232.c
+++ b/src/jtag/drivers/ft2232.c
@@ -729,6 +729,9 @@ int ft2232_transfer(void *device, int bits, char *mosidata, char *misodata, int
int retval, bit, i;
uint32_t bytes_written, bytes_read;
+ LOG_DEBUG("ft2232_transfer(device=@%p, bits=%d, mosidata=@%p, misodata=@%p, nLSDfirst=%d) ",\
+ (void*)device, bits, (void*)mosidata, (void*)misodata, nLSBfirst);
+
//No optimization for now, simply send one bit from one char element.
for (bit=0;bit<bits;bit++){
buf[0]=(nLSBfirst)?0x33:0x3b; // Clock Bits In and Out LSb or MSb first.
@@ -746,6 +749,8 @@ int ft2232_transfer(void *device, int bits, char *mosidata, char *misodata, int
}
// FTDI MPSSE returns shift register value, our bit is MSb
misodata[bit]=(misodata[bit]&(nLSBfirst?0x01:0x80))?1:0;
+ //USE THIS FOR WIRE-LEVEL DEBUG
+ //LOG_DEBUG("read 0x%02X written 0x%02X", misodata[bit], mosidata[bit]);
}
/* Check if MPSSE ERROR occured and print info if so. */