fresh install of avr 4.18 and winavr 20100010 problems

Last post
30 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just installed the above on my machine and I get the following errors:

Build started 25.1.2012 at 10:49:28
mmcu=atmega168 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT rs232.o -MF dep/rs232.o.d -c rs232.c
/usr/bin/sh: -Wall: command not found
make: [rs232.o] Error 127 (ignored)

This same project on another machine with 4.19 and winavr 2010 reports an error like "mmcu=atmega168 unknown command"

It seems like make is not processing the command strings correctly. Has this problem shown up to anyone else?
I tried the config fix about manually putting in the paths to avrgcc and make but it makes no difference. The 4.18 version seems to find gcc and make fine, the 4.19 version does not show them but does generate a make file. Manually putting in the paths on that machine don't seem to make a difference.

First time trying to use avrtools 4 so please be patient Used Make for years on unix systems though.
All help will be appreciated.

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

Your command should say

-mmcu=atmega168

i.e. have a hyphen

I suspect you are using an external Makefile, and the Makefile is corrupted.

AS4.18 should be very reliable.

AS4.19 introduces special features like forcing you to use a broken Toolchain.

David.

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

...

Attachment(s): 

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

Make file has the following entries:

## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)

## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d

don't see anything wrong there and I have removed the makefile and let it be regenerated with same results. Would I be better off going back to an earlier version of winavr? 4.19/2010 combo misses the "-" on the mmcu statement and the 4.18/2010 version barfs at "-Wall". Is winavr 2010 a tested version? Is it Make or AVR studio parsing the commands? I would think it's make but mind could be going, it has been a while since I've coded much.
Thanks for your assistance

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

Something is wrong. I would remove and re-install both packages.

If you still have a problem, do a Clean, then Build.

Copy-paste the complete text from the Build window and post it here preferably within CODE tags.

David.

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

Thats why I tried another machine from the orginal 4.19/2010 installation. Problem changed but fundementally was still there. First environment is XP pro second environment is Vista. Don't know if thats relevent or not.

Code tags???

Either way I'll repost after cleaning all versions of XP machine and retrying. Thanks for help so far

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

We have had several threads on this before. The thing all these (three or four?) threads have in common is that the avr-gcc command as such is missing in the compile command line (and also in the link command line IIRC).

I am too lazy to search those other threads out, but a careful selection of search terms (a part of the error message, hint, hint...) should bring them up. At least one the last month or so.

Since the "be nice at AVRfreaks" campaign is on, I won't say: Whatever happened to peoples ability to search the Web (and specifically 'freaks) when perhaps 95 percent of all questions already have their answers out there. Oh darn, now I did it any way.. :D Well, might as well be a nice guy and do the search for you
[5 minutes of searching commences ]

Here:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=114162&highlight=wall+command
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=113638&highlight=wall+command
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=111950&highlight=wall+command
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=111803&highlight=wall+command

You go read, but IIRC the net sum is that AVR Studio 4.19 is FUBAR in this respect.

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

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

/usr/bin/sh: -Wall: command not found mean that the executable (avr-gcc.exe) is not found, so that's why I posted a picture above - have you seen it?

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

Quote:

/usr/bin/sh: -Wall: command not found mean that the executable (avr-gcc.exe) is not found

Not sure if we agree or not here, MBedder.

As I understand it the "avr-gcc" is actually missing in the generated command line (i.e. Studio generates a command line that is "F'd U"). The generated command line actually starts

-Wall ...

and sure enough, there is no such command to be found.

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

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

AVR Studio takes an executable name/path as configured in aforementioned dialog, so the empty dialog field produces empty executable name. Adding the path manually (pressing "Browse..." and pointing to .exe) should fix the "problem".

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

Why are we re-hashing this for the Nth time. It's a fault (or deliberate ploy by Atmel) in 4.19

It won't find WinAVR automatically any more.

So set it manually.

End of.

 

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

Ok,
Just re-installed studio 4.19, winavr 2010, pointed config option to 2010 GCC and 2010 Make and did a clean and rebuild.

Same results. "-Wall" not found.
Entries in Makefile look normal.

Are 4.19 and winavr 2010 not compatible any longer? This new install did go past the "mmcu" snag this combo was snaging on before but now matches the 4.18/2010 combo I was using on my other machine. If there is more of a tutorial on this please point me to it as the links passed on before did not address more than what I have done so far(as far as I can see)
Thanks for your patiences

[=brown][=9]Build started 25.1.2012 at 13:05:39
mmcu=atmega168 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT rs232.o -MF dep/rs232.o.d  -c  rs232.c
/usr/bin/sh: -Wall: command not found
make: [rs232.o] Error 127 (ignored)
mmcu=atmega168 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT Command.o -MF dep/Command.o.d    -c -o Command.o Command.c
/usr/bin/sh: -Wall: command not found
make: [Command.o] Error 127 (ignored)
mmcu=atmega168 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -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=atmega168 -Wl,-Map=mtrcntrl.map rs232.o Command.o Main.o     -o mtrcntrl.elf
/usr/bin/sh: -Wl,-Map=mtrcntrl.map: command not found
make: [mtrcntrl.elf] Error 127 (ignored)
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature  mtrcntrl.elf mtrcntrl.hex
avr-objcopy: 'mtrcntrl.elf': No such file
make: *** [mtrcntrl.hex] Error 1
Build failed with 1 errors and 0 warnings...[/size
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Just re-installed studio 4.19,

Quote:

The OP has 4.18.

We sure?

 

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

Can you attach your Config > Custom Options dialog screenshot as shown above?

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

Opps, noted I was linked to gcc.exe not avr-gcc.exe, fixed that, cleaned, rebuilt now I'm back to :

'mmcu' is not recognised as an internal or external command,

Make file section
## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)

## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d 

sorry if i'm being a dung head.
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

'mmcu' is not recognised as an internal or external command,

Ctrl-C then Ctrl-V the complete build output.

Also if you drop to a Command prompt and say "which avr-gcc.exe" what does it say? On my machine it is:

C:\[i386_vc]>which avr-gcc.exe
E:\WinAVR-20100110\bin\avr-gcc.exe

It would be VERY curious if you have a copy of avr-gcc.exe that doesn't know the -mmcu= option. Of course you DO have avr32-gcc.exe which most certainly does NOT know about it but you couldn't have inadvertently typed a "32" in there could you?

 

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

Ok when I do a command window it comes back C:\WINAVR~1\bin\avr-gcc.exe

as far as the complete build output its as follows

Build started 25.1.2012 at 13:36:21
mmcu=atmega168 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT rs232.o -MF dep/rs232.o.d  -c  rs232.c
'mmcu' is not recognized as an internal or external command,
operable program or batch file.
make: [rs232.o] Error 1 (ignored)
mmcu=atmega168 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT Command.o -MF dep/Command.o.d    -c -o Command.o Command.c
'mmcu' is not recognized as an internal or external command,
operable program or batch file.
make: [Command.o] Error 1 (ignored)
mmcu=atmega168 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT Main.o -MF dep/Main.o.d  -c  Main.c
'mmcu' is not recognized as an internal or external command,
operable program or batch file.
make: [Main.o] Error 1 (ignored)
mmcu=atmega168 -Wl,-Map=mtrcntrl.map rs232.o Command.o Main.o     -o mtrcntrl.elf
'mmcu' is not recognized as an internal or external command,
operable program or batch file.
make: [mtrcntrl.elf] Error 1 (ignored)
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature  mtrcntrl.elf mtrcntrl.hex
avr-objcopy: 'mtrcntrl.elf': No such file
make: *** [mtrcntrl.hex] Error 1
Build failed with 1 errors and 0 warnings...

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

Follow Mbedder's advice and configure your tool paths correctly. He has given you a picture to match exactly.

David.

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

to all

avr-gcc: C:\WinAVR-20100110\bin\avr-gcc.exe
make:C:\WinAVR-20100110\utils\bin\make.exe

if you can see something wrong with these entries I would appreciate it for a heads up. If not the only thing I can conclude is studio 4.19 and winavr 2010 no longer work together and I am screwed.

Build started 25.1.2012 at 14:19:33
mmcu=atmega168 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT rs232.o -MF dep/rs232.o.d  -c  rs232.c
'mmcu' is not recognized as an internal or external command,
operable program or batch file.
make: [rs232.o] Error 1 (ignored)
mmcu=atmega168 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT Command.o -MF dep/Command.o.d    -c -o Command.o Command.c
'mmcu' is not recognized as an internal or external command,
operable program or batch file.
make: [Command.o] Error 1 (ignored)
mmcu=atmega168 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT Main.o -MF dep/Main.o.d  -c  Main.c
'mmcu' is not recognized as an internal or external command,
operable program or batch file.
make: [Main.o] Error 1 (ignored)
mmcu=atmega168 -Wl,-Map=mtrcntrl.map rs232.o Command.o Main.o     -o mtrcntrl.elf
'mmcu' is not recognized as an internal or external command,
operable program or batch file.
make: [mtrcntrl.elf] Error 1 (ignored)
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature  mtrcntrl.elf mtrcntrl.hex
avr-objcopy: 'mtrcntrl.elf': No such file
make: *** [mtrcntrl.hex] Error 1
Build failed with 1 errors and 0 warnings...
###############################################################################
# Makefile for the project mtrcntrl
###############################################################################

## General Flags
PROJECT = mtrcntrl
MCU = atmega168
TARGET = mtrcntrl.elf
CC = 

CPP = avr-g++

## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)

## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -std=gnu99 -DF_CPU=14745600UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d 

## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += $(CFLAGS)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2

## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS +=  -Wl,-Map=mtrcntrl.map


## Intel Hex file production flags
HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature

HEX_EEPROM_FLAGS = -j .eeprom
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings


## Objects that must be built in order to link
OBJECTS = rs232.o Command.o Main.o 

## Objects explicitly added by the user
LINKONLYOBJECTS = 

## Build
all: $(TARGET) mtrcntrl.hex mtrcntrl.eep mtrcntrl.lss## Compile
rs232.o: ./rs232.c
	$(CC) $(INCLUDES) $(CFLAGS) -c  $<

Main.o: ./Main.c
	$(CC) $(INCLUDES) $(CFLAGS) -c  $<

##Link
$(TARGET): $(OBJECTS)
	 $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)

