Programming fail

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

Dear Community

 

I use AS7 and Atmel-ICE for programming and a Arduino Nano

 

I wanted to start the debuging mode for the first time. I got asked severel questions which I answered I powered on and off as required and all over sudden I got this Error message when I wanted to programmin debug mode. I also does not work in ISE mode either.

 

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 susspected, on all my attempts that I did something wrong, ok.

 

So I used a Arduino UNO and the same Error appeared, was working before.

 

 

One thing the two devices have in common, there uis no bootloaderon on the chips as I did not need it and so erased it some days ago.

 

 

As soon as I used a new Arduino Nano or even a Mega2560 everything worked fine.

 

 

So there must be something I changed on the As7 to cause this problem, but I have no idea what.

 

 

Maybe one of you has an idea and can help.

 

regards

 

 

Last Edited: Thu. Oct 10, 2019 - 08:02 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My first guess is that your chip is still in debugger mode. IN this case the ISP connections are used for other purposes, so you no longer can program.

 

IIRC You have to start a new debug session, and then first stop that the proper way. Then you should be able to connect again.

 

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

The chip enters a special state called "debugWIRE mode" when debugging.
In that case, the function of the reset pin changes, so the ISP will not function unless you exit debugWIRE mode with the proper procedure.

Please search and read past discussions with the keyword "debugWIRE".

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

A Nano requires serious hardware modification before you can use debugWIRE.
A genuine Uno just needs a sharp knife to cut the RESET-EN copper link. Then follow AS7.0 instructions.
You can subsequently restore or break RESET-EN solder-bridge with a soldering iron.
.
Nano is cheap. Buy another one. Do hardware mod. Use it for development and debugging.
Use regular Nano as final target.
.
If you have a Uno clone, check for RESET-EN pads. If they are not present debugWIRE requires serious hardware modification but not as bad as a Nano mod.
.
David.

Last Edited: Thu. Oct 10, 2019 - 06:46 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear Community

 

thank you very much for all your infos.

 

I will now seach for the modification regarding reset modification etc.

 

Thanks for your help

 

regfards

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

Be sure you don't have a capacitor on the Reset pin, to use the debugWire.

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

As far as I can identify, there is a 1K resistor attached to the reset pin and the reset button going to GND.

 

But I will check over again

 

 

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

You must read the documentation for debugWIRE.

I have already told you that there are SERIOUS hardware mods for a Nano.

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

Yes I will and I wil ltell you about the result, thank you

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

What I did now.

 

I isulated the reset pin by cutting the track just beside the chip and connected it by wire to the 6 pole ISP connector  (also did cutting here) pin3. So RESET is ONLY connected to the ICE connector pin3,no resistor no cap as described in the data sheet.

 

The intention is to have a NANO just for debuging and replacing it when everything is running with a non modifid NANO.

 

But what happens now.

 

I set to debug mode.

 

I was able to connect to the NANO and read the fuses etc.

 

I programmed the DWEN Fuse and got a positive verify, programmed the memory and closed the Device/Simulator programming.

 

I started Debuging (F5) and got this error message:

 

Failed to launch debug session with debugWIRE. This could caused by reset line circutry or disabled debugWIRE interface. Make sure that the reset line is free before continuing. Do you want to use SPI to enable the DWE fuse?

 

When I got back to the Simulator programming and read the device I see that the DWEN fuse is not programmed.

 

I have another three new NANOS, shallI try with one of them? Can the other NANO be damaged? On the other hand same shows up with the UNO.

 

I have no idea at the moment.

 

regards

 

 

 

 

 

 

 

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

1.  stick with the butchered Nano.

2.  check RST on 3x2 connects to RESET pin on TQFP32 with DMM

3.  check that 1k pullup is open.  check that 100nF DTR capacitor is not connected e.g. with DMM

4.  write an Empty AS7.0 project.   Select ATMEL-ICE and debugWIRE

5.  build and debug Empty project.

6.  follow AS7.0 instructions.

7.  choose disable debugWIRE and Close.

8.  now build and debug your Blink project.

 

Never try to set DWEN manually.   Always let AS7.0 do it.   Follow prompts.

You do not need to ever choose step (7)  i.e. never leave debugWIRE

 

If you still have a problem,  post a clear photo of your butchered pcb.

I did warn you that it was much harder than a Uno.   You have to cut the correct track.   You must avoid cutting any other tracks by mistake.

 

I have always used a 10k - 47k pullup on RESET pin.   But the ATMEL-ICE should be able to do debugWIRE with only the AVR weak internal pullup.

 

David.

Last Edited: Thu. Oct 10, 2019 - 11:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks David

 

I now will follow your instuctions and let you know

 

thanks

 

jurgen

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

Hello David

 

all done as you sad, but unfortunately same result.

 

I attached two pictures so you can roughly see what I have done.

 

Shall I try the same with a new Nano?

 

regards

 

Jurgen

Attachment(s): 

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

If you tested the continuity with a DMM it will tell you whether you have breaks, shorts, ...

Especially near TQFP pads.

 

The 10k looks like brn-blk-red to me i.e. 1k0

I would solder the 10k across the 3x2 header.   There is more room.

 

David.

 

 

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

ok I will try. Its orange not red, hard to see on the pic

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

Hello David

 

I got it working now.

 

There was another trak going to the ICE connector on the top layer. I had to cut this as well.

 

At the end it is a matter of isolating the reset pin and adding as you suggested a pullup.

 

Thank you very much for your help no chance without your support.

 

Have a nice weekend

 

Jurgen