What C compiler do you use for AVR ?

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

Just wanna (statistically) evaluate the usage of C-compilers for AVR... in order to decide what should I start to use :-)
Sorry, not all of them are listed... but you are free to suggest!

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

Last Edited: Sat. May 7, 2005 - 02:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I suggest searching the forum, this has been discussed to death.

Smiley

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

It seems that WinAvr "leads" the competition...
But I do have a question: WinAVR uses makefiles? :-(
Because I'm not familiar with these "makefiles" (it scares me somehow 'cause I'm not good at writing such files... hmmm I don't like makefiles at all).

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

AVRGCC / WinAVR comes with example make files.

also adding a few source files to your makefile project is a no brainer.

this is where iin the makefile, where the source FILES are added:

::
::
::
# Target file name
TARGET 	= 	main.c
WHOPPAH =   frenchfry/whoop.c
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET) $(WHOPPAH)
::
::
::

If you are able to learn from what you read, you're able to write makefiles,,, its easier if a tool makes the make files for you, a true software engineer wants to know what really goes on under the 'bonnet'

Good luck.

MY MICROCONTROLLER CAN BEAT THE HELL OUT OF YOUR MICROCONTROLLER /ATMEL

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

That's why working engineers buy a commercial compiler with 'engineer friendly' ide. You click on 3 c files to add to the project, click build, and bango, the makefile magically appears if you want to look at it for some reason. Otherwise, you just burn the binary. No need to be able to read unix regular expressions full of punctuation marks and strange default macro languages and other trappings of a masters degree in computer pseudoscience.

Imagecraft compiler user

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

Use the mfile utility supplied with WinAVR, it couldn't be much easier.

Four legs good, two legs bad, three legs stable.

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

KamAVR does a good job of automatic makefile generation. And you don't need to switch between the IDE and another application to add new source modules.

Do any of the other AVR compilers offer the flexibility that avr-gcc allows through the use of makefiles? For example, after creating the output hex file, I can customize the makefile to embed checksums, 'build numbers', etc. in the hex file. As well, I can merge several hex files together, etc. (For example, to bundle a bootloader with a default piece of application code. Or to add application-specific pieces of data to a common, pre-built program file.) All from the same 'build all' command.

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

Bob, I agree with you! :-)
For lfmorrison :
Apparently, CV does merge the app. & bootloader (of course if U want).
As for the rest... I do not know... yet :-)

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

After all, the embed/merge feature is not important for me in this very moment…
I care more about the “quality” & the size of the output file (HEX)… you know what I mean :-)
But…there is a limit: I don’t have too much money (hmmm, … yeah)... IAR is very expensive & maybe it is very good (I suppose...).

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

Does anyone know the price for IAR AVR compiler?

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

bobgardner wrote:
That's why working engineers buy a commercial compiler with 'engineer friendly' ide. You click on 3 c files to add to the project, click build, and bango, the makefile magically appears if you want to look at it for some reason. Otherwise, you just burn the binary. No need to be able to read unix regular expressions full of punctuation marks and strange default macro languages and other trappings of a masters degree in computer pseudoscience.

Well, I'm a working engineer and I use WinAVR, but then I've been using makefiles for 20 years.

Smiley

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

I'm also a working engineer and I also use WinAVR and makefiles.

Oh, and I also use UNIX, Linux, and BSD Unix (on a Mac) but don't have a masters in computer science... :mrgreen:

Please note - this post may not present all information available on a subject.

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

Sigh. Here we go again. Referring to
https://www.avrfreaks.net/index.p...

y'all may have to distinguish between "working engineer" and "professional quality" if brberie reads this thread. According to him, anyone that buys and uses CodeVision is just dabbling due to the "limited abilities" of the product. Anyone who disagrees with that assessment is shouted down with references to "unanswered questions".

Some of us that posted, our listed experience to the contrary, are nothing but "beginners" and "puppies" to the big dogs in life:

Quote:
CV is a perfect choice for beginners! When you will grow up you will find more and more reasons to switch gears. But from other hand a little doggie is forever a puppy and this is another proverb you are probable familiar with.

So, referencing past discussions, one needs to decide whether they are a "professional" or an "EE" or a "working engineer" or a "beginner" or a "puppy".

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

And, really people, makefiles are not that hard. Can you write a batch file that contains a list of commands that will be called? Can you assign strings to variables and use those variables in text replacement? Well then, gee! You can write a makefile!

Yes, there are a few little quirks to get used to, but there are quirks with any system.

And, as with all things in engineering, there are tradeoffs. Yes, a graphical IDE is simple to use. How flexible is it? Yes, using a makefile is incredibly flexible. Is it dumb-simple to use? See? There's the tradeoff.

In WinAVR, the tradeoff is somewhat mitigated by the fact that it includes:
- A Makefile Template that you can copy to your project and modify some variables at the top. This will get you quickly set up on a project and for the majority of things it will handle it. You don't have to directly deal with a lot of the complexity.
- MFile, which is a simple Makefile Generator with a GUI. It uses the same Makefile Template that is included in WinAVR. The GUI will help you change the variables according to your project and you can at least see what is happening.

KamAVR is an IDE for WinAVR. It is in the beginning stages right now and is not fully complete.

Also, a Project Management feature is coming to Programmers Notepad (included in WinAVR). I know I've been saying this for a long time, but now I'm finally alpha/beta testing some of the detailed features of it and helping the author to iron out the wrinkles.

Eric

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

Ouch... isn't it somehow complicated?
GccAVR -> WinAVR -> KamAVR ... (3 in the sequence... for now).
Some people would like something simple (all in one)... I should say.
Please, don't blame me; I'm only trying to get more info & to take the right decision:
what compiler should I choose.
I don't want to be "the seed of polemics". :wink:

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

Depending on how you look at it, I suppose that it could be even more complicated...

You see, avr-gcc is just the compiler. It needs a runtime library to do anything useful. The most commonly used library in avr-gcc world is maintained as a separate project, called avr-libc.

It also needs another set of tools to convert the compiled code into a form that the AVRs can use. That collection of tools is called avr-binutils.

binutils, libc, and gcc are all pretty standard fare when it comes to compilers for *nix platforms. All three products are developed independently (but with some cooperation) and it is up to the end user to make sure that they have a combination that is stable and works. Many people using Windows are prightened off when they hear about all that.

So, Eric Weddington, in concert with a variety of volunteers around the world, has gone through all the trouble of gathering all the tools together and producing a single binary distribution for all us Windows users, which includes everything you need to get the AVR cross-compiling target of the GNU Compiler Collection (avr-gcc) up-and-running on Windows. That package is called WinAVR.

Because many of us don't like to work with makefiles, WinAVR includes standard template makefile. It also includes a step-by-step makefile generator, called Mfile.

Many of us don't like writing our source code in a generic text-editor, then invoking the compiler from a DOS command-line. Therefore, WinAVR includes a pseudo-IDE, called Programmer's Notepad. It has many of the features you'd expect from a C-file editor, including syntax highlighting. It allows you to call command-line programs with a single menu selection, and capture the results in a separate window -- so you can invoke the compiler and look at the output. When the compiler points out errors in the code you wrote, you can click of the error text in the Output window, and the editor will take you to the line on the source code where the error happened.

But, you aren't limited to using any particular IDE at all. Programmer's Notepad happens to be the editor of choice in WinAVR right now, and it is included as an optional installation feature with the WinAVR distriibution. But you can use any generic IDE you like. One suitable IDE that is under independent development right now is called KamAVR.

KamAVR is an attempt to combine the capabilities of Mfile and Programmer's Notepad in a single program, with a unified Project-oriented front-end. It also includes more advanced features, such as the ability to browse through your global variables, structures, and classes. And code-completion capabilities, which can give you hints on-the-fly about what arguments are expected by your function calls as you call them. Or, you can see a pop-up list, as you type, of the various members available in any structure or class you happen to invoke.

Apparently there is an effort underway to update the features available in Programmer's Notepad as well.

All of these tools can be obtained for free. avr-gcc and the associated files released under the terms of open-source licenses, with the usual considerations regarding the licensing status of the binary output of a compiler. (It's a little complicated, but it essentially boils down to the fact that a compiler is no different than a Word Processor -- whatever license was attached to the source code and linked libraries you put into the compiler, will also apply to the binary that comes out of the compiler. The use of GCC does not, in itself, attach any additional licensing requirements on your project.)

KamAVR is available for no cost, but it is not yet 'free' in the sense that the source code is not open yet. (The author is working on replacing non-open-source libraries in his code with open-source alternatives.) However, the IDE you choose to use has absoultely no impact on the licensing status of the programs you produce.

There are other IDEs / front-ends available for avr-gcc as well. Such as Atman AVR C. Atman also uses avr-gcc, avr-libc, and avr-binutils. But it provides its own solution for an IDE, makefile management, a debugger, and a code generation wizard. In the end, it will produce the exact same binary output as WinAVR, given the same source code. Atman charges $100 for a license to install the IDE on up to 2 computers, including (apparently) unlimited upgrades to future versions.

Did I mention that KamAVR allows you to browse the member methods and data of a class? That's a good thing to point out, because it brings to light another feature of avr-gcc: You can write programs in C, or in C++ (, or in Ada) using avr-gcc. The runtime library for C++ is incomplete. So, for example, you'll have trouble doing something like

cout << "This is a test." << endl;

But, there is full support for C++ classes, complete with operator overloading, constructors, destructors, etc. AFAIK, only avr-gcc and IAR Embedded Workbench offer that.

You asked how much IAR costs. That varies from country to country. You can always contact a local distributor and make an enquiry. But, I'd be surprised if the price comes in at less than 3 figures.

It is possible to download trial versions of all four of the 'big' compilers.

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

Ok, here we go....

WinAVR is a suite of executable, open source software development tools for the Atmel AVR microprocessors hosted on the Windows platform. It includes the GNU GCC compiler for C and C++. The GCC compiler has been around for almost two decades. It can be built for various targets. A target is a processor/platform that is will compile code for. GCC can also be built to run on various hosts. GCC has an AVR target. This version of GCC is also known as AVR GCC, or avr-gcc.

WinAVR also contains many other tools. You can see what the package contains by visiting the WinAVR website. See the Package link. The WinAVR User Manual is also now online as well. It also gives a background and introduction to the toolset.

KamAVR, again, is just a new, graphical IDE, that uses the WinAVR package to provide the tools (compiler, assembler, linker, library, etc.).

HTH
Eric

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

lfmorrison wrote:
You can write programs in C, or in C++ (, or in Ada) using avr-gcc.

NOTE: The Ada stuff is not yet in WinAVR, but it will (hopefully) be soon. It is available now in source. The Ada library that will come with it is still a bit experimental as it doesn't yet have a wide user base.

And thanks for the explanation. Oh, and beating me to it. ;)

