On Sunday 17 January 2010, Laurent Gauch wrote: > > > > >/ On Sun, Jan 17, 2010 at 9:58 PM, simon qian <simonqian.openocd at > > >gmail.com <https://lists.berlios.de/mailman/listinfo/openocd-development>> > > >wrote: > > />/ > The very first command after init command should be "read target > > voltage". > > />/ > > />/ I would like the patch to have a comment *why* this should be > > />/ the first command. > > />/ > > />/ What happens if it is not? > > / > > That was my question too. :) > > > > Does versaloon not work properly without this? > > > Checking the VREF is a good thing to do before anything else with JTAG > link, or any other SWD link. > This can certify the target is powered and/or the JTAG cable is connected.
Some JTAG adapter hook up the voltage sensing to TX/RX gates on the various other JTAG signal lines, as well as to level shifters needed to handle various board voltages. Others go a step further, and stick a latch in there ... so that if target voltage drops to zero, the JTAG host can be notified (and re-initialize everything next time around). The XDS100 adapters, for example. In those cases, you get the advantage of that "certification" with no extra I/O ... though it's wise to at least read the boolean "is voltage present" signal. > This can be implemented for Amontec JTAGkey and Amotnec JTAGkey-2 since > the Amontec JTAGkey layout returns the VREF_CHECKED_N signal on the > ft2232 port A. > The advantage of a signal VREF_CHECKED_N over a Target voltage is that > the software do not need to convert a voltage value to a binary value. > > The Amontec JTAGkey and Amontec JTAGkey-2 will return 0 on > VREF_CHECKED_N (checked) if voltage is between 5.5V and 1.3V ? Same notion, I guess. > On Amontec JTAGkeys, the JTAG link works without checking the > VREF_CHECKED_N, but integrating a VREF check in the soft will make the > powerup sequence more robust and more convenient for the user. > > What happen if the user forget to connect the JTAG emulator and the > Target board ? > Actually, we receive an error as the JTAG description is not correct. > With integrating VREF_CHECKED_N, OpenOCD will say : "Please check your > JTAG connection. Amontec JTAGkey-2 is not connected to the Target board, > or the Target board is not powered" > > Also on the Amontec JTAGkey and Amontec JTAGkey-2, the SRST_N Value can > be read, this could make sure the target is not reseted by the user > before starting the JTAG link, but this is not really interesting ! VREF > is ! The FT2232 has one signal line which can be used in an interesting mode with SRST. Basically, you can automatically wait until SRST stops being asserted. When the reset circuit fires, it could for example have external R/C (or similar) delays to extend the pulse. Same thing there: some hardware will latch that. That requires the host to reset the latch, as part of general JTAG link re-init. - Dave > Regards, > Laurent > http://www.amontec.com > > > _______________________________________________ > Openocd-development mailing list > Openocd-development@lists.berlios.de > https://lists.berlios.de/mailman/listinfo/openocd-development > > _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development