About AVR-GCC / WinAVR Installation

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

Hi,

 I would like to re-compile a program that was created with Help AVR-GCC. Inside the code there is a comment : "Tested with WinAVR 20080610"

Could anybody help me to understand some thing , please ?

For instance, AVR-GCC, WinAVR and Atmel Studio are three different compilers or I can choose which will Atmel studio will use ? And is yes, then HOW this can be done ?

 

Also, what exactly is "makefile" and GNU AVR toolchain ?

 

Τhank Υου !

Last Edited: Wed. Apr 11, 2018 - 06:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

WinAVR was simply a package that contained a copy of avr-gcc and a few other tools.
.
avr-gcc is the compiler
.
Back in WinAVR days AVR studio was just an editor and debugger it did not come with a compiler. It was typical for an end user to put copies of WinAVR and AVR studio together to make a complete development system.
.
From AVR Studio version 5 up to Atmel Studio 7 it's been the case that Atmel put their editor/debugger together with a copy of avr-gcc so now you don't need to get things separately.
.
If you really want to use the 2008 version of WinAVR then you need to find and download that first. You then have to choose whether you want to use that with Studio 4 (as it would have been at the time) or whether youd like to use the more advanced facilities in AS7 and download that. If you use 4.18 it will "see" the avr-gcc compiler from WinAVR automatically. If you use 4.19 you may need to set it up manually. If you get AS7 you need to explore "toolchain flavours", it can support having more than one avr-gcc, the one that comes with it is one flavour and WinAVR's avr-gcc would be seen as another.

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

bnsavr wrote:
what exactly is "makefile" 

 

https://en.wikipedia.org/wiki/Makefile

 

and GNU AVR toolchain

The specific version of the GNU toolchain - aka "GCC" - which targets AVRs 

 

http://www.microchip.com/avr-support/avr-and-arm-toolchains-(c-compilers)

 

https://gcc.gnu.org/wiki/avr-gcc

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is weird.

OP has been a member since 2011 and has posted in most of those years.

OP then asks questions which can be googled in 2min.

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

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

Dementia or memory loss perhaps.

 

Ross McKenzie ValuSoft Melbourne Australia

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

Paulvdh wrote:
OP then asks questions which can be googled in 2min.
But that is not true. It is very confusing in fact to know what is a compiler, what is a plain IDE and what is an IDE+compiler. As the situation has changed over the years I can see how the situation one sees now could be quite confusing compared to what was seen back in 2008. Who, for example, would ever guess about "toolchain flavours" in AS7 ?

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

and, of course, google will also find all the places where people mis-use the term "IDE" to mean "Compiler" - and vice-versa ...

 

frown

 

But I do see Paul's point that these are foundational things that someone who's been around for 7 years should really understand ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If OP have/had a setup that worked for 10 years, it's easy to forget what he did.

I have a place there still use studio4(.18 there is a bug in 4.19), and I think it came with the 2008 compiler, it has some big errors.

So I have it running the 2010 compiler (a setup to use an other than default compiler).

But if there is no special reason for winavr then download studio7 and use the build in GCC compiler.

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

Hi  Paulvdh

 

1) I have no idea what is OP !

2) I asked my questions here because I thought that I could have reliable answers to them.Of curse I used google many times, before use this forum.

3) Instead of reply to me and just said nothing helpful , please do not make me waste my time to reply  ! If you can help please JUST DO IT  !!! 

This is weird !

That behavior is not polite or maybe you have not something better to do...

 

 

 

 

 

Last Edited: Thu. Apr 12, 2018 - 12:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Then download studio 4.18 and use the default compiler.

 

OP is you :)

Last Edited: Thu. Apr 12, 2018 - 11:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 Thank You sparrow2 !

 

I know that this guy reefers to me ... I am just angry with those persons that have that behavior ...

 

 

 

 

Last Edited: Thu. Apr 12, 2018 - 12:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bnsavr wrote:
1) I have no idea what is OP !

