Choosing A Compiler

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

Plz don't hate me I'm not trying to start another compiler war!

I am trying to figure out which direction is best for my goals as I program both AVR and ARM micros and currently use WinAVR in AVR Studio and a linux build root for arm but I am not satisfied with many things.

Mainly I dislike running linux inside windows viz cygwin as its really 'hacky' and file management on a virtual machine is a pain in the but so I would like to have all my programming solutions on one box. My end goal is running a custom distro on an arm device that I build myself and write the drivers for but if I want to sell anything I make It needs to have a windows interface to get any customers.

So digging around I found really two options that meet the criteria all with their own cons.

1 - GCC everything. Code::Blocks IDE and GCC for arm and AVR develpment, MinGW for windows development. Con: NO DEBUGGERS!

2 - Rowley CrossWorks for ARM and AVR development, I really like the debugger and interface. Con, Worst documentation EVER. Great examples on their tasking library but zero on everything else. Also I swear their custom AVR compiler is not ANSI C standard...

I don't know whats up with CrossWorks but it has some very odd syntax and drops errors on function prototypes that are very cryptic. For example:

PORTD |= 1;
PORTD |= (1<<2);

Nothing special about that code and yet the bit shift does NOT change anything in PORTD. Also their support ticket system is fast to respond but its always the same guy.. is it a one man show on support or something?

Why not stick with AVR Studio? The debugger is the big thing, its terrible. I can not follow the call stack, I can't see where bits of memory are going, and 90% of the time it takes three or four trys and different settings just to get my variables to show up in the watch list and then the delay routines take a week to execute.

So does anybody have a recommendation on how to develop AVR and ARM on the same machine without running two very different compilers and having good debug support?

EDIT: I would also like it if they supported c++, I know theirs a way to do it in WinAVR but you can no longer use the automatic makefile (not that big of a deal) but I'm not sure if CrossWorks allows any c++ at all...

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

The posting, above, is disjoint.
It asks "What compiler", AVR and ARM. Same compiler/IDE for both? Need not be FREE? If yes, I recommend IAR + J-Link. Works well for me.

"Why not stick with AVR Studio" it says. Well, duuu, what about the ARM requirements?

Really now, reword this inquiry. M
If PORTD |= (1<<2) doesn't work, on the AVR, it's probably because DDRD isn't setup correctly.

Dumb complaint of the month: "Ticket system if fast to respond, but it's always the same guy".

geesh.

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

You have to make up your own mind.

IMHO, you would not go far wrong with Crossworks for both AVR and ARM. Paul gives a quick response and will help sensible requests. He has his own opinion of life, so do not expect him to implement something that he thinks is unwise.

You will find Studio is fine for debugging non-optimised code. Most IDEs will give you a sensible balance of optimisation for a 'Debug' version of your project.

Studio4 IDE defaults to fierce optimisation, and you suffer the consequences. You get what you ask for.

David.

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

If you don't like the debugger, then don't put the bugs in the first place!!

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

Sorry if it was a bit disjointed after three days of trying things out I am seeing a bit red.

I have tried many compilers such as:
CodeVision
ImageCraft
IAR
CrossWorks

And the most friendly and intuitive interface was CrossWorks by far but it was also the most confusing to use.

I did not include IAR in my list of possibilities as its very expensive. I can not find a price on the website but a 8K kickstart edition and board are a reasonable price but I imagine the compiler itself is around $250euro which is quite a penny to pay.

That being said IAR does support c as well as c++ which is a huge bonus but realistically I would rather not have c++ support for the AVR if it saves me $100euro.

Quote:
Dumb complaint of the month: "Ticket system if fast to respond, but it's always the same guy".

I'm not sure how this is a dumb complaint. If you have a problem and he does not know how to solve it what good is customer support if theirs nobody else to ask! How many times have you had a useless person on the phone and asked for someone else? Imagine it was just them... ALL THE TIME...

That aside I did not know that this Paul guy is the author of CrossWorks. I have immense respect for the guy as he has made a very appealing IDE and I fell like I want to buy it. maybe...

