Go Down

Topic: problem with "avr-size" (Read 2285 times) previous topic - next topic



I'm trying to use the avr-size utility unsuccessfully. I'm running Windows7

what i do is:
- open command prompt
- compile (verify) my sketch
- with command "cd" i move into my compiled sketch folder ( ex: C:\Users\Federico\AppData\Local\Temp\build2161693329745786396.tmp )
- write the command: avr-size MySketchName.cpp.elf and press enter...

What happen is:

"avr-size" is not recognized as internal or external command, an executable program or batch file

avr-size should be included in the avr-gcc toolchain that i suppose comes with Arduino IDE! Am I right?

Do you have any advice to get working this utility on my computer?


Apr 23, 2011, 07:56 pm Last Edit: Apr 23, 2011, 07:59 pm by davekw7x Reason: 1


Quote from: Federico Vanzati
I'm trying to use the avr-size utility...

The operating system does not know where to find executables unless either

1.  The file is in a directory defined by the %path% environment variable


2.  You give it the complete path name as part of the command.

And, yes, you are correct: avr-size.exe  (and other avr-stuff) is under the arduino installation directory:


Append that directory to your %path%.  (In Windows XP, you can set and modify environment variables from the Control Panel->System->Advanced->Environment Variables box.  I don't know exact details for later versions of Windows.)




avr-size should be included in the avr-gcc toolchain that i suppose comes with Arduino IDE! Am I right?

yes, but the ide invokes the programs explicitly, and does NOT modify your default system paths to include all of the binary directories that it provides.


so how can i modify something for get running avr-size.exe?


Like Dave said:  \\whatever\arduino-0022\hardware\tools\avr\bin

For example, I have a \bin\ directory where I put less formal installs, and I can do:
C:\Documents and Settings\Bill Westfield>c:\bin\arduino21\hardware\tools\avr\bin\avr-size.exe --help
Usage: c:\bin\arduino21\hardware\tools\avr\bin\avr-size.exe [option(s)] [file(s)]
Displays the sizes of sections inside binary files
If no input file(s) are specified, a.out is assumed
The options are:
  -A|-B|-C  --format={sysv|berkeley|avr}  Select output style (default is berkeley)
            --mcu=<avrmcu>            MCU name for AVR format only
  -o|-d|-x  --radix={8|10|16}         Display numbers in octal, decimal or hex
  -t        --totals                  Display the total sizes (Berkeley only)
            --common                  Display total size for *COM* syms
            --target=<bfdname>        Set the binary file format
            @<file>                   Read options from <file>
  -h        --help                    Display this information
  -v        --version                 Display the program's version

Within a particular session, the cmd window history functions are very useful.  If you're going to be doing this a lot, you can add the appropriate directory to your path:???
path c:\bin\arduino21\hardware\tools\avr\bin;%path%
(either manually, in some "avdev-setup.bat" file, or even autoexec.bat)


Wow thanks westfw and all others posted here!

For now, I used the temporary command:

Code: [Select]
path C:\Users\Federico\Desktop\arduino-0021\hardware\tools\avr\bin;%path%

to add the executable to the windows path, then move into the compiled sketch folder and launch the command:

Code: [Select]
...>cd C:\Users\Federico\AppData\Local\Temp\build4288029111388491449.tmp
C:\Users\Federico\AppData\Local\Temp\build4288029111388491449.tmp>avr-size SketchName.cpp.elf

And it works well!!

Now i need try to find the "autoexec.bat" and add the path there...

Go Up