Uploading Arduino hex file using avrdude

Darth.Vader picture Darth.Vader · May 21, 2014 · Viewed 9.5k times · Source

I need to use avrdude from a terminal to upload the compiled Arduino sketch (.hex file) to my Arduino Pro Mini 5V. I am programming the Pro Mini board with an FTDI 5V. When I plug in the board into my machine and run the avrdude command with the following parameters, it says that it cannot find that device on that port (see image below). Can someone tell me how to get the port info ("-P") for where I plug in my board into my computer?

avrdude Upload Command showing exception:

enter image description here

Answer

Darth.Vader picture Darth.Vader · May 21, 2014

I figured this out myself. In the Preferences tab in the Arduino IDE, I turned on verbosity while uploading the code to the board. From the dump, I figured out this is how you can upload the code (the compiled file - .hex file) to Arduino Pro Mini 5V board:

avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:/tmp/build8135728863211847829.tmp/sketch_may21b.cpp.hex:i