2) I asked my questions here because I thought that I could have reliable answers to them.Of curse I used google many times, before use this forum.

3) Instead of reply to me and just said nothing helpfull , please do not make me waste my time to reply  ! If you can help please JUST DO IT  !!! 

Try to ignore Paul, like several posters here he appears to be on an ego trip to prove how smart he is and how stupid everyone else is and this often involves belittling posts.

 

Don't worry, if behaviour persists then moderation action will be taken.

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

add:

You need to know optimizer settings to make the correct (same) output. 

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

Hi clawson,

 

I know that. But the action of moderator it is not the point. The hole idea is to keep this forum reliable and helpfull.

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

@clawaon #12

Is that really the impression you have of me?

 

 

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

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

Yes

 

But you're not the only one.

 

Replies that involve "google it", "LMGTFY" or "RTFM" are not, in my opinion, in any sense "helpful".

 

All we ask here is that if you have nothing helpful to add then don't. Just grapeshotting replies right, left and centre to boost your post count or to intimidate beginners who maybe don't know as much as you do helps no one.

 

If you want to reply try to say something helpful (and, yes, I know that many of your other replies do this).

Last Edited: Thu. Apr 12, 2018 - 03:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Although that may not be your intent, yes, that is the impression I have (sometimes) as well.  I think a number of responses to some recent posts of yours bears witness to that, and your own responses to those suggest that a) you're aware of it, and b) it was surprising to you.  Due to b) you may be cut a little slack, but due to a) that slack might run out soon ;-)

 

But you're not the only one.

I'm >>certain<< I've been received that way more than once, myself.  I try to take feedback with a grain of salt, and improve.  Mind you, I have a tendency to rant off topic... what was I saying?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Thu. Apr 12, 2018 - 03:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I suppose it is hard to judge someone if you've never seen them nor know their background.

 

How do you compare the difference between someone trying to share the knowledge he has in his free time with "he appears to be on an ego trip to prove how smart he is" ?

How do you compare the difference between a bit of brainstorming to give an OP some ideas he may or may not have thought of himself with "Just grapeshotting replies right, left and centre".

 

I know I say some silly / stupid / misplaced things sometimes, and when I become aware of it, in retrospect, I try to correct.

But if you take OP's first question here for example, where he asks what a makefile is, how much time do you think OP spend on that?

