I want to compile the sketch with the Arduino IDE but then locate the bin file and upload it using another program.
How can I design a custom uploader for Arduino (specifications, etc.)?
I want to compile the sketch with the Arduino IDE but then locate the bin file and upload it using another program.
How can I design a custom uploader for Arduino (specifications, etc.)?
You can already do this with avrdude
. If you don't absolutely need to develop another program, try using this.
If you absolutely must implement your own programmer, check out the stk500 protocol.
Sample usage:
/usr/local/bin/avrdude -V -F -C /etc/avrdude.conf -p atmega328p -P /dev/ttyACM0
-c stk500v1 -b 57600 -U flash:w:applet/helloworld.hex
Multiplatform tutorial:
Here's a similar program (written in c#) that relies on avrdude:
Command line example:
The following is the command that should be used for uploading a program to an Arduino Duemilanove (with an ATmega168 chip).
avrdude -c arduino -p m168 -P usb -U flash:w:FILENAME
replace FILENAME with the hex file you wish to upload to the board. This assumes that you want to write a file to the flash memory. You can of course verify or read from different portions of memory depending on your chip but I’ll leave you to figure that out from the AVRdude manual.
You need to develop something which can speak the Arduino bootloader protocol. I suggest consulting the Arduino documentation and code available at http://arduino.cc for more information.
See the makefile - there is a separate task for uploading the binary to Arduino. This way you will find the tool that does it and the parameters (I don't remember from the top of my head) and you will be able to do it manually (using the tool) instead from IDE. Writing a tool like that seems to be reinventing the wjeel.