DSPRelated.com
Forums

How to detect JTAG is connected or not

Started by dspwhiz October 20, 2005
How to detect from the CPU wheather JTAG Is connected or not
Thanks 
SM

>How to detect from the CPU wheather JTAG Is connected or not >Thanks >SM
Which CPU? The under-debug embedded processor's CPU or the semi-hosting PC's CPU? If it is the latter, the answer is easy: through drivers and host softwares provided by the emulator manufacturer. If it is the embedded CPU, then I will let the more competent people here answer that. But I suspect that no ISA will provide native software(assembly) support for such test sequences and you may have to resort to other hands-on means to test that. --Bhooshan This message was sent using the Comp.DSP web interface on www.DSPRelated.com
dspwhiz wrote:
> How to detect from the CPU wheather JTAG Is connected or not
No way. Why? -- Tauno Voipio tauno voipio (at) iki fi
dspwhiz wrote:
> How to detect from the CPU wheather JTAG Is connected or not > Thanks > SM >
If you are a whiz, how come you need to ask such elementary questions? :-\ Steve
Tauno Voipio <tauno.voipio@iki.fi.NOSPAM.invalid> writes:

> dspwhiz wrote: > > How to detect from the CPU wheather JTAG Is connected or not > > No way. > > Why?
Don't know the OP's reason, but I wanted to do this too, for ARM7. The reason was when trying to use the ARM debug communications channel, the program hangs if the JTAG is not connected. I was unable to find a way around this :( -- John Devereux
I am by no means an expert on JTAG, but every time I have implemented a
JTAG port on a circuit, I had to add pull-up and pull-down resistors.
It isn't a software solution, which I gather is what you are after, but
perhaps it is possible to monitor the state of these signal lines to
determine if a device is connected.

"dspwhiz" ...
> How to detect from the CPU wheather JTAG Is connected or not
Use a pulldown on nTRST. That line will be driven high by the JTAG dongle when communicating. When the JTAG is not connected the line will be low (and the JTAG logic kept in reset, the prefered state). Regards, Arie de Muynck
John Devereux wrote On 10/21/05 05:26,:
> Tauno Voipio <tauno.voipio@iki.fi.NOSPAM.invalid> writes: > > >>dspwhiz wrote: >> >>>How to detect from the CPU wheather JTAG Is connected or not >> >>No way. >> >>Why? > > > Don't know the OP's reason, but I wanted to do this too, for ARM7. > > The reason was when trying to use the ARM debug communications > channel, the program hangs if the JTAG is not connected. I was unable > to find a way around this :( >
You've answered your own question. Timeouts.
Scott Moore <samiamsansspam@Sun.COM> writes:

> John Devereux wrote On 10/21/05 05:26,: > > Tauno Voipio <tauno.voipio@iki.fi.NOSPAM.invalid> writes: > > > > > >>dspwhiz wrote: > >> > >>>How to detect from the CPU wheather JTAG Is connected or not > >> > >>No way. > >> > >>Why? > > > > > > Don't know the OP's reason, but I wanted to do this too, for ARM7. > > > > The reason was when trying to use the ARM debug communications > > channel, the program hangs if the JTAG is not connected. I was unable > > to find a way around this :( > > > > You've answered your own question. > > Timeouts.
I am pretty sure that even an attempted write to the dcc locked up the program. There was no opportunity to do a "Timeout". Having said that, it was difficult to tell exactly what was going on without the debugger(!), and it was a few weeks ago now so I could be mistaken. Has anyone actually implemented this successfully? (I.e., a timeout on the debug communications channel that recovers from a missing debugger?) -- John Devereux
"Arie de Muynck" ...
> "dspwhiz" ... > > How to detect from the CPU wheather JTAG Is connected or not > > Use a pulldown on nTRST. That line will be driven high by the JTAG dongle > when communicating. When the JTAG is not connected the line will be low
(and
> the JTAG logic kept in reset, the prefered state).
P.S.: Connect the nTRST line also to a GPIO pin or other input of your system so it can be tested by the SW. Regards, Arie de Muynck