AVR GCC Debug in Eclipse

Go To Last Post
119 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

Anybody here using avr-gcc under eclipse (linux or windows) and has managed to debug a program with it ?

I have tried several tutorials on the net and they don't work!

That AVARICE tool is buggy to say the least, and the documentation is practically not existent.

My debug tool is AVR Dragon, but I do have temporary access to an AVR JTAG ICE MkII (and an MkI as well).

Can someone help?

PS: Target is AtMega128 over JTAG

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

I've not used it from within Eclipse but I have used avarice and avr-gdb. I didn't use it for long though as I have a copy of Windows. But it seemed to work.

Threads here suggest that the Dragon is a much more "problematic" debugger than ICEmkII, ICE3, etc. so your problems could be the debugger itself. If you have access to Windows try the same setup with AS6 to rule out hardware problems.

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

I have access to windows, AS6 doesn't like the Dragon at all. Even the JTAGICE MKII is acting up under it.

[RANT] Atmel should stop making IDE's and focus on compiler and supporting tools [\RANT]

I don't like AS past 4 .

The same setup was tried with the JTAG ICE MKII, but I could not get the avarice working properly.

The best I could do is start the debugging session, but it would not stop on any breakpoints except if I specified the function in the eclipse GDB config, and even then I could not see anything, not even the assembly !

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

Quote:

Atmel should stop making IDE's and focus on compiler and supporting tools

Eh? Atmel don't make the compiler, they just bundle the externally developed GCC tools. The only bit they primarily work on is the IDE and the D in that is the debugger.

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

I don't think the avr gcc extensions started to write themselves.

Lot's of companies don't "make" the compiler, just see ARM, but they all contribute to the compiler itself.

by the way, D is just another programming language !

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

Quote:
Lot's of companies don't "make" the compiler, just see ARM

That is an unfortunate example because they own Keil and armcc compiler is their product.

No RSTDISBL, no fun!

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

Quote:
I don't think the avr gcc extensions started to write themselves.

Nope. And they weren't initiated by Atmel either. Atmels comittment to avr-gcc (apart from writing plugins for it for their different AVR/Atmel Studio version) has been for a few years (since AVR Studio 5). The avr-gcc compiler and accompanying tools has been around much longer than that. [EDIT: The oldest commits in the avr-libc repo is dated 5 july 2002, and Popov and/or Roth and perhaps others must have worked on it before that. Definitively long before Atmel did anything on it. I will leave it to the interested reader to look into the GCC history for the first traces of AVR-GCC.]

Quote:
I have access to windows, AS6 doesn't like the Dragon at all.

We could try to solve that for you. My Dragons work quite well with AS6. So does my JTAGICE3. I do not own a JTAGICE mkII, but if it was acting up for everyone owning one then we would surely have heard the noise by now. And "doesn't like the Dragon at all" is a lousy problem description.

I had a Dragon-AVARICE-GDB stack running some months ago and it worked OK for me. I have had GDB running just fine in Eclipse, but with a non-AVR stack "under" that GDB. Still, GDB is standardized enough "upwards" for me to think that I could have had a Dragon-AVARICE-GDB stack talk just fine with the Eclipse GDB-plugin.

Give us some hard facts on how the Dragon, JTAGICE mkII and Studio 6 fails for you.

Give us some hard fact on "That AVARICE tool is buggy to say the least".

Or let us know that you just wanted to whine a bit, and then we can all move along.. :evil:

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Quote:
some hard facts on how the Dragon, JTAGICE mkII and Studio 6 fails

For the Dragon:

I set AVRDragon as debugger in AS5/6/6.1 (who cares they are the same)

I start the debugging (Debug->Start..).

Code compiles, pretty much successfully (did you noticed that the AS6.1 embedded compiler is outdated?)

Firmware download starts, it flashed the chip then spits out some stupid error that it cannot flash the chip, and this error is UNDER the main window, which blocks the whole AS, and it doesn't even show on the taskbar.

Result: Cannot Debug.

For the JTAGICE MKII:

Set debugger, compile and flash chip, like above, except that the flashing works, no error.

The actual debugging starts.

I can only set ONE breakpoint, the rest are simply ignored without any warning or information displayed on screen.

