Electronic – arduino – How to upload a hex file firmware to a target board without using the arduino IDE

arduinoavrdudefirmware

Is there a way for me to create an installer that runs a shell script to upload a firmware update to an arduino that doesn't involve using the IDE? I have a thing that I make that sometimes needs a firmware update, and sometimes the people who would apply the firmware update wouldn't be able to apply the update from the IDE. I'm guessing it's something to do with avrdude, but try as I might to learn how, I just haven't had any luck on my own.

I can handle the "create an installer that runs a shell script" part.

Best Answer

I believe this could be accomplished from the commandline as below (and thus could easily be turned into a script). This is not a fully tested answer, and I will update it as progress happens, either via my testing or others' verification.

First get avrdude (minimum files: avrdude.conf, avrdude.exe, and libusb0.dll).

Then from the commandline, run something to the effect of:

avrdude -U flash:w:[put-hex-file-path-here]:i -C avrdude.conf -v -p atmega328 -b 115200 -c stk500v2 -P [put-device-path-here]