Sudden "Failed to enter programming mode"

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

Hello,

 

I was programming a device with an ATmega328p through an Atmel ICE. It has been working normally for weeks, and suddenly I receive the error:

 

Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool)

Unable to enter programming mode. Verify device selection, interface settings, target power, security bit, and connections to the target device.

 

I can still read the target voltage. Neither ISP nor debugWIRE work anymore.

I didn't change anything, and I can still program identical devices. Maybe it was cause by unstable power (the clips came off a few times while operating), or I erroneously quit debug mode at some point.

Furthermore, the device still works with the last code I uploaded.

 

Is it bricked? Is there a way to restore it without high voltage resetting?

 

Thanks a lot for the help!

Attachment(s): 

JJ

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

JohnDingo wrote:
Maybe it was cause by unstable power (the clips came off a few times while operating), or I erroneously quit debug mode at some point.

Came off of what?  Please explain this one...

 

As for "not" quitting debug mode, just start a debug session and exit properly.  

The "other" fatal error involves setting fuses, the worst one is reset disable, this one needs HV to correct, or best to trash the chip and stop using questionable programming practices,

such as solderless breadboards with improper bypassing, questionable wire connections and the a like.

 

For bread boarding, arduino's are a better solution, they have a bootloader, proper bypassing and stable clock sources, and in most cases are cheaper then bare chips.

Professionals use them for prototyping, you should too.

 

Jim

 

 

 

 

 

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

Thank you for your answer!

 

I cannot enter debug mode either with debugWIRE, it gives me the same error. I cannot access the fuse registers either, and I didn't change them when it stopped working.

I had to work with some solderless connections for this very reason, so bricking wouldn't be as big of a problem.

 

Then the easiest solution seems to be resoldering the ATmega and request better clippers, however with the current lockdown that's not really possible, so I asked if maybe there was an Atmel-Studio-side solution.

 

 

John

JJ

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

JohnDingo wrote:
Then the easiest solution seems to be resoldering the ATmega and request better clippers,

Huh? Did your board not have an ISP header? 

Please post a clear picture of your board if possible.

 

Jim

 

 

 

 

 

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

On your bread board, are you providing 5v to all vcc/avcc pins, are all gnd pins connected as well?

You also need 100nf caps across both sets of power pins as close to the chip as possible.

 

Jim

 

 

 

 

 

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

can it be that you did not stop the debugging session?

The processor then still is in debugwire mode, can imagine ( I have never used it myself) that you in that situation cannot do programming actions, like checking the fuse bits.

 

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

Thank for all the answers and the patience! I'm still very noob.

 

I am not using a breadboard, everything is soldered on a PCB, except the battery because to debug the code with debugWire I needed to toggle the power. So instead of soldering the battery I connected the device to a power supply.

The debugging and ISP were working fine for weeks, and still work on other identical devices. So it's not a circuit problem (I am not allowed to share a photo, sorry).

 

So at this point my questions are: is it really bricked if the last uploaded code still works? Is it possible that I bricked it by just accidentally removing power while it was operating? Is there a way to recover it with only the Atmel ICE?

JJ

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

JohnDingo wrote:
Is there a way to recover it with only the Atmel ICE?

If unit is in DWire mode, and you are unable to enter the debugger, then only a parallel mode High Voltage Erase will recover it, this may be difficult to do in circuit!

The ICE can not do that from what I read in its manual.   You may be able to find an "eraser" module on the net some where as its a common issue or a Freak with a dragon that can help.

 

Jim

If a dip version this may do it: https://mightyohm.com/blog/produ...

If an smd version, you may find an smd to dip adapter to solder it to.

 

 

 

 

Last Edited: Thu. Apr 2, 2020 - 03:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Check the programming baud rate.  Something may have thumped it - go for as slow as you can get, and read the target ID as a test.  S.