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
darulezy
PostPosted: Jun 29, 2010 - 05:57 AM
Newbie


Joined: Sep 29, 2009
Posts: 7


Hi,

I'm lost as to why this is happening, once my Code size exceeds 4546 bytes I get the following message when the gode is uploaded;

"Platform has been disconnected, leaving debug mode"
(It seems to hang at 'Loading event memory')

Other messages in the message window are as follows;
AVR Dragon: Timed out while waiting for response from the emulator. Please check cables and emulator power.
Coordinator: Error when writing memory contents to the debug platform.
Coordinator: Error loading object file.

This is on the AVR Dragon via dW (ISP) to a ATMega328P
If I remove a subroutine, any subroutine to bring the Code size at or below 4546 bytes then the problem goes away (after restarting AVR Studio 4.18 SP2 b700 & the Dragon & the target)

I tried searching and my problem appears unique, any help would be welcome at this point.

This was the closest search result, of no help...
http://www.avrfreaks.net/index.php?name ... mp;t=58312
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jun 29, 2010 - 10:14 AM
10k+ Postman


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

Sounds like a dodgy connection with a statistical likelihood of communication errors where the probability of error exceeds 1 with that code size.

A common problem with Dragon is using cables that are too long between the Dragon and the target. Also there must be no other components connected to the RESET pin of the AVR.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
darulezy
PostPosted: Jun 30, 2010 - 12:09 AM
Newbie


Joined: Sep 29, 2009
Posts: 7


Thanks for your reply clawson,

This morning I made a new ISP cable about 3" in length (80mm) any shorter would be inpractical. The PCB Trace length is about 3/4" (20mm) long.

I had a 10K pullup resistor on the reset line, so I've removed it.

Unfortunantly the problem is not resolved.

EDIT - UPDATE!
I tried adding mode Data space to see if I could jump over the problem area, SUCCESS!

When .cseg "Used size" is in the range of 4786 and 4800 bytes the timeout error occurs.
Once the Used size is 4802 bytes and above the timeout problem does not occur.
 
 View user's profile Send private message  
Reply with quote Back to top
nicked
PostPosted: Jul 29, 2010 - 03:09 PM
Newbie


Joined: Mar 21, 2004
Posts: 1


I have the same problem, I was reducing code size and suddenly my dragon start crashing, SOLUTION: I increased the size of an SRAM array, and the problem disappeared. If any dragon developers are reading this, please fix it.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
stefann63
PostPosted: Aug 03, 2010 - 07:09 AM
Newbie


Joined: Jul 14, 2010
Posts: 1


Same issue here...
Making a new project and everithing was fine until reached program size 4794 bytes.
At than point when loading program got message:
AVR Dragon: Timed out while waiting for response from the emulator. Please check cables and emulator power.

Increased code size to 4808 bytes and problem was gone for now.
My setup:
AVR Studio 4.18.700
GUI Version 4, 18, 0, 685
AVR Dragon 1, 0, 1, 2
AT90USB162 37

Operating System
Major 6
Minor 1
PlatformID 2
Build 7600

Plugins:

AvrPluginAvrAsmObject 1, 0, 0, 48
AvrPluginavrgccplugin 1, 0, 0, 11
 
 View user's profile Send private message  
Reply with quote Back to top
AchimKraus
PostPosted: Nov 25, 2010 - 11:08 AM
Newbie


Joined: Nov 25, 2010
Posts: 2


Really great workaround!

Yesterday morning the "debugWire" stopped working (with the last extension of my program). I searched, searched and found (after a lot of other informations) this thread. And simply saying, that's it! No wiring nor powering issue, just adding a few code bytes makes it working again!

AVR Studio 4.18 SP 3
ATTiny24A

Problem at 698 bytes code + 2 bytes data,
working again at 714 bytes code + 2 bytes data.
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Nov 25, 2010 - 11:29 AM
10k+ Postman


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

I am really sceptical.

It is always possible that there is a Dragon bug that is sensitive to some particular magic value.

Please can you post the source code and the ELF file that gave your problem. A 698 byte Tiny example is far easier than a 4808 Mega example.

'diff' is your friend. Showing the 'edit' that made everything better.
Posting the diff o/p would be useful too.

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
AchimKraus
PostPosted: Nov 25, 2010 - 12:44 PM
Newbie


Joined: Nov 25, 2010
Posts: 2


Quote:
Please can you post the source code and the ELF file that gave your problem. A 698 byte Tiny example is far easier than a 4808 Mega example.


Here's the zip'ed project folder.

Use line 97

Code:

   /* comment out the next line stops "debugWire" */
/*   clock_prescale_set(clock_div_1); */

   PORTA = 0xff; /* 5 high outputs, 3 low inputs */       


to toggle the "debugWire" working and not working.


