Hello,
I have a question about the compiled sketch of the Nano.
After the sketch is compiled on the IDE, in the build directory I see multiple files and directories.
Some of them are
<script_name>.nfo.hex,
<script_name>.ino.with_bootloader.hex
<script_name>.ino.with_bootloader.bin
My question is: Which of these files are actually uploaded to the Nano? Which file is actually executed on the Nano?
The .hex file is always uploaded to the Arduino. But where did you find the other files? Int he same location or in a different location?
If you enable "verbose output during upload" in the IDE under file->preferences, you can see which file is actually uploaded; it will be the hex (if not mistaken) without the bootloader in the name.
Arnav,
I found all the other files in the build directory. There were also some other subdirectories in it as well. These files are generated automatically every time I compiled...
So from what I understand, only the .hex file is uploaded (without the bootloader). So, what is the purpose of the other files?
If you Upload Using Programmer, the .hex file without the bootloader is used.
Otherwise, Upload uses the file With the bootloader.
The others are interim files used in the compilation/hex file building process.
You can use Notepad++ and open all the files to see what they have.
I find the easiest way to get to that folder is to go File:Preferences, click the More preferences path at the bottom, then back up one folder to /Local, open the /Temp folder, and then the build folders are there.
Hi CrossRoads,
Thanks for your reply..
Can you please elaborate on "If you Upload Using Programmer, the .hex file without the bootloader is used" ?
At present I am just using the IDE (running on PC) to do the compilation/uploading on to the Nano.
I am also thinking of using xLoader to update from PC to Arduino,
So when I use a PC, which one of the hex file is actually uploaded to Nano (one without bootloader or the one wiith the bootloader ?
When you do a normal upload using USB
C:\Users\sterretje\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/bin/avrdude -CC:\Users\sterretje\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf -v -patmega328p -carduino -PCOM4 -b115200 -D -Uflash:w:C:\Users\sterretje\AppData\Local\Temp\arduino_build_175144/[b][color=red]Blink.ino.hex[/color][/b]:i
The first line of the verbose output as described in reply #2