(Resolved) Atmel-ICE unable to start a debugWire session

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

Hello, I have just received my highly anticipated Atmel-ICE today and decided to get started right away since I had nothing else to do. But my bad luck with electronics has come (again) to haunt me. I connected my Atmel-ICE into my computer (Yes, I did have Atmel studio 7 pre-installed) and made a little test project, I compiled it, configured it to work with debugWIRE interface, made absolutely sure all of the ICE's pins were correctly connected into my ATtiny85, and clicked 'Start debugging and Break', I waited about 3 or 4 seconds, and a big old popup error comes up (This happens to me way too much, its a curse) that says "Failed to launch debug session with debugWIRE, this could be caused by reset line circuitry blah blah blah Do you want to use SPI to enable the DWEN fuse (I have no idea what this means by the way)", I clicked on 'Yes', and it says a failure message "Failed to enable DW:Failed to enter programming mode". Can somebody please help me? Thanks, Alejandro.

 

 

Last Edited: Thu. Jan 25, 2018 - 11:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hopefully you are using seperate power to powering the Attiny as the Atmel ICE can't power the target device.The Vcc pin of the ICE is used to read the proper Vcc level.

When it is asking you to enable DWEN fuse,you should click on "Yes".After that,you have to power off the Attiny and power it on again.(During this,the ICE should not be disconnected from the PC.).Now after toggling power,click on "OK".Now your debug session should start!!

Also,did you select the Interface as "debugwire"??Under the Solution explorer on the right hand side,right click on the project name.Now go to properties>Tool.Now Select the debugger/programmer as Atmel ICE.Select the debug Interface as "Debugwire".Press ctrl+s to save the settings.I am attaching pic.

Now start Debug session by clicking on start debugging and break & follow the steps which I mentioned earler regarding enabling DWEN fuse.

Are you testing it on any Arduino board?If not,post your complete circuit diagram...

 

Last Edited: Sat. Jan 20, 2018 - 08:46 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Firstly, wow! Thanks for the great help there. My debugWIRE was turned on when my issue occured. 

SHARANYADAS wrote:
When it is asking you to enable DWEN fuse,you should click on "Yes".After that,you have to power off the Attiny and power it on again.(During this,the ICE should not be disconnected from the PC.).Now after toggling power,click on "OK".Now your debug session should start!!

Alright, let's see here, I clicked 'Yes', but then this failure message pops up "Failed to enable DW" and a bunch of source code exceptions.

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

Ok..what about the power??Is the tiny powered from a different source??.Looks like the communication with the ICE is ok.Can you read the supply voltage on ICE??From the screenshot,it looks like the ICE is in ISP programming mode rather than Debugwire.Also check,if you got any option "Disable debugwire & close"..Sometimes it can happen that the debugwire was enabled somwhow,but was not closed properly.If you get that option enabled,click on it and restart the debug session.
Also try with another different IC.For say,atmega328p.Please reply the questions what was asked for better troubleshooting..

Last Edited: Sat. Jan 20, 2018 - 01:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am all out of batteries, so I used my Sparkfun USBtiny’s VCC and GND to power the tiny (the switch was flicked to ‘target power’ and I checked the voltage with my multimeter, it read about 5 volts, so I assume this is fine). Also worth of noting is, only the VCC pin of the USB tiny is in the same breadboard line as the VCC pin of the ICE, the ICE’s GND pin is alone, connected to the tiny; If I connected both grounds to each other, a short circuit seemed to happen (The ICE and USBtiny shut down until I removed the USBtiny’s GND from the same line as the ICE’s).
I know about the ‘Disable debugWIRE and close’ option, it is always grayed out for me, however.

Last Edited: Sat. Jan 20, 2018 - 06:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 1st thing you want to do is make sure your Atmel ICE sees a nice and steady voltage using the device programming menu (ctrl + shift + p) & click on read near target voltage. Click it several times to see the voltage reads stable and does not jump up and down.

 

Try lowering the communication speed with the target - if you have long wires and other parasitic they might act up at high freq. so lower it a few k Hz to improve on that.

 

Make sure you don't have a cap on the reset pin.

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

The Vcc & Gnd both pin of the ICE should be conneted to the Attiny's Vcc & Gnd.No short should occur doing this.Firstly connect the ICE to PC.The middle red light should be turned on of the ICE.Then power the Tiny.The first green light (from the left) should turn on of the ICE.

I think you are wrong about the ICE pinout.

 

The ICE pin no is as follows.