Last edited by AchimKraus on Nov 25, 2010 - 02:41 PM; edited 2 times in total
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Nov 25, 2010 - 12:59 PM
10k+ Postman


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

Quote:

But how can I post/upload the .elf file?

Use WinRAR, 7Zip or WinZip to collect all the files in the project directory into a single .zip or .rar and add that as an attachment here.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
jerryr
PostPosted: Nov 25, 2010 - 09:01 PM
Wannabe


Joined: Apr 23, 2004
Posts: 69
Location: Liederbach/Germany

stefann63 wrote:
Same issue here...
Making a new project and everithing was fine until reached program size 4794 bytes.
At than point when loading program got message:
AVR Dragon: Timed out while waiting for response from the emulator. Please check cables and emulator power.


There must be a virus flying around
I got exactly the same symptom with a program which grew from about 8600 bytes by a few bytes, on an ATmega168 + Dragon, and was quite dispairing. None of the usual things helped. After finding your mail with Google I added another 1.5k, and it worked. A small program ran too. This looks like a real bug in the AVR Dragon or AVR Studio. I use:
AVR Studio 4.18.716
GUI Version 4, 18, 0, 685
AVR Dragon 1, 0, 1, 2
ATmega168 201

Operating System
Major 5
Minor 1
PlatformID 2
Build 2600
Service Pack 3

Plugins:

AvrPluginAvrAsmObject 1, 0, 0, 48
AvrPluginavrgccplugin 1, 0, 0, 11
Stk500Dll 1, 0, 1, 15
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
jerryr
PostPosted: Nov 30, 2010 - 09:18 PM
Wannabe


Joined: Apr 23, 2004
Posts: 69
Location: Liederbach/Germany

I submitted a report to Atmel for the problem, the support person was able to reproduce it with the project supplied, he's submitted a bug report to the SW people. The ticket number is 617151, more news when available
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
SiliconFarmer
PostPosted: Dec 03, 2010 - 10:45 AM
Newbie


Joined: Jun 20, 2009
Posts: 1


I just ran into the same problem. ATtiny25V program crashes AVR Dragon / AVR Studio with code size of 698 bytes and 714 bytes, but OK at 802 bytes. Note that it does program the part before it crashes. Makes it hard to do debug, though.
 
 View user's profile Send private message  
Reply with quote Back to top
jerryr
PostPosted: Jan 12, 2011 - 03:54 PM
Wannabe


Joined: Apr 23, 2004
Posts: 69
Location: Liederbach/Germany

AVR support sent me a mail saying that the problem has been fixed, and that the fix will be included in the next AVR Studio release, date unknown
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
al_sledge
PostPosted: Jan 14, 2011 - 06:52 PM
Newbie


Joined: Feb 18, 2004
Posts: 4
Location: Key West, Florida

Exaxt same problem here using an ATmega644P. Code size 658 and it was OK. Code size 698 and no workie! One small change from "if (A = 1)" to "if (A ==1)", and bang! Had the problem. Removed the second "=" (my bug) and it worked again. Fixed my code problem and the Dragon failed. I added a dummy line adding a string "ACBD", code size jumped from 698 to 706 (as expected) and the Dragon debug works fine. Hope they come out with a bug fix pretty quick on this, but at least I have a workaround.

Thanks all for the tip!
 
 View user's profile Send private message  
Reply with quote Back to top
pyro2
PostPosted: Dec 23, 2011 - 03:42 AM
Newbie


Joined: Jun 25, 2011
Posts: 8


I know this thread is old, but I suffered from this same problem. Proposed solution in the thread gave me a work around - although by trial and error. Wanted to make it clear that you have to change the program size, not the data size. That worked for me. Anyone know if this has been fixed in a later version?

Pretty annoying bug.
 
 View user's profile Send private message  
Reply with quote Back to top
corevalue
PostPosted: Apr 03, 2012 - 08:07 PM
Rookie


Joined: Jul 21, 2007
Posts: 21


The bug seems to be still around. This time on an XMega128-A1, code size around 4344. I've seen it before on AMega164 around this size. Hopefully, the usual trick will work, but it's worth resurrecting the thread for others who may run into this nasty bug.
 
 View user's profile Send private message  
Reply with quote Back to top
corevalue
PostPosted: Dec 09, 2012 - 11:12 AM
Rookie


Joined: Jul 21, 2007
Posts: 21


I've run into this again, albeit at a much larger code size, and the symptom isn't quite the same. I get stuck loading the event memory on an XMega128A1, then it times out and disconnects the Dragon The XMega then runs the code OK, but I can't debug. It consistently does this, even when I change code size.
Studio 4.18 (tried to update to 4.19, didn't work).

[.cseg] 0x000000 0x00b2b6 2370 42360 44730 139264 32.1%
[.dseg] 0x002000 0x002620 0 586 586 8192 7.2%
[.eseg] 0x000000 0x000000 0 0 0 2048 0.0%
 
 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