Studio 7 / AVRONE - Failed to launch program

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

I have been happily writing and debugging my application (ATMEGA128) using an AVRONE and Studio 7 for the last week or two. All of a sudden, for no apparent reason, I can no longer start a debugging session. Studio hangs at "Loading Symbol Info (95%)" for about 15 seconds, then displays "Failed to Launch Program" / "Error: Failed to leaveprogmode". I am able to program the chip with the AVRONE outside of the development environment, and I can run without debugging from inside Studio.

 

Help! I am at a standstill.

 

Thanks!

 

NEVER MIND. The problem is that the ODCEN fuse wasn't being programmed for some reason.

 

but still... a pretty poor error message IMHO

 

 

--RAm Systems

Last Edited: Mon. Mar 19, 2018 - 04:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I'm having the same problem with ATMEGA324PB, Atmel Studio 7.0.1645 and JTAGICE3.

 

After that OCDEN fuse stays programmed but still can't debug. Any clue about why this happens? How did you solved it?

 

Thanks

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

Hi,

 

I've attached the related log (i think).

 

Help someone?

 

PROBLEM FOUND: As i am using an hand soldered prototype the problem was solved by resoldering the smd crystal.

 

 

 

Thanks

Attachment(s): 

Last Edited: Fri. Mar 8, 2019 - 07:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am writing this to give people another thing to try in case the solutions that worked for RAmSystems and nelsonjesus do not work for you (which is what happened to me)

 

I had the same problem with AtmelICE, AS7 and ATMega324PA, programming was working fine but not debugging.

 

I would start a debug session (hit F5/press the Start Debugging "Play" button) and Atmel Studio would report writing the code to the target device and that the target device is running but I could see that the target device did not reset (I had an LCD connected and it was still showing the older text). When I press the Break All "Pause" button AS would freeze for about 15 seconds and then give me the "Failed to leaveprogmode" error.

 

I was messing with something when this happened, I can't even remember what it was. Most likely I was trying to detect two daisy chained JTAG targets, or I disconnected a JTAG target in the middle of a debug session, something like that.

Anyway, suddenly debug was not working.

 

I closed this project, connected AtmelICE to another device in a different circuit and tried debugging again with the same results. I saw other posts about a problem with the .atsuo file so I backed it up and deleted it to allow AS to rebuild it but that did not solve the problem.

 

What worked for me is the following:

1- Closed Atmel Studio 

2- Disconnected the debugger/programmer from the USB port

3- Edited the project file for both of the affected projects to remove everything related to "avrtool". this is one contiguous section that should list all the tools defined in your project. In my case it was the AtmelICE and the Simulator and the XML tags that I deleted were "<avrtool>",  "<avrtoolserialnumber>", "<avrdeviceexpectedsignature>", "<com_atmel_avrdbg_tool_atmelice>", .... all the way to "<avrtoolinterface>",  "<avrtoolinterfaceclock>"and up to but NOT including the tag </PropertyGroup>.

4- I restarted AS7 and plugged AtmelICE back into the USB port

5- I reopened the project in AS7 and in the project properties page\Tool tab (which was now blank) I again selected the AtmelICE as the "Selected debugger/programmer" and the JTAG interface

 

Now both programming and debugging work fine.

 

My theory is that this is some bug in Atmel Studio and under some unknown (to me) conditions some corruption happens somewhere to some setting/value. Deleting the programming tool like I did or changing the OCDEN/Preserve EEPROM fuse as I saw here/in another post somehow resets this corruption.

 

This does not explain why the problem goes away by resoldering the crystal though, as experienced by nelsonjesus.

 

Last Edited: Mon. Oct 29, 2018 - 02:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For me it worked simply to uncheck the box labeled "Use External Reset" under Project Properties >> Tool

 

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

nelsonjesus wrote:

Hi,

 

I've attached the related log (i think).

 

Help someone?

 

PROBLEM FOUND: As i am using an hand soldered prototype the problem was solved by resoldering the smd crystal.

 

 

 

Thanks

 

Hi,

 

Just to give an update.

 

I have found that the problem i had was related with the load capacitance of the crystal and the load capacitors i was using.

 

Hope this will be useful.

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

In case it helps someone ... Have had a long day of failing to get Atmel ICE JTAG debugging working with ATMega2560 and it seemed to be failure of AS7 (aka latest Microchip Studio) to control OCDEN. I tried all of the above helpful advice and plenty more to no avail. Eventually tried removing my FUSES block from code and elf file and that seems to have worked. I assume the OCDEN fuse setting in the elf was confusing AS7 attempt to override it, which makes sense. Didn't seem to make any difference which way I set OCDEN in my code. I've found it useful to embed fuses in source and elf for all previous AVR projects - this is possibly the first AVR I've tried to use JTAG with.