http://humansthatmake.com/wp-content/uploads/2016/04/ice_isp_pinout-1024x358.png

Follow the left image.

 

Now the pinout is as follows.

 

https://www.avrfreaks.net/sites/default/files/ISP%20wiring.jpg

If possible,take a clear picture of the total setup of the wiring.

Last Edited: Sat. Jan 20, 2018 - 09:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Alright, great. I am not at my lab at the moment, I will try these solutions tomorrow, stay tuned :)

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

Okay, here I am, I have made sure the GND and VCC of both devices meet, I am now using batteries for my voltage source, regulated to 3.3 volts, which should work, and the ICE's left light is on(not blinking, good). I am sure debugWIRE is turned on, the 'Disable debugWire and close' option is still grayed out. I click 'Start debugging and break', and nothing has changed, the same error pops up, I made sure all pins are in the correct place. This is driving me nuts, please help.

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

Ok.Try to keep patience.Electronics sometimes can behave in a mysterious way!!!The good news is your "short circuit" problem is gone now.Now tell me one thing,how the reset circuit of the Attiny is wired?Is there any cap from Attiny's reset pin to gnd?And if a 10k pullup resistor is connected from Vcc to reset pin?If possible,draw an absolute diagram which is on the board and post!Not required but if possible,change the Supply voltage of the Attiny from 3.3v to 5v initially.

Last Edited: Mon. Jan 22, 2018 - 08:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay, There is now an ATmega328PU with a 10K pull-up resistor in the reset line (I measured it, it is actually 9.91K), I have not increased voltage to 5V yet. Attempting connection once again.....ok, good, reading voltage still reads a steady 3.3 volts, let me try to read the signature...​Nope!, another big old error message, ok then, changing 3.3V to 5V instead... It reads 4.9 volts as target now, okay, attempting signature reading once more...The exact same error appears. It is in debugWIRE...let me try 'start debugging and break'...it asked for DWEN fuse, I click yes...and the failure error I posted above appears again.

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

U didn't mention one thing that if the 0.1uF cap from reset pin to ground is connected.If connected,IMMEDIATELY REMOVE IT.

Forget the debugwire for sometime.Now do the following steps exactly as described below.

1)Right click on the project name.Now go to properties>Tools.Now select the "debugger/programmer" as Atmel Ice and "Interface" as ISP.Select the ISP clock to 125khz.press Ctrl+s to save settings and close the properties.

2)Now on the top of atmel studio,go to  Tools>Device programming and check if the "Tool" is selected as Atmel ICE and the "Device" is selected as Atmega328p(For atmega328p).Now select the Interface as "ISP"(if already selected,then again select it).Now click on "Apply"(It is a must).Now,read the device signature.

By following these steps,if you are still unable to read the device signature,then something is messed up with the MOSI,MISO,SCK & RESET pins of the ICE as the Atmel ICE can read the Supply voltage properly so there is no problem with the GND & VCC pins!!

Another thing i would like you to try!Check if u can upload the code using a normal USBasp programmer to the same chips...

Revert with the result!!

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

No, there is not a cap on the reset line, I have tried all your steps, they didn't seem to change anything besides the ICE's interface settings. The error still pops up, a strange thing that occurs however, I have VTG on GND and GND on Vcc, and the left LED is turned on and not blinking, however, If I switch them to the correct orientation (VTG to Vcc and GND to GND), the power LED turns off, the ICE reads a negative target voltage, and the massage still appears. I have made a KICad model of the breadboard's layout, I hope it helps.

 

 

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

Definitely there is something wrong regarding pinout of the ICE.Another thing i would like you to mention.Hold the atmel ice connector when the wires entering are facing towards you,then in the left side,the topmost pin is #1.Double check your wiring.

 

 

Image result for atmel ice pinout

 

Please check another thing that if the connector at the ICE side is connected to "AVR" rather than "SAM".

 

Image result for atmel ice pinout

But anyway,if you are confident about your wiring,please contact Atmel/Your supplier and state them the whole issue to get a replacement!In your above mentioned diagram,I can see that the Vcc & GND pins for the ICE are swapped!

Can you take a clear picture of your wiring on the board and post?

Last Edited: Wed. Jan 24, 2018 - 07:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Both GND connections (pins 8 & 22) MUST be connected to GND!

AVCC should also be powered (connected to VCC, even if not using the analog circuits) and there should be bypass caps (0.1uF) on VCC and AVCC to GND.
 

David (aka frog_jr)

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

I have been troubleshooting for a couple of hours now, and absolutely nothing is working, I added the capacitors (not on RESET), I checked the wiring 5 times over. I removed the resistor, put it back on, used 3 of the same chips, checked my wiring again, and it fails, it fails and fails every time, every...single...time! I know I should stay patient, but gosh, really Atmel?!?! Why are you doing this to me??? 

Ok, I took some real life wide-angle shots.

 

 

 

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

Ale Lav wrote:
... and absolutely nothing is working, ...
Including the Atmel-ICE?

Ale Lav wrote:
I know I should stay patient, but gosh, really Atmel?!?! Why are you doing this to me???
Unlike ICD 3, Atmel-ICE full kit does not come with an end-to-end self test.

The Atmel-ICE target cable has been a source of failures; there are a few ways to pitch convert an Atmel-ICE from 50mil to 100mil.

Might consider a reference mega328P board that once it's verified with an Atmel-ICE then can bag, box, and shelf it for future tests of an Atmel-ICE.

 

https://github.com/watterott/wattuino#wattuino-pro-mini

https://www.sparkfun.com/products/11113 (Arduino Pro Mini 328 - 5V/16MHz)

https://learn.adafruit.com/introducing-pro-trinket/

 


http://microchipdeveloper.com/icd3:test-interface

http://www.microchip.com/developmenttools/ProductDetails.aspx?PartNO=DV164035 (MPLAB ICD 3 In-Circuit Debugger)

 

"Dare to be naïve." - Buckminster Fuller

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

The picture of the Atmel ICE connector and the various coloured wires coming from it is not clear.But it seems that the Reset & MISO pins are altered!Swap them and give it a try...Also,attach the external pullup resistor from Vcc to pin no 1 of the atmega before trying
 

Last Edited: Thu. Jan 25, 2018 - 10:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have attached the resistor, here is some help with the pictures; Green = MISO, Red = VTG, Blue = SCK, Purple = MOSI, Gray = RESET, Orange = GND.

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

Red and Orange look to be swapped on the breadboard shown in Post #16...

 

Edit: unless you are using the red side of the strip for GND and the blue side for PWR???

Edit2: However, the power pins to the uC would refute that...

David (aka frog_jr)

Last Edited: Thu. Jan 25, 2018 - 10:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow, lightning fast reply, thank you! But the thing is, if VTG is in GND of the circuit, and GND is in Vcc, the left green LED, turns on, and doesn't blink (meaning power source is working), however, if I put them in the correct places (VTG in Vcc and GND in GND) the green LED turns off, Atmel studio reads a negative power target, and the same error happens.

 

​Edit in reply to "Edit2": Yes, they would, I am using blue bus for GND and Red bus for Vcc.

Last Edited: Thu. Jan 25, 2018 - 10:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you measured the actual voltage on your power rails?

 

David (aka frog_jr)

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

Just did, 4.52V

​Edit: it is 6.06V regulated to 5V with a 7805CT

Last Edited: Thu. Jan 25, 2018 - 10:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps ... swap reset (Gray) and MISO (Green) ???

David (aka frog_jr)

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

OH MY GOOODDDDDDDDDD, HOW DID THAT WORK, THANK YOU THANK YOU!!!!

​I clicked on 'Read Signature', but it says 'Detected device is an ATmega328' I have an ATmega328-PU on board.

​Edit: console says: "[ERROR] Unexpected signature 0x001e9514 (expected 0x001e950f)., ModuleName: TCF (TCF command: Device:startSession failed.)
​Edit2: is there a way to tamper with the expected signature value, similar to editing 'avrdude.conf'?
​Edit3: nevermind, I only changed device selection 'ATmega328' instead of 'ATmega328P'.

 

 

 

 

Last Edited: Thu. Jan 25, 2018 - 10:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds like you forgot that the pinouts are (typically) shown looking down on the pins on a board. The pins at the connector are mirrored to that.

Look at the images in Post #7 carefully...

 

Note (as you have determined), an ATmega328-PU is NOT an ATmega328P.

David (aka frog_jr)

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

So that explains why the polarity is switched, AND why your solution worked, thank you so much, man!

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

After two times posting the diagram,how can one be so sure to make a wrong wiring?wink

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

it is 6.06V regulated to 5V with a 7805CT

That WILL cause problems as a normal 7805 will drop around 2-2.5V with some load. Either go up to 9V or use a low drop out regulator.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly