Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
cshutchinson
PostPosted: May 18, 2012 - 03:54 PM
Rookie


Joined: May 02, 2012
Posts: 34
Location: Florence, SC

Here is my setup:

AVROne with 6pin ISP connection to ATTiny13.

ISP Header------>Tiny13
Pin 1------>Pin 6 (MISO)
Pin 2------>Vcc (5V)
Pin 3------>Pin 7 (SCK)
Pin 4------>Pin 5 (MOSI)
Pin 5------>Pin 1 (RESET)(also 10K pullup)
Pin 6------>Pin GND




The DWEN fuse is not set, and I can program it and read the device ID.

My understanding from the documentation is as follows:

debugWIRE OCD

Attempt to start a debug session on the debugWIRE part. If the debugWIRE interface is not enabled, Atmel Studio will offer to retry, or attempt to enable debugWIRE using SPI programming. If you have the full SPI header connected, debugWIRE will be enabled, and you will be asked to toggle power on the target - this is required for the fuse changes to be effective.


Where should I start looking if I am not offered to attempt to enable debugWire via SPI programming?

Let me also note....
I can do this full circle manually, enable DW, debug the part, disable DW through one wire, and then be able to use SPI again to program. But, this is not the way you are supposed to do it from what I have read.

Do I need to force a driver update on my AVROne to make this process work as intended (automatically prompt to enable DWEN)? Or is have I missed something in Studio 6?

I am just trying to debug some I2C stuff from Fleury and want to understand best way to do this going forward.[/img]
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: May 18, 2012 - 04:05 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62299
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

Where should I start looking if I am not offered to attempt to enable debugWire via SPI programming?

It's when you "start Debugging" and the selected debug interface is "AVR One"

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: May 18, 2012 - 04:11 PM
10k+ Postman


Joined: Feb 12, 2005
Posts: 16308
Location: Wormshill, England

If you are already in debugWire mode, Studio does not need to prompt you. Your debug session starts painlessly.

Just follow the prompts. e.g. start with a virgin AVR.
1. Start Debug.
1A. Studio may prompt you to update firmware.
2. Studio prompts you.
3. answer yes, and Studio sets DWEN
4. Studio prompts you to toggle power.
5. answer yes, and your debug begins.
6. do your debugging.
7. ...

You can either 'disable debugWire at the end of your session or simply start at (1) again. Since you are already in dW, you go straight to (6).

Readers here like to complicate matters. Generally by setting DWEN when they have no debugger.

If you never touch DWEN yourself, you will get on just fine. Always let Studio do it for you.

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
cshutchinson
PostPosted: May 18, 2012 - 04:21 PM
Rookie


Joined: May 02, 2012
Posts: 34
Location: Florence, SC

My point is, studio won't do it for me. I have a screenshot attached showing the error.... Hope I am being clear.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
cshutchinson
PostPosted: May 18, 2012 - 04:24 PM
Rookie


Joined: May 02, 2012
Posts: 34
Location: Florence, SC

david.prentice wrote:
If you are already in debugWire mode, Studio does not need to prompt you. Your debug session starts painlessly.

Just follow the prompts. e.g. start with a virgin AVR.
1. Start Debug.
1A. Studio may prompt you to update firmware.
2. Studio prompts you.
3. answer yes, and Studio sets DWEN
4. Studio prompts you to toggle power.
5. answer yes, and your debug begins.
6. do your debugging.
7. ...

You can either 'disable debugWire at the end of your session or simply start at (1) again. Since you are already in dW, you go straight to (6).

Readers here like to complicate matters. Generally by setting DWEN when they have no debugger.

If you never touch DWEN yourself, you will get on just fine. Always let Studio do it for you.

David.


I will start again with a virgin AVR and report back.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: May 18, 2012 - 04:26 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62299
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

have a screenshot attached showing the error....

It's that text up at the top right in the "Output" window (which you can copy and paste into code tags here) that would be far more useful to diagnose what's going on.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
cshutchinson
PostPosted: May 18, 2012 - 04:30 PM
Rookie


Joined: May 02, 2012
Posts: 34
Location: Florence, SC

Ok, here it is. Thanks.

Code:
11:27:05: [WARNING] The device [attiny13] is not supported in ASF Version [3.1.3] that is used in the project RealTimeClock
11:27:34: [ERROR] , ModuleName: TCF (TCF command: Processes:getContext failed.)
11:27:34: [ERROR] Target synchronisation failed. Debugger command setEmulatorMode failed., ModuleName: TCF (TCF command: Processes:launch failed.)
11:29:33: [ERROR] , ModuleName: TCF (TCF command: Processes:getContext failed.)
11:29:33: [ERROR] Target synchronisation failed. Debugger command setEmulatorMode failed., ModuleName: TCF (TCF command: Processes:launch failed.)
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
cshutchinson
PostPosted: May 18, 2012 - 04:34 PM
Rookie


Joined: May 02, 2012
Posts: 34
Location: Florence, SC

