Go Down

Topic: Programming Arduino from the command line (Read 739 times) previous topic - next topic

gazsp

Can anybody tell me how I can program the Arduino just by using gcc and avrdude? I really want to do some development in plain C (and not use the IDE).

Cheers,
Gaz.

mellis

Do you still want to use the Arduino core API / functions?  If so, there's a Makefile that's probably close to working in the hardware/cores/arduino sub-directory of the Arduino application directory.  Or you can set build.verbose and upload.verbose to true in your Arduino preferences file and it will spit out the command lines it uses.  You can also create additional tabs in the IDE: if you give them a .c or .cpp extension, the IDE won't make any changes to them before passing them to gcc.  Use the menu that drops down if you click the right-pointing arrow in the upper right corner of the IDE.

If you don't want to use the Arduino core API or functions, then you should be able to treat the Arduino board as you would any other ATmega development board with an FTDI USB-to-serial chip on it.

gazsp

I don't want to use any of the Arduino core files. I just want to use it as an Atmega168 connected via USB. I'd just like the option of using the IDE or not. :-)

I'd really like to know how to download a file to the board using the built in bootloader and avrdude (but compiled on my own).

Cheers,
Gaz.

mellis

In that case, all you really need to know is that the Arduino bootloader is (more-or-less) stk500 compatible, and running at 19200 baud.  If you don't use the Arduino version of avrdude, you'll need to use the -F flag, since the command that the standard avrdude use to get the chip (device) signature isn't supported by the bootloader.  Everything else should be covered by the avrdude documentation.

mellis


gazsp


Go Up