Before we get into programming, we should go over the tools. First, have "make." It runs the "makefile" file as a script. You specify "targets" as a "parameter." Genereally, with CLI (Command Line Interface), you type in the name of a program, then "pass" "parameters" to the program.

If you open the makefile file, you'll find that it has a simple scripting format. "all:" is used for default (typing just "make") and the first line of it is a line to a program called "avr-gcc." GCC is the "Gnu Compiler Collection," and "avr-" is prefixed to say it's for AVRs. The first param "-o" specifies that the next param is the name of what the "output file" should be. The second parameter, here, states what the target processor is, which is the atmega328p. Next we specify the name of the source file that we're using. gcc automatically figures out what the programming language is based on the "extension," or the letters after the period in the file name. S is assumed to be assembly. Lastly, "-nostdlib" is a reference to how "stdlib" is usually included by default, but stdlib is not available on AVRs (this should be an automatic assumption, then, but it's not).

"objcopy" is a program that is used to convert various "binary formats" to other "binary formats." While the default format (elf) is useful, hex and bin are more useful. Most emulators like .hex, while .bin is raw output, which is easily analyzed in a "hex editor" if you have one. For more information on this tool, I recommend reading the manual.

avrdude is a tool that's not normally part of the "binutils" package that contains the above 2 tools. It basically serves as a tool to upload files to the arduino. "cp" is a linux tool for copying files. To get more information on these tools, read the manuals. While they have "backwards compatibility," they're always adding new features, so it's impossible to be comprehensive without being a part of the dev team.

Get your own web kitty here!
┬ęCopyright 2010, 2011, 2012, 2013, 2014, 2017, 2018. All rights reserved.