I guess I can try changing ASF version...backwards.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
cshutchinson
PostPosted: May 18, 2012 - 04:41 PM
Rookie


Joined: May 02, 2012
Posts: 34
Location: Florence, SC

Changing ASF to 3.0.1 still gives these error messages when debug is selected on virgin chip:

Code:
11:40:02: [ERROR] , ModuleName: TCF (TCF command: Processes:getContext failed.)
11:40:02: [ERROR] Target synchronisation failed. Debugger command setEmulatorMode failed., ModuleName: TCF (TCF command: Processes:launch failed.)
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: May 18, 2012 - 04:41 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62299
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

I guess I can try changing ASF version...backwards.

While the ASF thing could be an issue you actually have three different sets of output there:
Code:
11:27:05: [WARNING] The device [attiny13] is not supported in ASF Version [3.1.3] that is used in the project RealTimeClock


11:27:34: [ERROR] , ModuleName: TCF (TCF command: Processes:getContext failed.)
11:27:34: [ERROR] Target synchronisation failed. Debugger command setEmulatorMode failed., ModuleName: TCF (TCF command: Processes:launch failed.)


11:29:33: [ERROR] , ModuleName: TCF (TCF command: Processes:getContext failed.)
11:29:33: [ERROR] Target synchronisation failed. Debugger command setEmulatorMode failed., ModuleName: TCF (TCF command: Processes:launch failed.)

I imagine you got the ASF error during building. But then you tried to start debugging (twice) and on each occasion (11:27:34 and 11:29:33) got the error here seems to be that Studio is not "talking" to the debugger.

The way AS6 debugging works is that there's the front end Studio debugger itself then running as a separate process there is a debugger daemon and the two communicate over a localhost TCP/IP channel using the TCF protocl (which is apparently just a variant of that used in Eclipse). It is that communication that has failed.

I have a feeling you either need to contact Atmel or wait to hear from one of their staff here. It seems odd that the One! works for ISP (proving that cabling/USB driver and so on are working) but does not work for dW or JTAG. Atmel will hopefully be able to help you determine the reason why.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
cshutchinson
PostPosted: May 18, 2012 - 04:45 PM
Rookie


Joined: May 02, 2012
Posts: 34
Location: Florence, SC

[quote="clawson"]
Quote:

I have a feeling you either need to contact Atmel or wait to hear from one of their staff here. It seems odd that the One! works for ISP (proving that cabling/USB driver and so on are working) but does not work for dW or JTAG. Atmel will hopefully be able to help you determine the reason why.


Thanks, yes, I will try to contact Atmel. This problem was alluded to here on AVRFreaks a few weeks ago, but no solution was ever offered. This may well indeed be a bug. Will report back on what Atmel says if I can get in touch with them.

Update: Support ticket posted to Atmel.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
sikolymester
PostPosted: May 18, 2012 - 08:36 PM
Hangaround


Joined: Nov 22, 2008
Posts: 130
Location: Budapest, Hungary

Try to pull up the reset pin to vcc with a ~20kohm resistor.
It might be worth a shot.
 
 View user's profile Send private message  
Reply with quote Back to top
cshutchinson
PostPosted: May 18, 2012 - 09:04 PM
Rookie


Joined: May 02, 2012
Posts: 34
Location: Florence, SC

sikolymester wrote:
Try to pull up the reset pin to vcc with a ~20kohm resistor.
It might be worth a shot.


Yes, good idea; I just tried 20k and 15k but still get same error message.

I haven't heard back from Atmel support yet, might be a few days. In the mean time, I have a chip that I put in debug mode myself and I am debugging with it fine with the AVRONE. That would be ok if it was the only way, but that shouldn't be required.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
cshutchinson
PostPosted: May 22, 2012 - 01:46 PM
Rookie


Joined: May 02, 2012
Posts: 34
Location: Florence, SC

Update from Atmel. This is indeed a bug in Studio 6. Here is the official response:

Dear Customer,
Thank you for contacting Atmel.

I’m afraid this is an issue with Atmel Studio 6, where it fails to program DWEN fuse while going into a debug session. I could reproduce the issue here.
As you said, manually programming DWEN fuse enables debugging using Atmel Studio 6, this method can be used. As long as ISP programming is not required, you may keep DWEN programmed. In that case, select ‘Disable Debugging’ instead of ‘Disable DebugWIRE and Close’.

Another temporary solution is to use AVR Studio 5.1.208 for debugging.
We’re really sorry for the inconvenience in this regard.

Best Regards,
Jain Joseph
Atmel Technical Support Team
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
cshutchinson
PostPosted: May 24, 2012 - 08:25 PM
Rookie


Joined: May 02, 2012
Posts: 34
Location: Florence, SC

Atmel was nice enough to email me a new DLL that fixes the problem. If anyone needs it let me know.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
jtowich
PostPosted: May 30, 2012 - 04:32 AM
Newbie


Joined: May 21, 2010
Posts: 4


I could use the new DLL. Email to joe@ntsengineering.net. Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits