Error on debugging AVR with Atmel Studio 6.2 b1563 "Debugger command leaveProgMode failed."

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

This is driving me mad. One day with no changes to code or hardware when I try to start debugging with F5 the AVR erases and programs fine, but then AStudio stops with the error "leaveProgMode failed".

My processor is an ATMega16 on a custom board. Debugger is a Dragon and a JTAGICE2.

The weird thing is that the error does not depend on the debugger, I get the same result with wither of my debuggers. I can program the part with JTAG fine with either debugger so I know the connections are OK. The JTAG signals are nice looking on the CRO.

The same problem happens with an identical different target board, and a target board for a different project with the same processor, and even with a different PC running AStudio.

Even weirder is that I can debug a different project on the board, this one uses about 8K of the Flash, the real project is only 3K of the Flash.

I have even gone over the .cproject file line by line and made it identical to a working project, apart from the set of files included. This didn't help.

And I've reinstalled AStudio and the USB drivers.

This problem seems to crop up sporadically with no clear solution, people seem to change a few random settings and it clears.

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

Solved it myself. I am now running AStudio 6.2.1153, which still gave me the error. Then I created a blank project which I could debug fine. Then I added the original files to it and changed settings until it was identical to the original project, all the time I was able to debug fine. Then I deleted the original project from the disk and changed the name of the new project to the deleted project, which required edits to the name in the .atsln & .cproject files. Now it works fine. I even tried using the .cproject from the original broken project, that can debug fine as well.

 

I have an idea that AStudio had a corrupted .atsuo file, which is a binary file which holds who knows what, because in the process above I deleted this file. Maybe try deleting this file. I also had made a mistake in checking .atsuo file into version control whilst leaving the .atsln file uncontrolled, the reverse to what should be done. Since I am the only programmer and I only work on one PC this would not make much difference, I just mention it to possibly assist another engineer to not waste a day like I did.

 

At some point I shall move back to the latest AStudio, I think that it will work fine now.

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

Having same problem. This .atsuo file is located where?