(No I don't want to "belittle" OP here, it is more as an example of a more general situation).

In the rare cases I ask a question myself I often take half an hour or more to formulate it and trying to be clear.

 

Whenever I spot a beginner who is genuieley trying to learn, I can be quite patient and helpful and there are quite a few for which I've spent an hour of my time or more. There are also posts in which I did a bit of background research or made some example programs and those posts can easily take >1h to prepare.

Have you also thought of those posts while making up the equation, or do you only remember the posts which annoyed you?

(This is a very common defect in human psychology).

 

Forums are (unfortunately) a very inefficient way of communication. Here on AVRfreaks the threads seem to be read about 300 times on average.  If all those "read" are 2 minutes of someone's time that is easily > 10 hours of effort for often simple questions.

 

Intermezzo:

In the 25 threads on AVRfreaks frontpage there are right now 5 dug up old threads with each > 1000 views, 60757 views for those 5 threads.

38502 https://www.avrfreaks.net/forum/how-connect-xmega-evaluation-board-xplain-win7

  1553 https://www.avrfreaks.net/forum/failed-enter-programming-mode-attiny85

  3440  https://www.avrfreaks.net/forum/atmega328p-questions

  1773  https://www.avrfreaks.net/forum/simple-state-machine

15489  https://www.avrfreaks.net/forum/please-recommend-pcb-fab-europe

I haven't checked on those, but lot's of those seem to become dug up by first posters.

Sorry, diverging too far here I guess...

 

The "Weird" part in my post #4 was because I was confused if OP was simply ignorant of the meaning of such basic terms, or was deliberately trying to troll here.

His question of what an OP is and his subsequent answer suggests the second.

OP probably is not a native English speaker, and neither am I, and that complicates the matter further.

 

I had to search "LMGTFY" for myself, unlikely I ever used it, I might have dropped a few "RTFM" 's myself sometimes.

I find it sad that there are so many posts where an OP asks a vagure questions and get's 20 different responses back and forth to even get the question clear. I try to avoid threads like those as much as I can. I would have ignored this thread if it wasn't for Clawson's #12

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

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

I find it sad that there are so many posts where an OP asks a vagure questions and get's 20 different responses back and forth to even get the question clear. I try to avoid threads like those as much as I can. I would have ignored this thread if it wasn't for Clawson's #12

Those are the ones which require the most effort, yes, but the hope is that through that effort the OP will learn the basics of critical thinking, proper research, engineering best practices, and something of the scientific method.  Do they all learn that?  No.  Of those who do learn, do all learn at the same rate?  Of course not.

 

While it is 'sad' that so many posters may lack one, more, or all of the above before posing their first question, the sadness is in how whatever systems of education they've been a part of has failed them in that regard, not in the posters themselves.  You can 'avoid those posts', or you can do something about it and spread the love.

 

I think you >>do<< do that.  So do many others.  The issue I have sometimes is when it seems more important to point out the failings rather than to push past them altogether and just get down to the business of answering the OP and teaching the above mentioned elements along the way.  No, I am not free of guilt.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Hi ,

 

I just asked 2-3 questions and there are many irrelevant posts here. Thank You those that tried to answer them. I am not a novice to micro-controllers.Of course I do understant what is IDE, compiller,list file, hex file, asm e.t.c In fact, I use to work only with AVR using only assembly and PIC using only C language. I used WINAVRASM standalone assembler and later Atmel studio 4.18,and later. I have no experience in GCC and WINAVR. I used  Codevision for a while ...I just tried to compile that code and compiler refuse to work. I decide to use the experience that all of you have to those tools. That is all... Anyway , sorry about the inconvenience and thank you again.

 

 

 

PS   Guys please stop fighting. Be cool !

Last Edited: Fri. Apr 13, 2018 - 08:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson       I absolutely agree with you. This is the point:   "All we ask here is that if you have nothing helpful to add then don't"

 

Paulvdh       Believe me I used google many times to understand what is AVRGCC and WINAVR and how to use them in IDE but with no result (more confused). That is why I ask your help.

                  Furthermore I do not try to troll here in any way ! Be sure about that.Also, it is obvious that I am not a native English speaker and that complicates the matter further as You mentioned.

                  Honestly I had no idea what "OP" and "LMGTFY" is, although I remember the old famous "RTFM". Probably because I do not use forums in general.

                  Also, nobody claims  that you are not an expert. You have the knowledge, but some times the hole idea is not only what you said but how to said.

                  Sorry again for the inconvenience.

Last Edited: Fri. Apr 13, 2018 - 08:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil :  Let me ask that question correctly. Makefile will be generated by the compiler ? If yes, why i need this ? I will use only hex file and in some cases .cof file.

Last Edited: Fri. Apr 13, 2018 - 09:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bnsavr wrote:
Makefile will be generated by the compiler ?

No. the makefile is generated by the IDE - eg, Atmel Studio.

 

why i need this ?

It is the "recipe" which tells how to build your code

 

 

I will use only hex file and in some cases .cof file.

The makefile is the "recipe" for creating those things from your source files, using the compiler, linker, etc.

 

Makefiles are very commonly used in many fields of programming - not just microcontrollers.

 

See: https://en.wikipedia.org/wiki/Makefile

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I try to make it short and clear.

 

I have used studio 4.18 a lot also for C programs and I have never had to make a make file by hand! (I always make a project from inside studio and also compile it from there (and even use it for programming)).

 

The C compiler  4.18 come with IS the winavr compiler that IS a GCC compiler. (as said before it's a older version I don't suggest you use, use the 2010 version, and I would be surprised if your 2008 code don't work with it).