Where are the binaries that are "uploaded"?

I can see source code *.ino in my sketch folders, but nothing equivalent to what I would call a binary file, e.g. the output of a compiler/assembler/linker. Yet of course "upload" does in fact do so. But what from where?

http://arduino.cc/en/Hacking/BuildProcess

Build process

Sketches are compiled by avr-gcc.

The include path includes the sketch’s directory, the target directory (/hardware/core//) and the avr include directory (/hardware/tools/avr/avr/include/), as well as any library directories (in /hardware/libraries/) which contain a header file which is included by the main sketch file.

When you verify a sketch, it is built in a temporary directory in the system temp directory (e.g. /tmp on the Mac). When you upload it, it is built in the applet/ subdirectory of the sketch’s directory (which you can access with the “Show Sketch Folder” item in the “Sketch” menu).

The .c and .cpp files of the target are compiled and output with .o extensions to this directory, as is the main sketch file and any other .c or .cpp files in the sketch and any .c or .cpp files in any libraries which are #included in the sketch.

These .o files are then linked together into a static library and the main sketch file is linked against this library. Only the parts of the library needed for your sketch are included in the final .hex file, reducing the size of most sketches.

The .hex file is the final output of the compilation which is then uploaded to the board. During a “Verify” the .hex file is written to /tmp (on Mac and Linux) or \Documents and Settings<USER>\Local Settings\Temp (on Windows). During upload, it’s written to the applet sub-directory of the sketch directory (which you can open with the “Show Sketch Folder” item in the Sketch menu).

During a “Verify” the .hex file is written to /tmp (on Mac and Linux) or \Documents and Settings<USER>\Local Settings\Temp (on Windows). During upload, it’s written to the applet sub-directory of the sketch directory

This documentation is out of date. In modern versions of the Arduino IDE, both “verify” and “upload” put the binaries and intermediate files in a temporary directory whose exact location is determined by the Java implementation on the computer. The easiest way to see where it is is to turn on the Verbose compile option in the Preferences dialog. For instance, on my Mac I see:
/var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/build4642642548973123623.tmp/ (where the random numbers change with each startup of the IDE. ) Windows does someting like C:\DOCUME~1\Bill\LOCALS~1\Temp\build5164719794274105182.tmp\

You can also specify a build directory by manually editing the preferences file (unless this has changed recently.) Although there are some bugs - I think the IDE deletes the directory when you exit, but won’t create it when you start up (for example.)

What I'm actually after is to study the binaries to see what comes out of "verify".

Turn on verbose compiling. You'll find them.

see this thread:

It discusses accessing the build files and getting the disassembly from the elf file.

Side note(s) – on Windows 7(X64) :

  1. the build files are located in the user’s personal “temp” directory:
    \AppData\Local\Temp\build*
    Unless one changes the the MS Windows explorer settings this is a “hidden” directory.

  2. NO, the Arduino IDE does NOT clean up after itself.

  3. Both of these problems (1 & 2) are resolved if you set build.path in preferences.txt to point to a normal directory
    i.e. build.path=\Documents\Arduino\Build replace as required

  4. You can not use environmental variables in the preferences file (you can but they will not work).
    i.e. build.path = %HOMEPATH%\Documents\Arduino\Build

  5. The preferences.txt files is located in the directory (also a hidden directory):
    \AppData\Roaming\Arduino replace as required
    it is convenient to access if you create a shortcut to it in you sketchbook

  6. The Arduino IDE deletes the ‘generated’ CPP file when it exits.

  7. To see your home path under on Windows:
    open a command prompt start, run, command
    type: echo %HOMEPATH%
    press enter

Windows does someting like C:\DOCUME~1\Bill\LOCALS~1\Temp\build5164719794274105182.tmp\

(This was Windows XP. I keep forgetting how behind I am...)

westfw:

Windows does someting like C:\DOCUME~1\Bill\LOCALS~1\Temp\build5164719794274105182.tmp\

(This was Windows XP. I keep forgetting how behind I am…)

The biggest differences I see is when I installed on Windows 7 it created a sub directory “sketches” in my personal
directory. Both installations now look like
\My Documents\Arduino
Build (sub-dir, set by build.path in preferences.txt)
Code_Snips (sub-dir, save bits and pieces I find on the net)
Documents (sub-dir, documentation for my arduino projects)
libraries (sub-dir, user supplied libraries)
preferences (sub-dir, has shortcut to preferences.txt)
sketches (sub-dir, sketchbook — also set in preferences.txt)
utilities (sub-dir, utility to dump elf file from build to prj directory, others as I come up with them)
Arduino-Ref (HTML short cut for browser, to help file)
Arduino-Forum (HTML short cut for browser, to Arduino Forum)
Arduino-Palyground (HTML short cut for browser, to Arduino playground)

I updated the notes below for XP.
I also tested the utility “arduino_elf_dump.exe” and confirmed that it also works on XP.

Side note(s) – on Windows XP(X32) :

  1. the build files are located in the user’s personal “temp” directory:
    \Local Settings\Temp\build*.tmp replace as required
    Unless one changes the the MS Windows explorer settings this is a “hidden” directory.

  2. NO, the Arduino IDE does NOT clean up after itself.

  3. Both of these problems (1 & 2) are resolved if you set build.path in preferences.txt to point to a normal directory
    i.e. build.path=\My Documents\Arduino\Build replace as required

  4. You can not use environmental variables in the preferences file (you can but they will not work).
    i.e. build.path = %HOMEPATH%\My Documents\Arduino\Build

  5. The preferences.txt files is located in the directory (also a hidden directory):
    \Application Data\Arduino replace as required
    it is convenient to access if you create a shortcut to it in you sketchbook

  6. The Arduino IDE deletes the ‘generated’ CPP file when it exits.

  7. To see your home path under on Windows (same as win7):
    open a command prompt start, run, command
    type: echo %HOMEPATH%
    press enter
    will be something like:
    \Documents and Settings<name>
    you need to add the drive letter to the front as well
    C:\Documents and Settings<name>\