WinAVR versus Windows 7 64 bit

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

I have the latest WinAVR (March. 2009)

I get some errors when I run make with Windows 7 64 bit. It works okay with Windows 7 32 bit. Because I have both OS versions installed, it's not a big problem for me presently.

It's usually avr-objcopy or avr-objdump that fails.

Here's what it looks like:

avr-objdump -h -S system.elf > system.lss
/usr/bin/sh: /f/WinAVR/bin/avr-objdump: Invalid argument
make: *** [system.lss] Error 126
bash-3.2$
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
        --change-section-lma .eeprom=0 --no-change-warnings -O ihex blinker.elf blinker.eep || exit 0
/usr/bin/sh: /f/WinAVR/bin/avr-objcopy: Invalid argument
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not sure what the problem is, but I can say that I have WinAVR running on both my desktop and laptop, both running Win7 64bit. Good luck getting to the bottom of the issue.

 

Clint

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

Steve at a command prompt what does

which avr-objdump.exe

report and what does

avr-objdump -v

then report? It should be

GNU objdump (WinAVR 20090313) 2.19
Copyright 2007 Free Software Foundation, Inc.

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

clawson wrote:
Steve at a command prompt what does

which avr-objdump.exe

report


f:\WinAVR\bin\avr-objdump.exe

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

clawson wrote:
Steve at a command prompt what does

avr-objdump -v

then report? It should be

GNU objdump (WinAVR 20090313) 2.19
Copyright 2007 Free Software Foundation, Inc.

GNU objdump (WinAVR 20090313) 2.19
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

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

I always use Cygwin's Bash. That seems to be a factor. I ran a few tests and found if I use the cmd.exe command prompt, I don't get the errors.

This problem seems to come and go. I didn't notice anything wrong last week when I tried Winavr.

I will do some more tests tomorrow. I hope I don't have to give up Bash for cmd.exe.

I think I have the latest cygwin. Bash is version 3.2.49. The cygwin1.dll is the same file version (1005.25.0.0) as the one in WinAVR, although the modified date is earlier. (6/12/2008)

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

OK, if you are willing to trust an .exe I wrote then use the attached and temporarily replace avr-objdump.exe with showargs.exe (just rename showargs to be avr-objdump) then try building. This will then show you which options are bing passed to avr-objdump and may give a clue to what is wrong:

D:\c>showargs 5 8 fred
arg0 = showargs
arg1 = 5
arg2 = 8
arg3 = fred

In case you don't want to run my pre-compiled .exe in the .zip I provided the (uber simple!) source too.

Cliff

PS Just read your next post about the shell you use. Bash is going to "glob" in a different way to cmd.exe:

http://en.wikipedia.org/wiki/Glob_(programming)

Attachment(s): 

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

Thanks Cliff. I am not home now but I will try it tomorrow. Don't worry about not trusting your program. I don't trust anyone's programs. :) I have a clone of the O.S. where I try out everything first.

By the way, the "Invalid argument, Error 126" problem was often reported here 2 years ago with Vista. But in the posts I've seen it involved avr-nm. I originally had this avr-nm problem when I was using a 2 year old WinAVR on Win7. I have since switched to the latest WinAVR which cured avr-nm, but now find the problems reported in this thread.

https://www.avrfreaks.net/index.p...

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

When I run make and a program fails, if I run the same command from the command line, it succeeds.

The following is a make, and the avr-nm fails. You can see it on the fifth line from the bottom.

The last three lines shows the same command run from the command line. It succeeds.

bash-3.2$ make
make

-------- begin --------
avr-gcc (WinAVR 20090313) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Linking: blinker.elf
avr-gcc -mmcu=atmega324p -I. -gdwarf-2 -DF_CPU=921600UL -Os -funsigned-char -funsigned-bitfields -fp
ack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.o  -std=gnu99 -Wundef -MMD -MP -
MF .dep/blinker.elf.d main.o new_delete.o --output blinker.elf -Wl,-Map=blinker.map,--cref     -lm

Creating load file for Flash: blinker.hex
avr-objcopy -O ihex -R .eeprom blinker.elf blinker.hex

Creating load file for EEPROM: blinker.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
        --change-section-lma .eeprom=0 --no-change-warnings -O ihex blinker.elf blinker.eep || exit
0

Creating Extended Listing: blinker.lss
avr-objdump -h -S blinker.elf > blinker.lss

Creating Symbol Table: blinker.sym
avr-nm -n blinker.elf > blinker.sym
/usr/bin/sh: /f/WinAVR/bin/avr-nm: Invalid argument
make: *** [blinker.sym] Error 126
bash-3.2$ avr-nm -n blinker.elf > blinker.sym
avr-nm -n blinker.elf > blinker.sym
bash-3.2$
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

PS Just read your next post about the shell you use. Bash is going to "glob" in a different way to cmd.exe:
I don't think I'm globbing. I run make by just typing "make".

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

globbing is the way the command interpreter passes the command line args to the invoked program

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

I think I fixed the problem, but I'm not sure. Because the symptoms seem to depend on the phase of the moon, only time will tell.

I had a non-existant folder in the PATH variable. It was the first folder. Since I took it out, there have been no failures.

That seems strange to me. If nothing ever worked with the bad PATH entry, it might make sense. But this problem only happens when running make from a 64 bit O.S. And the failure happens at different places in the makefile from one day to the next.

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

The reason it worked when I used the cmd.exe command prompt is because that non-existant entry wasn't in PATH. I set up some entries in PATH in a batch file I use to start bash. That's where the non-existant entry came from.