Eric

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

groenhen wrote:
Ouch... isn't it somehow complicated?
GccAVR -> WinAVR -> KamAVR ... (3 in the sequence... for now).
Some people would like something simple (all in one)... I should say.
Please, don't blame me; I'm only trying to get more info & to take the right decision:
what compiler should I choose.
I don't want to be "the seed of polemics". :wink:

If you think this is 'somehow complicated' you may need to rethink you career goals. The 'GccAVR -> WinAVR -> KamAVR' is no where near the most complex thing you'll run into in this field. These free tools generously created by a helping community are about as simple as it gets. I've used systems that cost more than 10K a decade ago and they are also hard.

Not trying to be too harsh here, but this complexity is minor compared to what you will run into and if you don't love it, it will drive you nuts. I've seen it happen. People get into this thinking money and burn out because it is so damn hard. Those of us who enjoy complexity and don't mind burning barrels of midnight oil to figure something out survive. Those who want it simple and easy don't.

Smiley

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

Well...
Thank you all for the exquisite explanations.
Seems that WinAVR has a strong team :-).
I love C and I love AVR. The missing link is the compiler… (I must choose one).
Yes, usually I like simple things, but I never imagine life is always easy.
I like to consider myself a serious person and I’m not playing with decisions.
And…oh, please excuse my bad English (I rarely have the opportunity to “practice”).

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

Hmmm, I'm surprised nobody uses AtmanAVR… (I mean ONLY from the guys who voted).
Also, I wonder what should be the “Other C compiler” that gained one vote? (till now).
Just curious… :-)

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

I figure that I started with ICC11 for the MC68HC11, When I moved over to the AVR, it only made sense to go with something that I was familiar with, hence, I chose ICCAVR. Other compilers may be better, or worse, but It's what I've got. I haven't found any limitations that I (or you all helping me) haven't been able to work arround.

Besides, I want to spend my time on the project at hand, not pulling my hair - er, excuse me, what hair - figuring out how to do something that I can already do with what I've got...

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

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

Same here. Used ICC11 on the HC11 (still do!), Use ICC12 on the HC12, use ICCAVR on the AVR. Guess I need to rustle up an ARM project......

Imagecraft compiler user

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

Hmmm, guys... finally I made up my mind!
I have chosen CodeVision.
Thank you all for your advices!
The poll was very... interesting.
***
Best regards,
Stanley Groenhen - Belgium.

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

Yet, I’m very puzzled: nobody here uses AtmanAVR?! (really…:-( )

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

That is true: I’m absolutely convinced that CV is a perfect choice for beginners/programming EEs and not for professional programmers. But it doesn't mean that serious EMBEDDED project may be successfully accomplished only by a professional programmer as well as pro would never use CV for a small and fast project.

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

Quote:
I’m absolutely convinced that CV is a perfect choice for beginners/programming EEs and not for professional programmers.

Are you saying that when I’ll become a pro :-) , I should use IAR?

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

you, most likely will switch from CV to something else.

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

Yup, to a hair dipper :-) … if you take into account my current profession!
Just joking… :-)

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

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

I used IAR before I stepped over to WINAVR (about 2 yrs ago). The advantage of using the makefile is that you always know exactly where compiler settings are made. Very usefull when working on more than one project (which I assume many people do)

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

Usually, there is a tab in compiler’s menu named “Compiler Settings”, so… I see no problem with this.

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.