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
hemmerling
PostPosted: Sep 23, 2011 - 08:29 PM
Wannabe


Joined: Aug 04, 2011
Posts: 96
Location: Hannover, Germany

Hmmm.. how can you "throw a breakpoint" into a volatile variable ?

Maybe if you need a breakpoint at a specific point in the code, and want to be shure that it is not deleted by the optimizer, address a volatile variable at that point ?!

Sincerely
Rolf

_________________
http://www.hemmerling.com
SCADA Expertness - Quality Intensification for IT + Automation
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Sep 23, 2011 - 08:34 PM
10k+ Postman


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

Admit it - you haven't read the article have you?

Bottom line: debug C+Asm

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
hemmerling
PostPosted: Sep 23, 2011 - 09:01 PM
Wannabe


Joined: Aug 04, 2011
Posts: 96
Location: Hannover, Germany

Guilty Sad.
Please point me to the article Smile.
I will read immediately.

Sincerely
Rolf

_________________
http://www.hemmerling.com
SCADA Expertness - Quality Intensification for IT + Automation
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Sep 23, 2011 - 09:37 PM
10k+ Postman


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

Quote:

Please point me to the article

I gave the link above. Wink

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
hemmerling
PostPosted: Sep 23, 2011 - 10:04 PM
Wannabe


Joined: Aug 04, 2011
Posts: 96
Location: Hannover, Germany

I just read in the paper XMEGA-tutorial from the official World-Tour workshop

Quote:
Change project optimization.... Choose None (-O0 ). This is to be shure that the code associated with the breakpoint, is not optimized away by the compiler.


So my advice was compliant to the offical Atmel ASF Team mind Smile.

But to be honest, as my sample project grows, I get the error "No Souce Code" even I setup the compiler optimization to -0O.

So it was not a final solution.

Sincerely
Rolf

_________________
http://www.hemmerling.com
SCADA Expertness - Quality Intensification for IT + Automation
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Sep 24, 2011 - 12:21 PM
10k+ Postman


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

Quote:

So my advice was compliant to the offical Atmel ASF Team mind

Yes but to be honest they don't actually seem to have the first idea and -O0 is the "babies" way of debugging. Why not try the way the grown ups do it. The compiler only optimises away pointless code so if you cannot place a breakpoint it's because what the code is doing is pointless.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Oct 03, 2011 - 04:31 PM
10k+ Postman


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

Well I've just been bitten by this bloody "no source available" thing in AS5. For the benefit of the developers I then dropped to a command prompt and used "avr-objdump -S projname.elf" and it showed me the source. So the problem isn't that the ELF doesn't contain it - it's that for some reason the debugger cannot "see" it.

BTW I'm offered a "Browse to find source" link but clicking it does not produce a file browser?!?

Oh and this was a project that previously had one .c file. Someone sent me a new one. I removed the original file. Added the new one. Then rebuilt - maybe this is relevant?

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
Kraal
PostPosted: Oct 04, 2011 - 08:33 AM
Wannabe


Joined: Jul 10, 2006
Posts: 78
Location: Switzerland

Hello to all,

I had the same problem during the ATMEL Hands on tour (XMega), and I was the only one with this problem on 20 person. We tried to reinstall completely AS5 + ASF on my winXP 32bit, still it was not working.

