Sanguino From the Command Line

If you choose to use the Sanguino with something other than the Arduino IDE, here are some tips that may get you rolling faster.

Compiling with avr-gcc

To compile your program using avr-gcc, you can make use of the makefile that resides at Sanguino/cores/arduino/Makefile. The makefile comes with instructions for adapting it to your system.

Uploading with Avrdude

The same makefile listed above has a "make upload" option that invokes avrdude. There are a couple settings that must be right for this to work properly. These are the baudrate, the programmer, and the chip.

Here is avrdude being successfully called from my computer:

[install_dir]/avrdude -V -F -C [conf_dir]/avrdude.conf -p atmega644 -P /dev/ttyUSB0 -c stk500v1 -b 38400 -U flash:w:applet/example_program.hex

Note the following options used:
-b 38400 (the baudrate. Otherwise it won't connect at all)
-c stk500v1 (the programmer. In my case I'm using the USB-BUB)
-p atmega644 (the chip. If this is wrong, you may be able to upload, but it may not run properly)

If you can already upload fine from within the Arduino IDE and you want to see what settings it is using, take a look at the settings in Sanguino/boards.txt and Sanguino/programmers.txt.


The other thing I don't understand yet is timing. You must press reset on the Sanguino board right before you press ENTER to invoke avrdude. There must be a way to not have to time this so strictly, as when using the Arduino IDE you don't have to press reset at all.


This page was created by Jack Desert <moc.liamg|655tresedkcaj#moc.liamg|655tresedkcaj>. Feel free to send email if you're working in a similar vein.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License