Hello,
Am 11.02.2011 16:21, schrieb Mathias K.:
> On a memory read/write access the queue has always flushed at the end.
>
> But if i read some more data without a queue excecute in the middle and only
> at the end i get this
> error:
>
> Error: ftdi_write_data: usb bulk write failed
> Error: couldn't write MPSSE commands to FT2232
>
> I think there are to much data in the queue??? I don't know what happens
> there.
I have found it. The command buffer overflows and the jtag stop working. I have
add a simple patch
and a description of a possible better solution (hopefully).
Regards,
Mathias
diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c
index f8b2927..b6a1a3a 100644
--- a/src/jtag/drivers/ft2232.c
+++ b/src/jtag/drivers/ft2232.c
@@ -2081,11 +2081,20 @@ static int ft2232_execute_queue(void)
while (cmd)
{
+ /* fill the write buffer with the desired command */
if (ft2232_execute_command(cmd) != ERROR_OK)
retval = ERROR_JTAG_QUEUE_FAILED;
- /* Start reading input before FT2232 TX buffer fills up */
+ /* Start reading input before FT2232 TX buffer fills up
+ * TODO: sometimes this happens because we don't know the
+ * length of the last executed command so we have to
+ * rewind the buffer, start send_and_recv and execute
+ * the last command again
+ *
+ * is this to much work for you simple decrease this magic
+ * number and try it again ;-)
+ */
cmd = cmd->next;
- if (ft2232_expect_read > 256)
+ if (ft2232_expect_read > 255)
{
if (ft2232_send_and_recv(first_unsent, cmd) != ERROR_OK)
retval = ERROR_JTAG_QUEUE_FAILED;
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development