Quote:

You will find Studio is fine for debugging non-optimised code. Most IDEs will give you a sensible balance of optimisation for a 'Debug' version of your project.

ImageCraft and CodeVision do not even have their own debuggers so that and the poor quality websites made me dislike their products. However CodeVisions wizards are bloody awesome but thats where it ends for me. I'm not good enough at coding to be able to write without worry. Right now I have my own uart library with printf and vt100 support that I use extensively for debugging but it introduces alot of overhead to the code. Having a high quality debugger will help alot.

I will install a new trial of IAR and email them to send me a price as it seems to be a decision between IAR and CrossWorks now.

Have either of you worked with CrossWorks? I know he wrote the compiler and its 'based' off GCC but is it is standard compliant as WinAVR? Its hard to tell with only the header files to look through. I know IAR is c99 compliant to the max, apparently the best.

Oh and the fact that CrossWorks runs on Linux and Windows is a huge bonus as I'm usualy running both simultaneously.

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

You will have a learning curve for any IDE and/or compiler.

If you want to use Linux, the decision is already made for you. A commercial CrossWorks licence is similar to the cost of IAR, but you will be able to run on Linux.

I looked at the CrossWorks AVR evaluation but never bought a licence. As far as I can remember there were a few tricks to learn, but otherwise it works fine.
Ask intelligent questions and you should get intelligent answers. Some may get answered here. I do not know, but would guess that the AVR compiler will 'closely' follow any developments in avr-gcc.

I have a CrossWorks personal licence for ARM. It works very well.

David.

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

I've not used CrossWorks for the AVR, but I've used the MSP430 and ARM versions for many years without any problems. Support is excellent. Rowley is a small company (about four people) but they know their stuff when it comes to developing compilers. Their hardware is pretty good, as well. I've been using their ARM CrossConnect JTAG for a long time, and now have their new CrossConnect Pro. It's even better!

Leon Heller G1HSM

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

Quote:

Mainly I dislike running linux inside windows viz cygwin as its really 'hacky' and file management on a virtual machine is a pain in the but so I would like to have all my programming solutions on one box.

So use Oracle (formerly Sun) VirtualBox and either run a Windows guest in a Linux host or a Linux guest in a Windows host - if you add the "guest additions" then you can share filesystems between the virtual machine and the host.
Quote:

1 - GCC everything. Code::Blocks IDE and GCC for arm and AVR develpment, MinGW for windows development. Con: NO DEBUGGERS!

So you've never heard of gdb then? If you use Linux then avarice acts as the connection between the generic avr-gdb and the Atmel debugging hardware (Dragon or |JTAGICEmkII). What's more there are loads of front ends you can put on top of the command line gdb to get a nice GUI interface. Personally I favour ddd as that's what I first started with. I find (for ARM) the gdb/ddd combination to actually be one of the best debuggers I've ever used in fact.

Personally I use Windows for both AVR and ARM but that's because the ARM is actually NXP's LPC and is supported by the excellent Code Red variant of Eclipse while for AVR I use AVR Studio which, unlike you, I don't find that bad. Sure there's no call stacks feature but do AVR apps ever get that complex that you are ten levels down a stack like tends to happen with ARM code?

BTW your thread title says "Choosing a compiler" but that's not really what you are choosing is it? For example for AVR you can load the output of any one of GCC, ICC, CV or IAR into AVR Studio and debug it there so you compiler choice need not also dictate your debugger choice.

Quote:

EDIT: I would also like it if they supported c++, I know theirs a way to do it in WinAVR but you can no longer use the automatic makefile (not that big of a deal) but I'm not sure if CrossWorks allows any c++ at all...

