To upload a .hex file to an [Arduino board](https://www.ampheo.com/c/development-board-arduino), you can bypass the Arduino IDE and use tools like AVRDUDE (used internally by the IDE) or command-line uploaders. Here's how to do it: ![maxresdefault (25)](https://hackmd.io/_uploads/HyDo9y3Ege.jpg) **Step-by-Step: Upload .hex File to Arduino** **You’ll Need:** * Arduino board (e.g., Uno, Nano, Mega) * .hex file (compiled sketch or firmware) * AVRDUDE installed (comes with Arduino IDE or install separately) * COM port of the [Arduino](https://www.onzuu.com/manufacturer/arduino) * Correct board type and upload settings **Option 1: Using AVRDUDE (Command Line)** **Command Syntax:** ``` bash avrdude -C <path_to_avrdude.conf> -v -patmega328p -carduino -P<COMx> -b115200 -D -Uflash:w:<filename.hex>:i ``` **Example for Arduino Uno (Windows):** ``` bash avrdude -C "C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" ^ -patmega328p -carduino -P COM4 -b115200 -D -Uflash:w:"myprogram.hex":i ``` **Example for Linux/macOS:** ``` bash avrdude -C /etc/avrdude.conf -v -patmega328p -carduino -P /dev/ttyUSB0 -b115200 -D -Uflash:w:myprogram.hex:i ``` **Explanation of Key Parameters:** ![企业微信截图_20250627174805](https://hackmd.io/_uploads/B1SktkhElx.png) **Important Notes:** * Make sure no other program (like Arduino IDE) is using the COM port. * Press the Reset button just before uploading if needed (on older boards). * If you’re unsure of the COM port, check Device Manager (Windows) or ls /dev/tty* on Linux/macOS. **Option 2: Using XLoader (for Windows)** If you're on Windows and want a GUI tool: 1. Download XLoader: https://xloader.russemotto.com/ 2. Select: * .hex file * Device type (e.g., [Arduino Uno](https://www.ampheo.com/product/a000046-25542493), Mega) * COM port * Baud rate 3. Click Upload **Option 3: Arduino IDE with Sketch Precompiled** If you have the .hex but still want to use the [Arduino](https://www.ampheoelec.de/c/development-board-arduino) IDE: * Use an external programmer (e.g., USBasp) * Or use Sketch > Export compiled Binary, then upload it via tools