Hey guys,
anybody know a simple easy way to upload a compiled .hex file to an Arduino board without using the IDE?
Thanks so much,
Rob
Hey guys,
anybody know a simple easy way to upload a compiled .hex file to an Arduino board without using the IDE?
Thanks so much,
Rob
avrdude
command.C:\Program Files (x86)\arduino-1.6.10\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\arduino-1.6.10\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM21 -b115200 -D -Uflash:w:C:\Users\per\AppData\Local\Temp\builda0905d717cd3fb20c5f6c59067701315.tmp/serial.ino.hex:i
avrdude
command.avrdude
command to the command line..hex
file you want to upload.You can use the same system to generate the correct commands for burning a bootloader or to upload using a programmer.
Thanks for the great advice
Presumably if I send somebody the .hex file and they want to upload it, they first need to download AVRDude?
Will this method still work if I tell them to put the .hex file in a certain location and send them the command line?
Thanks so much,
Rob
robertworeilly:
they first need to download AVRDude?
That's correct. You can download it here: Index of /releases/avrdude/
robertworeilly:
Will this method still work if I tell them to put the .hex file in a certain location and send them the command line?
You will need to know the location of avrdude, avrdude.conf, and the hex file which is no problem but the difficulty is the port will probably be different from one computer to another so they would need to find which port was assigned to their Arduino and update the -P option of the command. I was assuming this was for someone with the Arduino IDE installed. For your purposes it might be more user friendly to find some kind of a GUI wrapper application for avrdude that will allow the port to be selected from a menu as the Arduino IDE does. I'm pretty sure I've seen people refer to something like that here before but I don't remember the name.
Avrdude is free tool, it is part of Arduino SW but it can be downloaded separately. Arduino IDE is just calling the command line. It will work the same way directly from the command line, of course correct paths to the files must be passed.
Incidentally, in the download are also "avrdude.exe", "avrdude.conf" and "libusb0.dll", so it works without needing to include anything apart from the *.hex file.
Edit: I just gave it a spin with an UNO and it works fine.
Edit2: And a Mega2560. No problems.
Thanks for the good description! I compiled the Blink Sketch, adjusted the output of the IDE for my firmware and copied the firmware to the Temp directory where the binary of Blink is located. All I had to do was add the quotes needed under Windows and the command to upload to the display now looks like this:
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude" "-CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega328p -carduino -PCOM13 -b9600 -D -Uflash:w:C:\Users\mike\AppData\Local\Temp\arduino_build_221325/OpenLCD.ino.arduino_standard.hex:i
Windows can't process the spaces before and after files without the quotes. Program Files (x86) Therefore, the command and the reference to the config file must be enclosed in quotation marks.
Good info in this thread. Here I am trying it about 15 months later. After adjusting the quotes for the path names I was able to get to the point where the error was "access denied". No doubt due to trying to work within the Program Files folder. Opening the Command Window as administrator didn't help.
Eventually I remembered that I have the WinAVR complier installed from years ago under C:, so no rights issues there. I replaced the path to point there for avrdude.exe and avrdude.conf and then I was able to upload a HEX file to the Arduino.
My problems were more Windows related than Arduino related, and my solution wouldn't work for most folks, but I add it anyway as another viewpoint.
Nick Kennedy