Hello everyone and thanks in advance, I suppose that with the title the doubt is obvious, I am looking for information about the process that the Arduino ide performs when uploading the code to the card, I know what files are involved when uploading to the microcontroller the HEX file that is generated, but I still don't know how the Arduino ide internally generates that file or what files and programs of this ide are involved. I would like to generate this file from windows console or linux terminal. Thanks again and sorry for the inconvenience.
Arduino - Integrated Development Environment for Arduino Boards
arduino [ --verify | --upload ] [ --board package : arch : board [: parameters ]] [ --port port name ] [ --pref name=value ] [ -v | --verbose ] [ --preserve-temp-files ] [ FILE.ino ]
arduino [ --get-pref [ preference ]]
arduino [ --install-boards package name : platform architecture [: version ]]
arduino [ --install-library library name [: version ] [, library name [: version ], library name [: version ]]
arduino [ --version ]
The Arduino Integrated Development Environment allows editing, compiling, and uploading of sketches (programs) for Arduino (and compatible) microcontroller boards.
Normally, running the arduino command starts the IDE, optionally loading any .ino file specified on the command line.
Alternatively, if any of the following command line options are given, no graphical interface will be displayed and instead a one time check (compile) or upload will be performed. A single .ino file should be given. If the sketch contains multiple .ino files, any one can be specified on the command line, but the entire sketch will be compiled.
When running in single mode, it can be useful to set the build.path preference to allow keeping intermediate build results between multiple runs and only recompiling the files that changed.
Note that on MacOS X, the main executable is Arduino.app/Contents/MacOS/Arduino instead of arduino .
Note that on Windows, due to the difference between GUI and console applications, arduino_debug.exe is the appropriate executable to use if you want to use most of these command line options. The arduino.exe GUI version of the launcher can perform some of the functions described below, but it won't output any messages to the console, which means it's pretty useless if you want any feedback or to be able to keep log files for automated tests. etc.
--verify Build the sketch.
--upload Create and upload the sketch.
--get-pref [ preference ] Print the value of the given preference to the standard output stream. When the value does not exist, nothing is printed and the exit status is set (see OUTPUT STATUS below). If no preference is given as a parameter, print all preferences.
--install-boards package name : platform architecture [: version ] Find the list of available board (platform) support and install the specified one, along with its related tools. If version is omitted, the latest is installed. If a platform with the same version is already installed, nothing is installed and the program exits with exit code 1. If a platform with a different version is already installed, it is replaced.
--install-library library name [: version ] Captures available libraries list and install the specified one. If version is omitted, the latest is installed. If a library with the same version is already installed, nothing is installed and the program exits with exit code 1. If a library with a different version is already installed, it is replaced. Multiple libraries can be specified, separated by a comma.
--version Print the version information and exit.
board package : arch : board [: parameters ]
Select the board to build.
package is the vendor identifier (the first level folders within the hardware directory). Default arduino boards use arduino .
architecture is the architecture of the board (second level folders within the hardware directory). Default arduino boards use arduino:avr for all AVR based boards (like Uno, Mega or Leonardo) or arduino:sam for 32-bit SAM based boards (like Arduino Due).
board is the board to use, as defined in boards.txt located in the selected architecture folder. For example, arduino:avr:uno for Arduino Uno, arduino:avr:diecimila for Arduino Duemilanove or Diecimila, or arduino:avr:mega for Arduino Mega.
parameters is a comma-separated list of tables of specific parameters that are typically displayed under submenus of the "Tools" menu. For example, arduino:avr:nano:cpu=atmega168 to select the mega168 variant of the Arduino Nano board.
If this option is not passed, the value of the current preferences (for example, the last selected table in the IDE) is used.
--port port name Select the serial port to perform the sketch upload. On Linux and MacOS X, this should be the path to a device file (eg /Dev/ttyACM0 ). On Windows this should be the name of the serial port (eg COM3 ).
If this option is not passed, the value of the current preferences (for example, the last port selected in the IDE) is used.
--verbose-build Enable verbose mode during build. If this option is not provided, verbose mode during compilation is disabled regardless of the current preferences.
--preserve-temp-files Keep temporary files (pre-rendered sketch, object files...) after completion. If omitted, temporary files are removed.
This option is only valid in conjunction with --verify or --upload .
--useprogrammer Load using a programmer. Set whether you are using an external programmer or using Arduino as ISP.
--verbose-upload Enable verbose mode during upload. If this option is not provided, verbose mode during upload is disabled regardless of the current preferences.
This option is only valid in conjunction with --verify or --upload .
-v , --verbose Enable verbose mode during build and load. This option has the same effect as using --verbose-build and --verbose-upload .
This option is only valid in conjunction with --verify or --upload .
--preferences-file filename Read and store preferences from the specified filename instead of the default.
--pref name = value Set the name of the preference to the given value.
Note that the preferences you set with this option are not validated: invalid names will be set but never used; invalid values can cause an error later.
--save-prefs Save (modified) preferences to preferences.txt . In particular --board , --port , --pref , --verbose , --verbose-build and --verbose-upload can override the current preferences.
Arduino maintains a list of preferences, as simple name-value pairs. Some of them are documented below, but many more are available.
sketchbook.path The path where sketchbooks are (usually) stored. This path may also contain some special subdirectories (see FILES below).
update check When set to true, the IDE checks for a new version at startup.
editor.external When set to true, use an external editor (the IDE does not allow editing and reloading each file before checking).
Build Path The path to use for building. This is where things like the preprocessed .cpp file, the compiled .o files, and the final .hex file go.
If set, this directory should already exist before executing the arduino command.
If this preference is not set (which is usually the case), a new temporary build folder is created on every run and is deleted again when the application is closed.
0 : Success
1 : Compilation error or upload failed
2 : Sketch not found
3 : Invalid command line option (argument for)
4 : Preference passed to --get-pref does not exist
%LOCALAPPDATA%/Arduino15/preferences.txt (Windows) ~/Library/Arduino15/preferences.txt (Max OS X) ~/.arduino15/preferences.txt (Linux) This file stores the preferences used for the IDE, building and loading sketches.
My Documents/Arduino/ (Windows) ~/Documents/Arduino/ (Mac OS X) ~/Arduino/ (Linux) This directory is known as the "Sketchbook" and contains user sketches. The path can be changed via the sketchbook.path preference .
In addition to sketches, three special directories can be inside the sketchbook:
libraries Libraries can be placed within this directory, one library per subdirectory.
hardware Support for third-party hardware can be added through this directory.
tools External code processing tools (which can be run through the IDE's Tools menu) can be added here.
Start the Arduino IDE, with two files open:
arduino /path/to/sketch/sketch.ino /path/to/sketch/extra.ino
Compile and upload a sketch using the last selected board and serial port
arduino --upload /path/to/sketch/sketch.ino
Compile and upload a sketch to an Arduino Nano, with an Atmega168 CPU, connected to the /dev/ttyACM0 port:
arduino --board arduino: avr: nano: cpu = atmega168 --port / dev / ttyACM0 --upload /path/to/sketch/sketch.ino
Build a sketch, put the build results in the build directory, and reuse previous build results in that directory.
arduino --pref build.path = / ruta / a / boceto / compilación --verify /path/to/sketch/sketch.ino
Change the selected table and build path and do nothing else.
arduino --pref build.path = / ruta / a / boceto / compilación --board arduino: avr: uno --save-prefs
Install the latest SAM board support
arduino --install-boards "arduino: sam"
Install the AVR board bracket, 1.6.2
arduino --install-boards "arduino: avr: 1.6.2"
Install the Bridge library version 1.0.0
arduino --install-library "Bridge: 1.0.0"
Install Bridge and Servo libraries
arduino --install-library "Bridge: 1.0.0, Servo: 1.2.0"
1.5.2 Added initial command line support. This introduced --verify , --upload , --board , --port , --verbose and -v .
1.5.5 Added support for board-specific parameters to --board .
Sketch file names are now interpreted relative to the current directory rather than the location of the arduino command.
1.5.6 Introduced --pref , --preferences-file , --verbose-build and --verbose-upload .
Preferences set via --pref are remembered, preferences set via --board , --port or --verbose options are not.
When run with --verify or --upload , the full GUI is no longer displayed. Error messages still use a graphical popup and on Windows, the splash screen is still displayed.
1.5.8 Introduced --save-prefs .
1.6.2 The main executable on MacOS X changed from Arduino.app/Contents/MacOS/JavaApplicationStub to Arduino.app/Contents/MacOS/Arduino .
1.6.4 Introduced --install-boards and --install-library .
A path passed to --preferences-file , or set in the build.path , preferences.path , or settings.path is now interpreted relative to the current directory rather than the location of the arduino command.
Website: http://www.arduino.cc/ Help on projects and programming: http://forum.arduino.cc/ Report bugs: https://github.com/arduino/Arduino/issues Development mailing list from IDE and framework: https://groups.google.com/a/arduino.cc/forum/#!forum/developers
You can find this information in English at: ARDUINO (1) Manual Page