>/
/>/ I suggest to drop this patch and merge a simpler fix for the problem
/>/ adressed by this patch. Only a few lines of code would need to change.
/>/
/>/
/Attached is such a patch. The benefit over Tomek's patch is that it frees
not only the allocated buffer but also closes the ftdi handle (as was done
in the original patch). Plus I'm not very fond of the
"infinite-loop-that's-not-actually-a-loop-at-all" along with the extra
indentation. This patch doesn't use gotos either but another (perhaps even
more) neglected construct, like it or not. :)
Hi Andreas,

Looks OK to me !

(And you did not use the goto, nice.)

But before to close the handle we should still be able :
-1- to tristate signal High-Z via all the out enable signals used in the specific layout, BUT BUT BUT ONLY if we have entered in the MPSSE mode. -2- (to deactivate the RTCK if it was activated, put the frequency divisor in it initial value ...) -3- to reset the MPSSE bitbang mode, BUT BUT BUT ONLY if we have entered in the MPSSE mode.

NOTE:
The point -2- is not really important.
But, it is really important to let all JTAG SWD signal HIGH-Z before closing the interface, this avoid openocd or other programm to have inter-session troubles. (If you have a Amotnec JTAGkey-2 you may verifiy this by checking the external yellow LED. This LED should be OFF after any quit/shutdown)
As I explained with the TRST and OMAP in previous message ...
(This is not only important for the coming Amontec JTAGkey-3 with SWD support, but for ALL the actual device based FTx232 )
.

To do this I still will do the job with a mechanism as proposed by Sebastien patch (separation of the how-to open/close the device and how-to int/deinit it), with :
open(hanlde)
   init (device layout)
  deinit (device layout)
close(handle)

But we can go with your patch first, and change later, or find an other mechanism to be able to close the device robustly :-)

For Amontec, the objective is to have something clean, but we are not sensible to the code style nor the mechanism used to resolve the problem.

I am happy to have activated the rework on ft2232.c :-)
Thank you all for your time and work on this.

Regards,
Laurent
http://www.amontec.com/jtagkey.shtml
Amontec JTAGkey-2 Generic High-SPEED USB JTAG CABLE interface.

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to