JTAGID not valid

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

Hello everyone,

I come to you with yet another problem I do not find any solution for.

Situation:
I have an ATmega645 on a custom build PCB with and only with JTAG Interface physically accessible,
An AVRDragon with of course JTAG Interface connected,
Atmel Studio 6.

Sometimes it happens, that while programming the ATmega somehow disables its JTAG interface and I can't access it anymore.
In early days it happened that I got the fuses (JTAGEN & OCDEN) wrong, then of course this PCB is lost.

But recently I still sometimes hit some spot that triggers this problem, and any attempt to interface results in:

[ERROR] JTAGID not valid. Debugger command enterProgMode failed., ModuleName: TCF (TCF command: Device:startSession failed.)

Or when trying to enter debugging:

[ERROR] JTAGID not valid. Debugger command enterProgMode failed., ModuleName: TCF (TCF command: Processes:launch failed.)

I also discarded those PCBs thinking something with the fuses again had gone wrong.

As it happens, today the affected ATmega645 already had a bootloader on it, so I was still able to upload new code, bypassing the JTAG interface and therefore could have a deeper look in to what happened.

I was surprised to see that the fuses are exactly as they should be, MCUCR register could still be configured to enable JTAG and I absolutely could not find a reason why this shouldn't work other that some necessary circuit in- or outside the chip got damaged.

Anybody had this problem yet? Or am I missing something? It would be nice if I would be able to reactivate some of the PCBs that were thought to be defect.

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

Check that your JTAG header has the nRST pin connected.

You seldom need or use nRST, but it is essential if you upload a program that sets the JTD bit.

Obviously you uploaded a program to read the current fuses and checked that nothing was amiss.

Note that a debug session with JTAG will most likely destroy your bootloader. So think first !

David.

You should be able to recover your other pcbs.
First ensure that nRST is present. Try JTAG.
If JTAGEN fuse has been removed, you need to gain access to the ISP pins. Try ISP. restore JTAGEN.

If you managed to remove both SPIEN and JTAGEN, your only recourse is HVPP. Since you would need to unsolder the AVR, you might just as well solder a new AVR than f*rt about with HVPP on a second-hand chip.

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

Thanks for the reply.

I checked nRST, it gets pulled down when trying to interface JTAG (although not completely to ground, ~0,8V. is 10k pullup to Vcc to low?) but it actually shouldn't have to because I'm still able to manipulate JTD and confirm its value with software uploaded through the bootloader.

JTAGEN is set, as you guessed right I can still check with software.

If I was able to debug, I wouldn't have a problem. But I can't access anything.

I now prodded around with my oscilloscope to see if there was some signal amiss but couldn't find anything suspicous.

Funny thing though, at some point the JTAG startet working again, it seemed that I might have hit something with the probe that reset something. After a short while it stopped working.

I'm completely confused, as I'm apparently not able to repeat this.

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

If your JTAG started working again by magic, I would replace your JTAG ribbon cable.

I presume that you have a sensible cable length e.g. 20cm.
And soldered joints to the 5x2 JTAG header.
10k pull-ups should be absolutely fine.

As a general rule, nRST is never used. So you should just read VCC. If you ticked the "use external reset" box, it will only be a brief active-low pulse. 0.8V is a perfectly good active-low.

David.

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

I guess you are right, there is a problem with the cables. I'll buy a new patch and hopefully won't experience this as often as I do now.

Another thing: the "use external reset" box has no effect, AVRDragon pulls down nRST regardless of what I choose.

Thx