If I do the stupid thing of setting more than one breakpoints, and would like to stop the program at breakpoint 2, it would not stop there unless I delete breakpoint 1 and then I stop and start the debugging session once again.

--------------------

I do not care much about the new AS, i want eclipse. The only fact I've downloaded the AS is for the drivers, which you cannot get otherwise! (like they could not be bothered to pack them separately)

There is a huge amount of data to be downloaded just for the sake of running an IDE which doesn't even work properly.

Combined with the underlying .NET 4.x and Visual Studio the download size EXCEEDS 4GB !

Did anybody that worked/works on AS ever took some time to check what the rival companies offer as an development suite for LESS then 4GB?

Quote:
"That AVARICE tool is buggy to say the least".

- No proper tutorial to get it going (not even in command line)
- it cannot flash the MCU (at least 2.12 could not, 2.13 doesn't even try)
- dead slow, takes 120 minutes to go through about 500bytes of compiled code

Quote:
Or let us know that you just wanted to whine a bit

I did not posted this to WHINE about something, I've posted this in the hope that somebody would help me, but "Some questions are not to be answered."

Quote:
think that I could have had a Dragon-AVARICE-GDB stack talk just fine

Now who's bragging ?

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

Quote:

(who cares they are the same)

That is so not true it isn't even funny!

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

Quote:
some stupid error

Again, dont be sweeoing in your descriptions. State the exact error message.

Quote:

There is a huge amount of data to be downloaded just for the sake of running an IDE which doesn't even work properly.

Which does not even work properly for you. Many people use Atmel Studio with a Dragon with sucess. Many people use Atmel Studio with a JTAGICE (be it a mkII or a 3) with success.

But, since you've made up your mind as to not using Atmel Studio we can leave that there.

This effectively leaves you with AVaRICE. As I said, I had it running with GDB a while back. I did not take notes. I did not save anything from the setup. IIRC it flashed the AVR properly. It did not have the dead slow performance you experienced.

If you start feeding us details on your AVaRice experiences we might become interested enough to take a shot at it ourselves. There are some very curious people here who just love a challenge. What they don't like is sweeping formulations, lack of hard information etc.

Re the missing tutorial, this might be remedied if we together can get you up to speed on Dragon+AVaRICE+GDB: If we solve your problems rtogether - can you promise you will write the tutorial?

Quote:

(did you noticed that the AS6.1 embedded compiler is outdated?)

Atmel has to build the tool chain some time, and then freeze that. I would expect testing, packaging, testing again etc to cost a few months of outdating. Since GCC is free software you can always build it yourself.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

I have often wondered about AVR and Eclipse or some non-Windoze IDE.

Whereas there are many people here who express their undying hatred of Microsoft, I am not aware of anything that is any practical alternative.

Of course, Rowley will work natively on Mac, Linux and Windoze.
IAR, Studio, ImageCraft only run on Windoze.

I would happily try out an Eclipse or Code::Blocks IDE that has proper support for JTAG/debugWIRE/PDI
However, I just want to install a package rather than have to hand-craft everything myself.

Apart from Joerg, does anyone actually compile/debug in native Linux ?

David.

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

Quote:

IIRC it flashed the AVR properly.

Except that Joerg (the maintainer) recommends using avrdude to program and avraice only to debug (he presumably knows something we don't!).
Quote:
(did you noticed that the AS6.1 embedded compiler is outdated?)

Eh? It is 4.7.2? This is a fairly recent (and stable) version of avr-gcc.
Quote:

I would happily try out an Eclipse or Code::Blocks IDE that has proper support for JTAG/debugWIRE/PDI

Which is exactly what avr-gdb/avarice provides. I'm old school so I used "ddd" in Linux when I was experimenting ;-)

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

I will write a tutorial, if I get it going, fully.

So here is what I have setup as a development environment:

Windows (XP and 7 x64):
- eclipse kepler (or Juno) with AVR Eclipse Plugin and CDT support (including GDB);
- avr toolchain 3.4.2;

Linux:
- eclipse kepler (or Juno) with AVR Eclipse Plugin and CDT support (including GDB);
- avr-gcc, avr-binutils, and avarice;

The avr toolchain for windows contains avarice 2.9 which was released on 2009-03-05 !!! (just 4 YEARS OLD)

To get the latest version you need to download and compile it from here: http://sourceforge.net/projects/...

On Windows you must use cygwin, otherwise it will not compile.

On Linux avarice is usually version 2.12, but you can compile the latest version yourself very easy

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

Quote:
when I was experimenting

I use linux everyday (Fedora and Arch).

Quote:
Eclipse or Code::Blocks IDE

Both work very well for PC programs, including the GDB part.

However in the AVR world things are not so simple.

But look on the bright side, on linux you don't have to download and install the drivers for your debug tools, they are already there.

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

If you would like to put a package together that I can install on Ubuntu, I would happily give it a go.
If you can convince me that it works as well as Rowley, I would be very interested.

No, I don't want to assemble and patch all the components before starting. I want to 'install and go' with a working system.

Once I have become familiar with everything, I don't mind making minor upgrades. When / if there are substantial changes, a new package should be released.

David.

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

Quote:

I use linux everyday (Fedora and Arch).

Yup my main PC boots into Kubuntu 12.04. I then run VirtualBox VMs in it running WinXP SP3, one holds AS4 + AS6. Nothing would make me choose to do AVR development in Linux when I can have a far richer experience in Windows (though admittedly you have to pay the entrance fee to be able to do that).
Quote:

The avr toolchain for windows contains avarice 2.9 which was released on 2009-03-05 !!! (just 4 YEARS OLD)

Atmel's toolchain for Linux is here:

http://www.atmel.com/tools/ATMEL...

that contains avr-gcc 4.7.2. I don't think that's more than 6 months old (probably less in fact).

However it is only compiler, AVR-LibC and binutils. There are not other AVR related utilties like avrdude, avraice, simulavr, etc. packaged in it - those need to be sourced (and likely built) separately.

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

no ofense to clawson and david.prentice, but have you ever heard of "package manager" ?

Ubuntu/Kubuntu/ubuntu already has avr-gcc precompiled, with the binutils and avdrude and avarice, and the rest of the tools.

Never used a package manager on ubuntu?

Open a terminal and enter this in it (without quotes):
"sudo apt-get install avr-gcc avrdude avarice"

Quote:
I then run VirtualBox VMs

I had some Windows XP programs that I used the same way as you, but then I've figured out how to setup wine.

Quote:
(though admittedly you have to pay the entrance fee to be able to do that)

I already have a Windows 7 x64 Pro license, I just don't use it that much.

Quote:
If you can convince me that it works as well as Rowley, I would be very interested.

The toolchain itself works, the debugging sucks through (blame A... for that)

PS: please tell me how much data have you downloaded after running the sudo thing above.

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

Quote:

no ofense to clawson and david.prentice, but have you ever heard of "package manager" ?

Yes but we know that the Canonical engineers who maintain the Ubuntu repository haven't the first idea about building avr-gcc and in the past have built truly atrocious versions that should be avoided at all costs. For that reason I used to host .deb files for Bingo's builds (see sticky at top of this forum) on my website at:

http://www.wrightflyer.co.uk/avr...

However note the last thing on that page - as Bingo builds only go up to 4.5.1 the best way to get an up to date, proven avr-gcc for Linux is the Atmel distribution (their private branch also has support for more devices than the HEAD of GCC). Atmel distribute their build as a .tar.gz (not .rpm or .deb or whatever) so you have to live with it if you want a decent copy of avr-gcc on Linux.

Quote:

Never used a package manager on ubuntu?

Try not to make yourself look an idiot. Everyone who's ever used Ubuntu has used dpkg/apt-get/synaptic or similar.
Quote:

but then I've figured out how to setup wine.

Yeah right - see how far you get making AS6.1 run on wine! :-)

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

Quote:
Everyone who's ever used Ubuntu has used dpkg/apt-get/synaptic

You'd be surprised !

Back to the matter at hand, there are already made packages for avr-gcc available for almost every linux distribution, so it should be relatively easy to install one.

but after you install it, what do you do? How exactly do you debug your code?

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

Quote:

there are already made packages for avr-gcc available for almost every linux distribution,

yeah but made by whom? And did they know the subtleties of what were the vital patches to be included for the version they were packaging. Evidence here seems to suggest not.

As SprinterSB (who really is an expert!) has said the latest 4.7 and 4.8 versions can pretty much be built without patching but the same was not true up to 4.6.x and there's a lot of repo versions that are of that vintage or earlier built by people who simply pulled "HEAD" (or release tag/label) and did the configure/make cycle without realising they were missing some vital part of the puzzle.

Quote:

but after you install it, what do you do? How exactly do you debug your code?

On Linux I generally only build (if I want to test something and don't have the right WinXP VM switched on at the time). If I want to debug I'd always switch to Windows and AS4 (or now AS6) as there's nothing else approaches it for debugging and simulation.

As I say, in the past I've tinkered around with ddd (sometimes C::B), avr-gdb, avarice (or simulAVR) just to familiarise myself with operation and see how the process works. There was nothing there that would entice me away from Windows though - YMMV. (perhaps I'm spoilt by having a licence to run Windows and therefore being able to choose).

There are many things on my machine I'd much prefer to do in Linux (which is why I have both) but given Atmel's preference for Windows, AVR development isn't one of them.

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

Quote:
Atmel's preference for Windows, AVR development isn't one of them.

Let's change that !

avarice steps should be the same on windows as they are on linux, at least that is what I have experienced.

On my Fedora 18 linux distro I have avarice 2.12.

how to use that ?

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

Microgala wrote:
Quote:
Everyone who's ever used Ubuntu has used dpkg/apt-get/synaptic

You'd be surprised !

Back to the matter at hand, there are already made packages for avr-gcc available for almost every linux distribution, so it should be relatively easy to install one.

but after you install it, what do you do? How exactly do you debug your code?

I accept your criticism. I have never attempted to install the Ubuntu avr-gcc package because of reports that it is badly built.

If you would care to test some current packages and report your success, I am very willing to have a go.

I would like a "recommended" list with your personal approval.

I have only used Rowley on Ubuntu. This works very well.

As a general rule, it seems wise to use the best tools for any job. If they are on Windoze, so be it.
I would certainly be very willing to do things on Ubuntu if they worked as well as the market leader's software. e.g. Keil, Rowley, IAR, ...

David.

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

Quote:

no ofense to clawson and david.prentice, but have you ever heard of "package manager" ?

That is quite ironic, since you complained above that Atmels AVR Toolchain is not up to date. Go investigate how much more up to date the different GNU/Linux distros repositories are..

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

My distro's are quite up to date. Remember who has to gain from maintaining an up to date compiler?

Let's not make this about what linux is best or just another windows vs linux war.

The problem still remains: HOW DO YOU DEBUG USING AVARICE?

I have attached avarice 2.13 and 2.12 for windows, precompiled by me. Let's start with those and get this thing on the road, shall we?

EDIT: seems the forum will not accept any upload I make, so here it is on an upload site:

https://docs.google.com/file/d/0...

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

Seriously, if you can recommend specific packages, I would give it a go. Likewise, many others would too.

As far as I understand, there is nothing that compares with Studio on Windoze. (Apart from Rowley)

If someone out there can point to a Linux solution, then others would join them. With some real users, we could all help each other. No doubt, share special techniques with avrice.

Meanwhile, I will stick to Studio.

David.

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

Let me figure this avarice out, because without it you will just have a compiler.

I don't exactly know how bad the avr-gcc on ubuntu situation is, but clawson made some packages here:
http://www.wrightflyer.co.uk/avr...

And if you want newer ones, get them from atmel:
http://www.atmel.com/tools/ATMEL...

As for an IDE, I use ECLIPSE, mainly because I switch between Windows (at work) and Linux (at home) a lot and it helps very much to have the same interface.

Eclipse also has SVN/CVS/GIT integration and lot's of other stuff, like an ARM plugin, or MSP430 plugin.

Aside from Eclipse for C/C++ you will also need AVR plugin for eclipse.

If you don;t want to get eclipse from your linux distro (or you are using windows) here are some links:
- Eclipse CDT http://www.eclipse.org/downloads...
- AVR Plugin Eclipse http://avr-eclipse.sourceforge.n...

avarice will have to be install from your distro's repo, or you can compile yourself from here http://sourceforge.net/projects/...

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

Well, in the next few days, I hope to hear that you have personally installed and tested all of this.

When you report that it all works, I will give it a go.

My only experience of Eclipse is Code-Red's LPCXpresso (which I am not fond of).

David.

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

Quote:

My distro's are quite up to date.

Then things has gotten better, then. In the past, the patches for ar-gcc had a soewhat hard time trickling up to GCC and then down to the distros.

Quote:

Let's not make this about what linux is best or just another windows vs linux war.

For me it was neither. It was simply about GNU/Linux distros not being very up-to-date re avr-gcc. At least historically, this was a fact. If your statement above is correct then I was out of date, and things are better now.

Quote:
The problem still remains: HOW DO YOU DEBUG USING AVARICE?

I did a search for the posts where this was sort of discussed a while back. I found them somewhere around september 2012. I know I had a stack of Dragon - AVaRICE - GDB running. No, no integration into any IDE like Eclipse, but that should be the least problematic thing, I suppose.

FWIW, heres the thread I found: https://www.avrfreaks.net/index.p...

I checked yesterday that I still have the hardware to repeat my setup, and it was all there (Dragon, STK-600 w/ ATmega2560, cables galore). For software, I suspect that I used what came with WinAVR-20100110.

Also, note that there is a caveat in that other thread that the Dragon might need old firmware to work together with the version of AVaRICE I used (whatever that version was).

I might be keen on trying to get this thing going again. This will be the upcoming week-end at the earliest - if something else (sleeping? building? biking? beer-drinking?) seems more fun then the AVaRICE thing loses.

Re building AVaRICE yourself, and Cygwin being required: I'm not sure this is correct anymore. IIRC Eric did build the complete WinAVR setup using MinGW rather than Cygwin. And WinAVR contains AVaRICE. Ergo: AVaRICE is likely buildable on Windoze using MinGW. Details are in the web/online avrlibc manual.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Wed. Aug 14, 2013 - 12:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There must be thousands of AvrFreaks members who run Linux as their main o.s.

So I would have thought that one or two have managed to get a usable Eclipse / Code::Blocks setup. Let's hear from them.

If there is some minimal hand-holding, there could be many happy users. I have no particular attachment to Windoze. OTOH, I can't see much sense in rejecting perfectly good development software just to replace it with a poor Linux version.

David.

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

Quote:
AVaRICE is likely buildable on Windoze using MinGW.

Probably it worked for some older versions, or my MinGW is missing something.

When I've tried to compile 2.13 is stopped because it could not find which is a linux only header.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
some minimal hand-holding

Aside from debugging, which I'm still struggling with, Fedora and Arch keep a pretty up to date avr-gcc and additional tools (avrdude...).

Eclipse will handle makefile generation automatically, I think the current Code:Blocks will do that too. Also, syntax coloring.

A very useful feature of eclipse is the ability to access the header files directly in the editor, even if they are no included in the current opened file. For example if you forget in which header strcpy is, then you just ctr+click the function name and it opens the header automatically.

Other useful (but still beta) features of AVR eclipse are multiple configuration for build, for different processors, in case you use the same code base for two somewhat different projects.

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

Quote:

keep a pretty up to date avr-gcc and additional tools (avrdude...)

Maybe up to date, but well built?

BTW I don't think either avrdude nor avarice care what version of firmware is in either Atmel programmers or debuggers.

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

Quote:
but well built

Good enough, in my humble opinion.

You can search the packages on the net, SRPMS for Fedora, and check to see how exactly they've compiled it, but I never had a problem with it.

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

I can't see much point in a build-only setup.
It is the JTAG debug that is the important component.

Rowley manages this very well for real hardware debugging. Unfortunately it does not attempt any serious simulation of peripherals.

I have been spoiled by Studio (and other IDEs that can both Debug and Simulate)

Yes. I doubt that avarice worries about firmware versions. Rowley certainly manages very well with the basic JTAG facilities.

David.

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

There is a project called simulavr, but that is another story.

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

I added a simple debugger to the contiki cooja AVR simulator a while back. It does an objdump of the .elf file and parses the text output to get the starting program flash address of each c and asm line (which is not the best way to get that data since it depends on output formatting).

Avrora does the underlying simulation and cooja handles the radio and serial I/O. It is written in java. Only a few MCUs are implemented (mega 128, 1284p, 128rfa1, tiny85). Adding a new one is straightforward but somewhat tedious, especially the remapping of all the timer control fields.

Screen dump https://github.com/contiki-os/co...

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

Nobody cracked it yet?

It still doesn't work!

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

Quote:
Nobody cracked it yet?

As I said above - I did a year ago or so (AVR to Dragon to AVaRICE to GDB). But I have no notes/memories and have not had the time to repeat the experiment.

On the page that I linked to above, there is in turn a link to a document by Colin O'Flynn. Did you read that? I'm fsirly sure that it was in part helping me.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Johan,

If your experiments were a year ago, can I assume that your Eclipse experience was not very appealing?

If Eclipse is better than AS6 or Rowley, I would quite happily try it. Otherwise, I can't see much point.

David.

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

Quote:
It still doesn't work!

Ah, you mean THAT avarice!
I had to search archive.google for it.
Man, that is a misplaced topic.
You will not gain attention about avarice subject in "GCC Forum".
You should have searched the "Avrcheology Forum".
I bet one session of debugging blinky on ARM or MIPS and your fascination with passed centuries vanishes instantly.

No RSTDISBL, no fun!

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

Quote:
If your experiments were a year ago, can I assume that your Eclipse experience was not very appealing?

As stated above, I had this chain running:
Quote:
AVR to Dragon to AVaRICE to GDB

Nothing more. I just typed commands into GDB. Bevertheless, getting thst part of "the stack" running should be the difficult part. Eclipser has a GDB plugin that should fairly easily be pointed to GDB. Cliff did something similar for ddd (another GDB front end).

For other architectures I have had a stack with GDB and Eclipse running. (That time it wan't AVaRICE below GDB but OpenOCD, which in turn had TI/Luminary Cortex-M3 hardware beneath it.)

I once tried to favour Eclipse for getting a cross-platform development environment (i.e. same on GNU/Linux as on Windoze). In the long run it was a terrible experience. It simply is too big..

These days I tend to favour NetBeans for such a development environment. Much neater. Straight forward. It also has a GDB front-end/plugin. I'm hoping to get an AVR-Dragon/JTAGICE3-AVaRICE-GDB-GDBplugin-NetBeans stack going but am not desperate. AS6 on Windows works just fine for me until I get there. (Possibly never..)

I agree with previous posters. As long as you're on Windoze only and use avr-gcc there is no need to go for anything but Atmel Studio.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Quote:

Cliff did something similar for ddd (another GDB front end).

I would forget the Eclipse, Netbeans or even ddd for the time being and just get:
Quote:
AVR to to AVaRICE to GDB

working. Once you can step a program in command line GDB *THEN* worry about wiring it up to some fancy IDE front end.

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

Quote:

Once you can step a program in command line GDB *THEN* worry about wiring it up to some fancy IDE front end

That was what I was inteding to say with this (spelign misteaks, and all):
Quote:

Bevertheless, getting thst part of "the stack" running should be the difficult part. Eclipser has a GDB plugin that should fairly easily be pointed to GDB.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

So can I assume that no-one has ever got any avr debugger going with OpenOCD or avrice ? At least with a pleasant GUI environment.

I believe that even Joerg only uses command line debugging.

As far as I can see, there are a few free ARM setups that work ok. Many of the ARM setups use arm-gcc and OpenOCD under the hood. They tend to be "not-free" when you exceed 32kB of code.

I can only guess that Rowley developed their ARM IDE, and then adapted for AVR and MSP430. But of course they are not free either. However, it does show that Linux (or Mac) are just as good for development platforms as Windoze.

David.

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

Quote:

or avrice ?

Yes with avarice. Just long enough to remind me that there's nothing like Studio (4 as it was then) for Atmel debugging ;-) This cannot be rocket-science though so I'm tempted to just do it again to prove it works.

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

This is my point. I would guess that Rowley, Code-Red, CooCoox etc have tied everything together. Then display the results nicely for the punter to see in separate windows.

I would also guess that the window management and script management between front-end and back-end is the complex part.

Let's face it. Studio4 was doing this many years ago. If Atmel had not done it for free, punters would have made a serious effort to do it in Open Source.

I would also guess that the impetus behind ARM development environments was because the original hardware and software was very expensive. Mind you, the ARM RealView compiler is massively better than the GCC compiler. Likewise, the Keil (ARM) tools are probably worth the money.

David.

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

Quote:

I would also guess that the window management and script management between front-end and back-end is the complex part.

Well yes and no. It has been standardized for years (decades?) in the gdb serial protocol (it's the same thing that lets you debug remote targets over TCP/IP) so the dividing line between the debugger and what it's debugging is a well documented protocol that many tools are based upon.

As I understand AS6 they may be using a similar (identical?) division between front end and back end which should maybe allow AS6 to be adapted to things like OpenOCD etc.

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

I see lot of mentioning here about AS6 and how well AVR development works under Windows, by using it.

When AS was at version 4, I agreed with the feeling that the best development solution is from Atmel, but at that time I was programming some of my project using assembly, which is no longer a viable option because of the time consumed and other drawbacks.

Nowadays almost every MCU manufacturer is trying to make their development tools so they can run cross platform.

Freescale dropped their Windows only IDE and went to eclipse 3.4 (I think) and build an very useful IDE on top of it, complete with tool integration.

TI based their new code composer on eclipse as well, and they support ARM and MSP430 under the same IDE, not to mention there is a very good AVR-like compiler for the MSP430 architecture that runs on pretty much any platform, and there is also an eclipse plugin, for those who need hand holding.

Microchip (who would have thought) entered the race and they have developed their MPLABX IDE based on Netbeans (which shares eclipse code).

Examples can continue.

And above all these tools have another thing in common: size!

New cross-platform IDE are either smaller in size than their ancestors or better equipped (more options) for the same size.

Now what was Atmel's response to this trend ?

Well they slapped on a Visual Studio IDE with minimal customisation, and all this led to a very big installation package.

Compared to AS4 the only notable thing in the new AS series is syntax highlighting, the rest is not that great.

You probably think "why is this guy complaining about size?", well just install AS6 on more than one PC (especially on Win XP) and then you will know the answer.
I had to upgrade about 10 PC to AS6 and it wasn't no picnic! After the whole process was completed (including windows update for Visual Studio) I've lost 5 days just to install some programs.

I've decided then that I don't want to use any part of the new AS.

Since I am using eclipse for software development (not just AVR) I've tried to find an alternative to debugging the AVR arch under my IDE. Only solution: avarice !

But I can't seem to get it to work, even under command line.

I can load the elf file and start the debugger.
I can stop at

But I can't view any variables (even in gdb) and the disassembly has a mind of it's own (sometimes it works other times it doesn't). Also no source code tracking.

I've read the avarice PDF, which supposed to be a tutorial, but it is not so helpful regarding debugging from the gdb command line.

As far as gdb integration in eclipse goes, it actually works, tested with x86 (PC program written in C) and MSP430 (mspdebug), but no avarice !

PS: did I mention that you have to download and install the whole AS if you want to get the drivers needed for your atmel debugging devices to work under windows?

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

Quote:
But I can't seem to get it to work, even under command line.

Well, I suppose you did try on different windozes, different JTAGICEMks and different AVRs?
Quote:
I can load the elf file and start the debugger.

Really? Did you verify the memory content with dude? AFAIK avarice does not maintain "load" option any more.

No RSTDISBL, no fun!

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

I have avarice 2.9, 2.12 and 2.13

Loading sequence was the following:
- flash debug program with avrdude, and ensure OCDEN is set
- start avarice, without downloading the program
- step run, or simply run, until it hits main (breakpoint previuosly set at gdb launch)
- try disassemble from current row (sometimes it works)
- try to display source (not working)

Windows OS:
- XP Pro SP3 (with updates and AS6)
- 7 Pro x64 (with updates and AS6)

Linux:
- Fedora 18
- Arch

avarice feels a lot more better under linux, at least I do not have to enter full path in order to start it.

No matter the OS, program downloading was not working in avarice, that is why it was dropped in 2.13! Apparently GDB transfers the program 1 byte at a time, and avarice can't handle this (ever heard of buffering?).

Debug interface: JTAG
Debug hardware: AVR Dragon (preffered and mostly used), JTAG ICE MKII

Target: Atmega128, Atmega64

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

Quote:

at least I do not have to enter full path in order to start it.

You don't in Windows if you add it's location to PATH.
Quote:

program downloading was not working in avarice,

Joerg (the maintainer) has said you must use avrdude to actually program the code. I guess he doesn't want to maintain two virtually identical code bases.

Pages