Issue with AVR Studio 4

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

Hi,

I am new to AVR tools. Just installed win-AVR and AVR Studio 4 and trying to compile some C code. I am running into below error. I am sure something wrong with my setup. But not able to figureout the reason. Can any one kindly help?

++++++++++++++++++++++++++++++++++++++++++++++++++++++
rm -rf main.o work_21Nov.elf dep/* work_21Nov.hex work_21Nov.eep work_21Nov.lss work_21Nov.map
Build succeeded with 0 Warnings...
mmcu=atmega128 -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT main.o -MF dep/main.o.d -c ../main.c
/usr/bin/sh: -Wall: command not found
make: [main.o] Error 127 (ignored)
mmcu=atmega128 -Wl,-Map=work_21Nov.map main.o -o work_21Nov.elf
/usr/bin/sh: -Wl,-Map=work_21Nov.map: command not found
make: [work_21Nov.elf] Error 127 (ignored)
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature work_21Nov.elf work_21Nov.hex
avr-objcopy: 'work_21Nov.elf': No such file
make: *** [work_21Nov.hex] Error 1
Build failed with 1 errors and 0 warnings...
++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

AVR Studio does not install a C compiler. You will have to install that separately. One option is to use installation package called WinAVR (which will install the avr-gcc compiler which AVR Studio 4 should then auto-detect).

This is an often recurring question. Using the search function of AVRfreaks will reveal earler discussions on this. Recomended search term is e.g. "-Wall: command not found", and don't forget to mark 'Search for all terms' before hitting the search button.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"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

Thanks Johan for the instant reply. I will do further search as you suggested. But looks like i am grossly missing some thing, so i thought some one who is good at these compilers can give me quick suggestions.

If you see my log file above, it is not able to use any c compiler, where as i already installed win-avr (WinAVR-20100110) utilities on my machine. Apart from installing, do i have to set any other variables, so that AVR Studio understands?

--
Regards,
Sitaram.

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

This seems to be something that the half-brains at Atmel have gone out of their way to ruin in Studio 4.19. Originally Studio had a mechanism where it would look for an find WinAVR if it was installed. Then Atmel started making a half-baked rip-off of WinAVR called "Toolchain" so they modified Studio so it would look for both (and annoyingly it found their crap in preference to WinAVR). It now appears in 4.19 (which is the latest) that they don't even try to look for WinAVR any more. This just shows how shorted sighted Atmel are. When you create a GCC project now you need to go to Project-Configuration Options then on the 5th tab ("Custom options") set the path to avr-gcc to be /winavr/bin/avr-gcc.exe and the path to "make" to be /winavr/utils/bin/make.exe and THEN you should be able to build OK.

(what a cock up! though I fear this was not a mistake but deliberate)

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

Thanks clawson!

I went cookoo bananas over this. I just wanted to create a fast avr 8bit project to check something out. I usually use Netbeans with WinAVR to compile my project, but I thought, for those couple of lines Studio 4 will do. Now turns out you can not download Studio 4.18 Sp3 anymore, so I used Studio 4.19. Needless to say the project threw very weird errors.

At least now I now why this happened.

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

Clawson, thanks!!!

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

It would be nice if you could set an environment variable to point to the Winavr folder.

Maybe a better way to look at it is this. You should only have to tell Studio once where the tools are.

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

Quote:

It would be nice if you could set an environment variable to point to the Winavr folder.


Well the way it used to work used to work well. WinAVR put an entry in the registry (I think it might have been the one for uninstallation?) and Studio knew which key to look for it in. But it would appear that 4.19 removed this (or it was broken).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Last Edited: Thu. Nov 24, 2011 - 05:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Well the way it used to work used to work well. WinAVR put an entry in the registry.
Tinkering with the environment variables is better than tinkering with the bleepin' registry. I'm using 4.18, but I didn't install Winavr, I just use it. Is there a registry entry I can set? Is there a shell script or program that will do it?

I don't normally use Studio to build, so I never cared. Right now I'm working on a bootloader for the Xmega32a4 and using Studio seems to be the way to go.

Actually I've got the bootloader working, but I thought I would pretty it up before posting it. The damned bootloaders are a good example of bad code. Hopefully I can improve it a bit.

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

I wish there were a way to "flag" individual "really important" postings. If there was, I'd flag Clawson's. in a flash. Sooner or later, I'll run into this, and will have no idea what this thread is named.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

Jim,

I guess I could add a few words to that and make a Tutorial from it. As I said elsewhere I've posted a link to this thread in three places today so it seems that almost everyone from now on who tries to use WinAVR and AS4(.19) is going to be bitten by this stupidity and need guidance on how to proceed.

Cliff

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

since we've had a recent surge of posts on this I re'read this thread and especially this byn Cliff:

Quote:

This seems to be something that the half-brains at Atmel have gone out of their way to ruin in Studio 4.19.
[...]
Then Atmel started making a half-baked rip-off of WinAVR called "Toolchain" so they modified Studio so it would look for both (and annoyingly it found their crap in preference to WinAVR). It now appears in 4.19 (which is the latest) that they don't even try to look for WinAVR any more. This just shows how shorted sighted Atmel are.

I feel the the choice of the term "short-sighted" is somewhat weak.

While not blatantly obvious, it seems to me that someone at Atmel has a real problem with his self-image and confidence so that he actually found it necessary to pull the rug under the legs of a time-proven toolchain with a great reputation just because it was "not invented here" - or perhaps he is also the manager of AVR Toolchain and can't stand the fact that an avr-gcc-based toolchain other than his seems to be better.

It might be short-sighted. It is utterly pathetic.

The person in question should be reminded that the whole tool chain was possible due to open-source initiatives, and a lot of voluntary work by many persons.

There was a solution in AVR Studio 4 that made it integrate with WinAVR if the latter was present. It has been removed for no other reason than prestige, it seems. The only alternative I can see is that the plan is to make AS4 so unusable that it will force people to migrate to AS5 before the word that the reception of the latter has been so-so reaches the budgeting & promotions floor at Atmel.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"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,

It's marketing - simple as that.

The definition of marketing is "lie as far as you can until someone spots what's going on". The particular lie here is Atmel trying to pass off a community developed compiler as is it is the "Atmel C compiler" or, rather, "AVR Toolchain".

Those now downloading AS5 are probably thinking - wow Atmel now beat Microchip. Not only free assemblers and an IDE but Atmel throw in "their own" C compiler completely for free.

If some mechanism might expose the fact that it's a generic compiler that they don't own the smoke and mirrors could evaporate.

So hat's off to Atmel marketing - quite a a coup - at the expense of the existing users of course - but they aren't the new customers you are trying to convince.

Cliff
(definitely getting more cynical in old age!)

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

Quote:
The only alternative I can see is that the plan is to make AS4 so unusable that it will force people to migrate
...but not necessarily to AS5, maybe LPCXpresso or other vendors' IDE.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Actually AS5 seems to handle the Winavr stuff better than AS4. I can set it once to point to Winavr and I don't have to do it again for other projects.

I don't think I got a toolchain when I installed AS5. Right off the bat it couldn't find make until I pointed it to the one in Winavr. I installed the smaller AS5 download.

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

clawson wrote:
So hat's off to Atmel marketing

I prefer the middle finger. And the other middle finger goes to the Studio 5 developer kindergarden where they lack a supervising adult.

Stealing Proteus doesn't make you an engineer.

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

Now you have run out of middle fingers. You need one more for the Arduino people don't you? :)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I could wave my dick at them.

Stealing Proteus doesn't make you an engineer.

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

...and SOME of them may love that....

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

clawson wrote:
This seems to be something that the half-brains at Atmel have gone out of their way to ruin in Studio 4.19. Originally Studio had a mechanism where it would look for an find WinAVR if it was installed. Then Atmel started making a half-baked rip-off of WinAVR called "Toolchain" so they modified Studio so it would look for both (and annoyingly it found their crap in preference to WinAVR). It now appears in 4.19 (which is the latest) that they don't even try to look for WinAVR any more. This just shows how shorted sighted Atmel are. When you create a GCC project now you need to go to Project-Configuration Options then on the 5th tab ("Custom options") set the path to avr-gcc to be /winavr/bin/avr-gcc.exe and the path to "make" to be /winavr/utils/bin/make.exe and THEN you should be able to build OK.

(what a cock up! though I fear this was not a mistake but deliberate)

Why do they do this stuff! Thanks for saving me some work.
Rob

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

steve17 wrote:
It would be nice if you could set an environment variable to point to the Winavr folder.

Maybe a better way to look at it is this. You should only have to tell Studio once where the tools are.

There are two environment variables set to point to the Winavr folder. Firstly, the 'path' variable. All you have to do is type "avr-gcc" into the avr-gcc field...

OK, AVR Studio won't let you type avr-gcc into the field labeled avr-gcc. It makes you find the executable by browsing your hard drive.

AVR Studio 4.19 also ignores the "AVR32_HOME" environment variable, which points to the WinAVR root folder.

blech.

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

MY avr studio 4 don't create the hex file.

i had installed WinAVR-20100110 firstly.
and then avr studio 4.19 open new project named it "led" edit the project configuration,custom option and gave the path of avr-gcc.exe and make.exe from the WINAVR installed folder in C drive. after that my code was running(built and run) but it is not making the hex file.

i had also check(tick) "Create Hex file" check box present in the dialog box of "General" of "Edit Configuration Option" of my project.

so what is the problem :?:

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

How did make sure it did not create the hex file?

(No, it will not end up in the same folder as your source files but in a sub-folder with the name of the active configuration when building.)

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"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:
but in a sub-folder
...called "Default"

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly