From 009addf856768637726c5cc42a922d1873c184dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Sun, 5 Apr 2009 16:13:48 +0000 Subject: [PATCH] check target status for UsbScarab2 (Tomek Cedro) git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1475 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 4 ++++ jtag/src/tap/cable/ft2232.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index a7dd036a..1638d2c9 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,7 @@ +2009-04-05 Arnim Laeuger + + * src/tap/cable/ft2232.c: check target status for UsbScarab2 (Tomek Cedro) + 2009-04-04 Arnim Laeuger * src/tap/cable/ft2232.c, src/tap/cable.c, src/tap/cable/generic_usbconn.c, diff --git a/jtag/src/tap/cable/ft2232.c b/jtag/src/tap/cable/ft2232.c index 98407c2e..91a3e774 100644 --- a/jtag/src/tap/cable/ft2232.c +++ b/jtag/src/tap/cable/ft2232.c @@ -671,6 +671,16 @@ ft2232_usbscarab2_init( cable_t *cable ) if (usbconn_open( cable->link.usb )) return -1; + /* Check if cable is connected to the target and the target is powered on */ + cx_cmd_queue(cmd_root,1); + cx_cmd_push(cmd_root, GET_BITS_LOW); + cx_xfer( &(params->cmd_root), &imm_cmd, cable, COMPLETELY); + if ( (cx_xfer_recv( cable ) & BITMASK_USBSCARAB2_nCONNECTED) != 0) + { + printf( _("Error: Please power on the TARGET board and connect VCC signal!\n") ); + return -1; + } + /* These bits will be set by default to: */ params->low_byte_value = 0; params->low_byte_dir = 0; @@ -698,6 +708,7 @@ ft2232_usbscarab2_init( cable_t *cable ) params->last_tdo_valid = 0; params->signals = CS_TRST | CS_RESET; + printf("Cable initialization OK!\n"); return 0; }