You are wrong about that - if you are using Studio as a front end to WinAVR then just give the source files a .C rather than .c extension and they will be passed to the C++ rather than the C compiler. The same "auto Makefile" system remains in place. (the usual issue is actually the other way round - where a beginner has inadvertently called a file test.C (or more likely TEST.C) rather than test.c and wonder why it's being treated as C++)

Cliff

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

frostblu3710 wrote:

ImageCraft and CodeVision do not even have their own debuggers so that and the poor quality websites made me dislike their products. ..

If you specific comments on how we can improve our website, feel free to send it to me directly richard @imagecraft.com. No one has ever said our website is "low quality" before so would be interesting to see what the actual problems are.

As for lack of debugger, since Atmel is committed to provide debugger support for all existing and presumably future AVR and all their hardware debug interface, there is not much value of providing our own. YMMV.

// richard

Richard Man http://imagecraft.com

Beyond Arduino - When you're ready to get serious...
JumpStart C Tools, The Better Alternative.

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

Quote:
the most friendly and intuitive interface was CrossWorks by far but it was also the most confusing to use.

There's a contradiction if I ever saw one..

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

JohanEkdahl wrote:
Quote:
the most friendly and intuitive interface was CrossWorks by far but it was also the most confusing to use.

There's a contradiction if I ever saw one..

LOL...I thought I was just getting tired when I read that.

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

Yeah But. I'm a self proclaimed Expert at AVR C programming, and I use the Imagecraft compiler and IDE and the internal editor exclusively. I use it every day, and I'm used to it and very productive with it. I am also a self proclaimed Expert in MS Visual C Console Apps... I can sit right down and cut n paste one of my other console apps to do some sort of serial test program. The only thing common between the two IDEs is the CUA windows editor. You mark a line with the ctl arrow keys and can ctrl c and ctlr v. Old programmers from the 70s remember the nightmare of different editors back then, some not even screen editors.... line editors! All with entirely different commands. I thought I had it sussed for a while... I used microemacs on the pc, mince on cpm, emacs on the vax, but you had to carry around a box of disks with your favorite editor in all possible media of every executable computer you might encounter. I grumbled about having to learn the Windows converntion, but mercifully, it was the same on every machine. Thank heaven for small favors. I think you should eval the AVR compilers according to some criteria besides debugger and website as figures of merit. How about ANSI completness, including FP doubles (if needed), price, ease of install, support from author? I think CV and ICC are excellent in both these categories. Try them both.

Imagecraft compiler user

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

Quote:
And the most friendly and intuitive interface was CrossWorks by far but it was also the most confusing to use.
Can we take this guy seriously?

Given all the above, the I'd suggest that for the AVR, he use Codevision. Rowley uses the public domain GCC so any problems in GCC are effectively your problem. The Atmel decision to change life cycle support on WinAVR (GCC+AVRstudio) is some risk to consider- but hopefully AVRstudio w/GCC continues on.

The OP said ARM and AVR. I'd recommend for this that IAR is the best, since the IDE and tools are the same for both.

But we can't figure out what the OP really needs.[/b]

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

Quote:

The OP said ARM and AVR. I'd recommend for this that IAR is the best, since the IDE and tools are the same for both.

Eclipse can do that for ARM and AVR too (obviously with underlying arm-gcc and avr-gcc)

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

stevech wrote:
Quote:
And the most friendly and intuitive interface was CrossWorks by far but it was also the most confusing to use.
Can we take this guy seriously?

Given all the above, the I'd suggest that for the AVR, he use Codevision. Rowley uses the public domain GCC so any problems in GCC are effectively your problem. The Atmel decision to change life cycle support on WinAVR (GCC+AVRstudio) is some risk to consider- but hopefully AVRstudio w/GCC continues on.

The OP said ARM and AVR. I'd recommend for this that IAR is the best, since the IDE and tools are the same for both.

But we can't figure out what the OP really needs.[/b]

Rowley uses their own compiler for the AVR and MSP430. They use gcc for their ARM tools, with their own libraries.

Leon Heller G1HSM

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

leon_heller wrote:

Rowley uses their own compiler for the AVR and MSP430. They use gcc for their ARM tools, with their own libraries.

I stand corrected re AVR, per Leon.