Can't even figure out how to compile...

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

Hi,

I'm (still) new at AVR32s, but I've worked with 8-bit AVRs for nearly a decade. So I thought that a switch to AVR32 would be pretty easy.

Well, to quote the teacher in Pink Floyd, The Wall: "WROOONG! Do it again!"

When compiling my regular 8-bit programs, I simply start the compiler (using make.exe) from my text editor, and get the compiler response in a separate window in the editor. Make.exe uses "makefile" to figure out which device I'm using, which files are part of the project, which file is the main file, and so on.

I find great value in this simple operation, especially when keeping track of firmware versions, copying (parts of) projects, all that kind of stuff. Yes, I actually see a big advantage in not using a huge and complicated GUI when compiling a program that has no graphical interface. A long time ago, I had to use the IAR compiler "“ and hated it.

Now for the AVR32. I put MCU = at32uc3b0256 (and later MCU = __AVR32_UC3B0256__) in a copy of an existing makefile, and I fairly quickly figured out that I had to use avr32-gcc.exe instead of make.exe. But nooo. avr32-gcc.exe apparently doesn't use the makefile, but (possibly) expects to have the whole shebang of options added in the command line. This is where I "crash". I can't even get the compiler to run. :(

Just to try something, I put #define __AVR32_UC3B0256__ in the beginning of my .c file, and the compiler now doesn't complain, but neither does it give me any feedback. I just get - silence.

I've spent hours browsing the AVR32 forums and the GCC manual, without getting anything useful. It seems that everybody else at least know how to compile. But maybe that's because everybody else use AVR Studio 5, 6 or 32. I still feel very reluctant to install such huge software, just to control another command-line based piece of software, but I fear that might be the bitter end. :-/

Anybody else have experience with avr32-gcc.exe? And makefiles for this?

Best regards,
ErikT

You're absolutely right. This member is stupid. Please help.

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

Quote:

I fairly quickly figured out that I had to use avr32-gcc.exe instead of make.exe

I suppose you meant "had to use avr32-gcc.exe instead of avr-gcc.exe"?

Quote:

avr32-gcc.exe apparently doesn't use the makefile

You got it backwards. It is not the compiler that uses the makefile. It is Make that interprets the makefile, and "uses" the compiler.

Quote:
I just get - silence.

Generally, that is an indication of success when using a GCC tool chain.

As I see it it seems you are avoiding a "huge and complicated GUI" and instead fall into "a huge and complicated system of command lines and a makefile".

For the 8-bit AVRs there is the MFile utility that will remove a lot of the needs for mastering GNU Make and the GCC/binutils tool chain and it's comand lines parameters, options and whatever. For the 32-bit AVRs I havent seen anything similar.

The informaation needed to "atleast compile" should all be there in the GCC manual, but I admit that it is a daunting piece and when you don't know what youre looking for it can be confusing to the point of intimidation.

My advice: Go with the IDE for a while. Study what commands it emits for compiling and linking. Back reference those to the manuals, and you might eventually be able to drop that IDE again if you still feel like it.

HTH!

PS. For any GCC compiler, the command to "just compile" is

GCC -c infile -o outfile

As soon as you need to point to e.g. additional include directories (apart from those the compiler "knows as it's own") or you want to do a define on the command line you get more options. Not to mention when you want GCC to generate additional output files (e.g. a listing file), or want it to generate dependency files automatically.

Add to that all the meta-stuf that is in a makefile in order to get the rules and commands generic (all those @'s, $'s and stuff) and unless you have a plan on how to pich that into small pieces that you can learn one by one, youre doomed on beforehand. Having said that, it is my firm opinion that the GNU Make manual is one of the best manuals written. The first few chapters will make for one evening worth of very rewarding reading. Highly recommended!

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

Hi Johan, and thanks a lot for your very thorough reply!

Quote:
I suppose you meant "had to use avr32-gcc.exe instead of avr-gcc.exe"?

No, I actually meant make.exe. Always used make. And I had no idea that it was make.exe that used the makefile and started the actual compiler. Thanks a lot for clearing that up for me. Things are beginning to make sense.

Yeah, I know about the MFile utility, but I never got it to work. Instead, I used an example from Jörg Wunsch and others, and modified what was necessary.

I agree - the GCC manual is a huge and daunting piece of work. And I think it's missing a chapter called "Newbies - this is what you do".

I might do as you suggest, starting up with the IDE. But do you know if I can use my favorite text editor, or am I stuck with the IDE then? This might seem like a stupid question, but I avoid IDEs whenever I can, and so I simply don't know.

And why do I try to avoid IDEs? Bad experience, mainly. The IAR compiler is one. Borland Delphi is another. So from my experience, IDEs usually suck. I just hope I'm wrong this time...

Best regards,
ErikT

You're absolutely right. This member is stupid. Please help.

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

Quote:

And why do I try to avoid IDEs? Bad experience, mainly. The IAR compiler is one. Borland Delphi is another. So from my experience, IDEs usually suck. I just hope I'm wrong this time...

Nope, you're right. AVR Studio will be similar, generally speaking.

Quote:
And I think it's missing a chapter called "Newbies - this is what you do".

Yep, perhaps. I suppose most GCC users have been using compiling/linking tool chains on a command line since breast-feeding days.

Since we're into AVR32's theres not much point in continuing a discussion on MFile. I jaut wwant to moderate this thread so that there isn't just a "does not work" opinion. In my opinion MFile is a wonderful little utility that "just works". (It won't help you if you do not know hoots about what you're doing, but neither will an IDE. You have to have some understanding about the compiling-linking process, I suppose.)

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

No, I have nothing against MFile, and it wasn't really MFile that I couldn't get to work. It's a long time ago, but as far as I remember, it was written in some sort of script language, and it was acutally the interpreter I couldn't get to work. Anyway, in the end I just figured it was easier to edit the makefile directly.

I didn't mean to critisize MFile as such.

Now I'm in the full-day process of installing AVR Studio 5.1 :shock:

You're absolutely right. This member is stupid. Please help.

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

If you are on a GNU/Linux system then you need Tkl and Tc for MFile to work, yes. In e.g. Ubuntu getting those should be as easy as a few clicks in the "packet manager". (Then again, I would expect a GNU/Linux user to be at least somewhat familiar with compiling on the command line. OTOH, I quench as soon as I need to use something named "configure" - Autotools and friends are one of my unhappy loves...)

If on Windows, and you got it through installing WinAVR then it should work out of the box.

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 got it through WinAVR 20100110, but I only have mfile.tcl and mfile.xbm. There is no executable.

But don't worry about it for my sake. Right now I'm struggling with AVR Studio 5.1, which is a much greater challenge. Specifically, I'm searching for an AVR32 equivalent to the magnificent avr-libc manual.

You're absolutely right. This member is stupid. Please help.