But we found that the "No source available" has something to do with the fuse settings and the bootloader. If the bootloader was selected by the reset, then we get this message, but if the application was selected by the reset, then the debugging could start, however not breaking in main, but in an obscur asm file (can't remember which one).

But the ATMEL rep. there could not understand either where the problem was exactly, they think it's a bug in AS5/ASF/JTagICE3 (circle the correct answer Smile)
And of course the optimization had to bet set to -O0, if I wanted to be able to debug...

Best regards,
Kraal
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Oct 04, 2011 - 09:19 AM
10k+ Postman


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

Quote:

But we found that the "No source available" has something to do with the fuse settings and the bootloader. If the bootloader was selected by the reset, then we get this message, but if the application was selected by the reset, then the debugging could start, however not breaking in main, but in an obscur asm file (can't remember which one).

How very curious - I eventually cured it last night by copying the source .c file into a different place and re-building. Nothing to so with fuses, bootloader or anything like that.

It does seem a pretty serious problem though - a debugger that cannot debug is hopeless.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
Kraal
PostPosted: Oct 04, 2011 - 09:40 AM
Wannabe


Joined: Jul 10, 2006
Posts: 78
Location: Switzerland

Hi Clawson,

Can you please explain what you meant by relocating the source file ?

I can understand that the reset vector is altered by the fuse settings, but I don't know how the JTAG manage the bootloader and the application, and the starting point of the program (i.e. main() ).

Best regards,
Kraal

_________________
Have a nice day,
Kraal
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Oct 04, 2011 - 10:36 AM
10k+ Postman


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

Quote:

Can you please explain what you meant by relocating the source file ?

Someone sent me a .c file. I downloaded it to my E:\, I then used File-New Project in AS5 and let it create AVRGCC4. Unfortunately, though I didn't want it, it created an AVRGCC4.c and added this to the project. So I right-clicked that and used "Remove" to remove it then I right-clicked the project and used Add-Existing Item and pointed it to the file in E:\. Apparently it copied the file to C:\AS5\AVRGCC4\AVRGCC4\. When I built this then clicked the Debug&break icon I got the no source message.

I just tried to recreate those steps (by first removing the file from the project and deleting it from the \AS5\... location) but this time it works.

God you gotta love this reliable software - it's not even deterministic when trying to recreate the bugs!

Maybe I'll try creating a whole new project which will inevitably be AVRGCC5 I guess?

EDIT: Oh yeah, that reminds me - this lack of libm.a is really bugging me. I now recall that another step I took was to add libm.a to be linked (because the C file uses math functions).

EDIT2: Nope it worked this time with AS5. So whether the debugger can "see" the source or not would appear to be completely random?!?

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
awalker
PostPosted: Oct 18, 2011 - 01:43 PM
Newbie


Joined: Oct 13, 2011
Posts: 14


@ clawson, I am a beginner with AVR and dont follow your last post on this issue! I am experiencing the same issue when i optimise the program which i have to do. What would u recommend? Should i just switch to AVR studio 4.18?
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Oct 18, 2011 - 03:23 PM
10k+ Postman


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

Quote:

Should i just switch to AVR studio 4.18?

Until this kind of issue is fixed then yes.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
KreAture
PostPosted: Nov 25, 2011 - 10:24 AM
Rookie


Joined: Jun 11, 2005
Posts: 44


This issue has nothing to do with optimization levels at all.
It's a bug, it has to be.
I notice it varies on my computer (which has a SSD disk) from day to day with no changes in projects. Some days I can start debugging fine, others I get no source available and everything is very slow.

Simple projects with single files and a simple counter on a port can give this error. It has the code, it has the elf and yet it has issues talking to the debugger and claims that the debugee does not support setting breakpoints at runtime (while in stopped/paused mode).
It also does not "run/pause" to start of main but instead defaults to disassembler and the resetvector. Same code, chip and debugger in Studio 4 works as expected with no slowness and no errors.
There must be a statefull- or timing-bug in the way the different modules of avr studio 5 is communicating...
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Nov 25, 2011 - 10:26 AM
10k+ Postman


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

If you have .elf files where it does/doesn't occur try avr-readelf on them. Is the difference single (\) or double (\\) path separators?

See this thread for details:

http://www.avrfreaks.net/index.php?name ... highlight=

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
KreAture
PostPosted: Nov 25, 2011 - 10:31 AM
Rookie


Joined: Jun 11, 2005
Posts: 44


You are right regarding the -g flags however.
Especially when using multiple projects within a solution and compiling libraries. Often the default -g2 is lost in studio 5 and it reverts to -g0 causing issues with debugging.

Another thing to check, which has to do with the debugee reset timing is what clockrate you use on the debugger (for example the ice). Too low clockrate will actually cause issues due to the reset-timing.
Too high clockrate causes issues due to the ratio between internal clockrate and the debug signal rate.
On my sistem it works best if I stick between 1/4 and 1/6 F_CPU.
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Nov 25, 2011 - 11:46 AM
10k+ Postman


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

Just to say this is not a debugger timing issue - I see it all the time (well most of the time) when simply using the Simulator.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
KreAture
PostPosted: Nov 25, 2011 - 04:23 PM
Rookie


Joined: Jun 11, 2005
Posts: 44


I thought the simulator loaded like the debugger module? They appear to talk via some local tcp or such? That would allow same issue to affect both.
 
 View user's profile Send private message  
Reply with quote Back to top
peter9999
PostPosted: Dec 12, 2011 - 11:30 AM
Newbie


Joined: Jun 08, 2011
Posts: 8


Quote:
Just to say this is not a debugger timing issue - I see it all the time (well most of the time) when simply using the Simulator.


Yes it is a timing problem. I installed AS5 on a fresh W7-Installation, created a new fresh projecht wit the AVRGCC1.c, built it and tried to debug.

The Issue then sometimes occured, sometimes not, without any changes!

In my "normal" working OS (W7 too) it normally doesnt´t work, and sometimes rarely works.
 
 View user's profile Send private message  
Reply with quote Back to top
deancs
PostPosted: Dec 13, 2011 - 01:13 AM
Newbie


Joined: Aug 15, 2011
Posts: 1


I'm seeing this same issue (no source available) while trying to debug a xmega128A1 with an AVR Dragon in the latest version of AS5. I don't have the same issue with the Simulator. No problems with AS4.

Have been back and forth with Atmel support who were unable to reproduce the issue or provide any answers. They left me with:

"We recommend you to test with AVR studio 5.1 (target release date : last week of December 2011 as of now)"
 
 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