JTAG disable/enable during debug.

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know, bad idea but perhaps it may work, won't be able to try it for a few days. Any ideas welcome.

I'm using 2 bits of portc (JTAG pins) as startup settings, they will only be read once after reset.

So the idea is that JTAG would be enabled as per normal, after init JTAG would be disabled with the usual writing to JTD, this will switch the pins to input mode (but probably also crash the JTAG session).
Read the pins.
Re-eneable JTAG by writing 0 twice to JTD???
Continue with normal JTAG debugging...or not :?

Has anybody tried anything like this? Can JTAG be switched on/off during debug? It's unlikely but I can't see anything specific, only that JTD has to be 0 for JTAG to work.

Would "hot-plugging/unplugging" JTAG be allowable? It would be nice if it worked.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, did not really expect it to work (just hoping) and I was right. :?

Tried this

#if debug==1
	MCUCR = (1<<JTD); 							//Disable JTAG in debug mode
	MCUCR = (1<<JTD); 
	portc_status=PINC;
	MCUCR &= ~ (1<<JTD); 						//Re-enable JTAG in debug mode
	MCUCR &= ~ (1<<JTD); 
#endif

but JTAG does not get re-enabled. I think the Message window tells the tale

Quote:
JTAGICE mkII: IDR event 0xff.
JTAGICE mkII: Target has entered sleep mode.
JTAGICE mkII: IDR event 0xff.
Back to fake portc_status during debug :(

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly