Pages: [1]   Go Down
Author Topic: Programming Arduino from the command line  (Read 580 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That's stk500v1, btw.  
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool, thanks for the info.

Cheers,
Gaz.
Logged

Pages: [1]   Go Up
Jump to: