Pages: [1]   Go Down
Author Topic: problem with "avr-size"  (Read 1007 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Milano, Italy
Offline Offline
Edison Member
*****
Karma: 15
Posts: 1163
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

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?
Logged

F

Left Coast, USA
Offline Offline
Sr. Member
****
Karma: 5
Posts: 499
Sometimes I just can't help myself.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello
Hi.

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

or

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:

\\whatever\arduino-0022\hardware\tools\avr\bin

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.)

Regards,

Dave
« Last Edit: April 23, 2011, 12:59:56 pm by davekw7x » Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6374
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Global Moderator
Milano, Italy
Offline Offline
Edison Member
*****
Karma: 15
Posts: 1163
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

F

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6374
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)

Logged

Global Moderator
Milano, Italy
Offline Offline
Edison Member
*****
Karma: 15
Posts: 1163
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow thanks westfw and all others posted here!

For now, I used the temporary command:

Code:
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:
...>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...
Logged

F

Pages: [1]   Go Up
Jump to: