user62872: I have a sketch for an Arduino Nano. I'm compiling it on my build server and get these 3 files:

project.bin.elf
project.bin.hex
project.bin.with_bootloader.hex

Now I need to be able to upload/flash them onto the board (connected via a serial interface) without arduino-cli. Mainly because I can't install it via apt-get which means I'd have to start jumping through loops to be able to use it (stuff like keeping it up to date, installing, etc. on hundreds of devices).
So I was wondering if there are any tools in the debian repositories I can use to upload the compiled sketch and if so how.
I've been looking for a solution and came across several answers and topic but strangely enough all either use arduino-cli, other specialized tools or link to dead pages or pages that no longer contain the answer.
Examples:

How to compile, upload and monitor via the Linux command line?
Compiling sketch vi command line


user4143: Use avrdude.
The command format is simple, assuming you have installed it from the Linux repositories:
avrdude -carduino -patmega328p -P/dev/ttyUSB0 -b115200 -Uflash:w:/path/to/project.bin.hex:i

Depending on what bootloader is installed in your nano you may need to change the  baud rate (-b115200) to 57600. Also, of course, the USB device should be set to what your board actually identifies as.
The breakdown of the command is:
-c<programmer type>
-p<part name>
-P<port>
-b<baud rate>
-U<instruction>

The programmer type, part name and baud rate can all be gleaned from the boards.txt file in the AVR core files.  For example, for the Nano:
nano.upload.protocol=arduino
nano.menu.cpu.atmega328.upload.speed=115200
nano.menu.cpu.atmega328.build.mcu=atmega328p

relate to -c -b and -p respectively.  The instruction will always be the same, and means "Write to flash the following file in IHEX8 format".  "flash" is the destination memory, "w" is the write command, and ":i" at the end defines the expected file format.
On a Linux computer with avrdude installed you can find much more information with man avrdude.

62872: <p>I have a sketch for an Arduino Nano. I'm compiling it on my build server and get these 3 files:</p>

<ul>
<li><code>project.bin.elf</code></li>
<li><code>project.bin.hex</code></li>
<li><code>project.bin.with_bootloader.hex</code></li>
</ul>

<p>Now I need to be able to upload/flash them onto the board (connected via a serial interface) without <code>arduino-cli</code>. Mainly because I can't install it via <code>apt-get</code> which means I'd have to start jumping through loops to be able to use it (stuff like keeping it up to date, installing, etc. on hundreds of devices).<br>
So I was wondering if there are any tools in the debian repositories I can use to upload the compiled sketch and if so how.</p>

<p>I've been looking for a solution and came across several answers and topic but strangely enough all either use <code>arduino-cli</code>, other specialized tools or link to dead pages or pages that no longer contain the answer.</p>

<p>Examples:</p>

<ul>
<li><a href="https://arduino.stackexchange.com/q/15893/62872">How to compile, upload and monitor via the Linux command line?</a></li>
<li><a href="https://arduino.stackexchange.com/q/31160/62872">Compiling sketch vi command line</a></li>
</ul>
 4143: <p>Use <code>avrdude</code>.</p>

<p>The command format is simple, assuming you have installed it from the Linux repositories:</p>

<pre><code>avrdude -carduino -patmega328p -P/dev/ttyUSB0 -b115200 -Uflash:w:/path/to/project.bin.hex:i
</code></pre>

<p>Depending on what bootloader is installed in your nano you may need to change the  baud rate (<code>-b115200</code>) to 57600. Also, of course, the USB device should be set to what your board actually identifies as.</p>

<p>The breakdown of the command is:</p>

<pre><code>-c&lt;programmer type&gt;
-p&lt;part name&gt;
-P&lt;port&gt;
-b&lt;baud rate&gt;
-U&lt;instruction&gt;
</code></pre>

<p>The programmer type, part name and baud rate can all be gleaned from the <code>boards.txt</code> file in the AVR core files.  For example, for the Nano:</p>

<pre><code>nano.upload.protocol=arduino
nano.menu.cpu.atmega328.upload.speed=115200
nano.menu.cpu.atmega328.build.mcu=atmega328p
</code></pre>

<p>relate to -c -b and -p respectively.  The instruction will always be the same, and means "Write to flash the following file in IHEX8 format".  "flash" is the destination memory, "w" is the write command, and ":i" at the end defines the expected file format.</p>

<p>On a Linux computer with <code>avrdude</code> installed you can find much more information with <code>man avrdude</code>.</p>