%.hex: $(TARGET)
	avr-objcopy -O ihex $(HEX_FLASH_FLAGS)  $< $@

%.eep: $(TARGET)
	-avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0

%.lss: $(TARGET)
	avr-objdump -h -S $< > $@

## Clean target
.PHONY: clean
clean:
	-rm -rf $(OBJECTS) mtrcntrl.elf dep/* mtrcntrl.hex mtrcntrl.eep mtrcntrl.lss mtrcntrl.map


## Other dependencies
-include $(shell mkdir dep 2>NUL) $(wildcard dep/*)

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

clawson wrote:
Quote:

Just re-installed studio 4.19,

Quote:

The OP has 4.18.

We sure?
I was, reading the thread title. Now I doubt :lol:

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

Is it not possible for you to simply follow Mbedder's picture?

###############################################################################
# Makefile for the project mtrcntrl
###############################################################################

## General Flags
PROJECT = mtrcntrl
MCU = atmega168
TARGET = mtrcntrl.elf
CC =

CPP = avr-g++

You can see that the $(CC) has an empty string.
Tick the boxes properly and it will get your WinAvr paths.

David.

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

To all, I would like to apologize to anyone I might have offended.

The results of my problem was a combination of oversites and ignorance.

I originally poked to many things trying to make it work, in the process switched to an external makefile which was not updated by subsequent fixes. Once I (finally) listened and carefully checked what was going on and used the correct paths (and internal makefile) things are now working, except for my lame code but that’s another matter.

The point of the post is to thank all those with enough patience to stay with me (david.prentice and Mbedder)and hope in the future I can listen better to aid given.

again, Thank You all

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

Nevertheless, thank you for a good investigation. This thread from now on will make a good help to those who will undoubtedly fall into the same pit (the GUI config + makefile mismatch) in the future. Good luck!

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

The Problem has been solved.I have faced the same error , then donwload and Install the latest AVR Toolchain 3.3.0 and AVRstudio 4.19 will work perfectly.:lol:

Direct Link to Toolchain

http://www.atmel.com/Images/avr-toolchain-installer-3.3.0.710-win32.win32.x86.exe

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

Quote:

Install the latest AVR Toolchain 3.3.0 and AVRstudio 4.19 will work perfectly

But the "toolchain" has build errors which is why we're all sticking with WinAVR20100110 until Atmel learn to build a fault free one.

 

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

Clawson said:
Why are we re-hashing this for the Nth time. It's a fault (or deliberate ploy by Atmel) in 4.19

It won't find WinAVR automatically any more.

So set it manually.

End of.

I set it was by manually but there is no report about memory usage(PROGRAM and DATA).
It was showing like this

Build started 23.8.2012 at 17:01:51
avr-gcc -mmcu=atmega8 -Wall -gdwarf-2 -DF_CPU=120000UL -O2 -fsigned-char -MD -MP -MT LCDTest.o -MF dep/LCDTest.o.d -c ../LCDTest.c
../LCDTest.c:6: warning: return type of 'main' is not 'int'
avr-gcc -mmcu=atmega8 -Wall -gdwarf-2 -DF_CPU=120000UL -O2 -fsigned-char -MD -MP -MT lcd.o -MF dep/lcd.o.d -c ../lcd.c
avr-gcc -mmcu=atmega8 LCDTest.o lcd.o -o LCDTest.elf
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature LCDTest.elf LCDTest.hex
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O ihex LCDTest.elf LCDTest.eep || exit 0
Build succeeded with 1 Warnings...

Any suggestions...

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

Quote:

Any suggestions...


Look at the Makefile - it *should* be invoking avr-size. If it doesn't you can do this separately anyway. The syntax is:

avr-size -mmcu=atmega16 -C project.elf

Replace the -mmcu in this with whatever model you use and also change the name of the file. I guess for you it would be:

avr-size -mmcu=atmega8 -C LCDTest.elf

 

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

I tried to find memory usage from make file but i did not get,
i think some hidden problem(or not compiled well).
Here i am providing my make file

###############################################################################
# Makefile for the project LCDTest
###############################################################################

## General Flags
PROJECT = LCDTest
MCU = atmega8
TARGET = LCDTest.elf
CC = avr-gcc

CPP = avr-g++

## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)

## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -DF_CPU=120000UL -O2 -fsigned-char
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d

## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += $(CFLAGS)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2

## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS +=

## Intel Hex file production flags
HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature

HEX_EEPROM_FLAGS = -j .eeprom
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings

## Objects that must be built in order to link
OBJECTS = LCDTest.o lcd.o

## Objects explicitly added by the user
LINKONLYOBJECTS =

## Build
all: $(TARGET) LCDTest.hex LCDTest.eep## Compile
LCDTest.o: ../LCDTest.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<

lcd.o: ../lcd.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<

##Link
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)

%.hex: $(TARGET)
avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@

%.eep: $(TARGET)
-avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0

%.lss: $(TARGET)
avr-objdump -h -S $< > $@

## Clean target
.PHONY: clean
clean:
-rm -rf $(OBJECTS) LCDTest.elf dep/* LCDTest.hex LCDTest.eep

## Other dependencies
-include $(shell mkdir dep 2>NUL) $(wildcard dep/*)

is it compiled well or not?

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

Well clearly there's no mention of AVR-size there so, like I say, run it separately.

 

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

Quote:
is it compiled well or not?

The answer to that specific question lies in the output from running the makefile, not in the makefile itself.

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