I come to you with yet another problem I do not find any solution for.
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.