I fixed the issue by disabling dcc memory uploads. Otherwise my setup hasn't 
changed:

1. Openocd fetched from latest GIT
2. libftdi-0.16 from the latest release tarball
3. FT2232 timeout/retry-count patch applied (attached).
4. ARM-USB-TINY-H interface config (attached)

After starting openocd I issue the following commands (see attached log):
1. reset init
2. arm7_9 dcc_downloads disable
3. load_image dd 0x20000000        #THIS WORKS
4. arm7_9 dcc_downloads enable
5. load_image dd 0x20000000        #THIS FAILS.

After that the FT2232H is not usable until it is power cycled.

With regards to the additional GIT revisions, I cloned a fresh OpenOCD copy and 
applied my patches on top just to be sure this is not the problem.

As for ftd2xx, libftdi now works for me so I won't have to mess up with closed 
source libraries :)

As user I see the following two problems:
1. DCC downloads do not work, although they are marked as default for 
SAM9-L9260.
2. USB communication failures freeze the dongle until it is power cycled.

Regards,
Dimitar
diff --git a/tcl/interface/olimex-arm-usb-ocd-h.cfg b/tcl/interface/olimex-arm-usb-ocd-h.cfg
new file mode 100644
index 0000000..a7a72ce
--- /dev/null
+++ b/tcl/interface/olimex-arm-usb-ocd-h.cfg
@@ -0,0 +1,11 @@
+#
+# Olimex ARM-USB-OCD
+#
+# http://www.olimex.com/dev/arm-usb-ocd.html
+#
+
+interface ft2232
+ft2232_device_desc "Olimex OpenOCD JTAG ARM-USB-OCD-H"
+ft2232_layout olimex-jtag
+ft2232_vid_pid 0x15ba 0x002b
+
diff --git a/tcl/interface/olimex-arm-usb-tiny-h.cfg b/tcl/interface/olimex-arm-usb-tiny-h.cfg
new file mode 100644
index 0000000..378fe37
--- /dev/null
+++ b/tcl/interface/olimex-arm-usb-tiny-h.cfg
@@ -0,0 +1,11 @@
+#
+# Olimex ARM-USB-OCD
+#
+# http://www.olimex.com/dev/arm-usb-ocd.html
+#
+
+interface ft2232
+ft2232_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H"
+ft2232_layout olimex-jtag
+ft2232_vid_pid 0x15ba 0x002a
+
diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c
index cf3fc01..d594c53 100644
--- a/src/jtag/ft2232.c
+++ b/src/jtag/ft2232.c
@@ -400,7 +400,7 @@ static int ft2232_read(uint8_t* buf, uint32_t size, uint32_t* bytes_read)
 
 #elif BUILD_FT2232_LIBFTDI == 1
 	int retval;
-	int timeout = 100;
+	int timeout = 2000;
 	*bytes_read = 0;
 
 	while ((*bytes_read < size) && timeout--)
@@ -679,7 +679,7 @@ static int ft2232_send_and_recv(jtag_command_t* first, jtag_command_t* last)
 
 	if (ft2232_expect_read)
 	{
-		int timeout = 100;
+		int timeout = 1000;
 		ft2232_buffer_size = 0;
 
 #ifdef _DEBUG_USB_IO_
@@ -711,14 +711,14 @@ static int ft2232_send_and_recv(jtag_command_t* first, jtag_command_t* last)
 		{
 			LOG_ERROR("ft2232_expect_read (%i) != ft2232_buffer_size (%i) (%i retries)", ft2232_expect_read,
 					ft2232_buffer_size,
-					100 - timeout);
+					1000 - timeout);
 			ft2232_debug_dump_buffer();
 
 			exit(-1);
 		}
 
 #ifdef _DEBUG_USB_COMMS_
-		LOG_DEBUG("read buffer (%i retries): %i bytes", 100 - timeout, ft2232_buffer_size);
+		LOG_DEBUG("read buffer (%i retries): %i bytes", 1000 - timeout, ft2232_buffer_size);
 		ft2232_debug_dump_buffer();
 #endif
 	}

Attachment: openocd-session.log.gz
Description: GNU Zip compressed data

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to