Building the Blinking LED Program
In this section, we show an example build procedure for the Arcom VIPER-Lite development board. If another hardware platform is used, a similar process should be followed using the tools and conventions that accompany that hardware.
The installation procedure for the software development tools is provided in Appendix B. Once the tools are installed, the commands covered in the following sections are entered into a command shell. For Windows users, the command shell is a Cygwin bash shell (Cygwin is a Unix environment for Windows); for Linux users, it is a regular command shell.
Tip
In this and subsequent chapters, commands entered in a shell
environment are indicated by the number sign (#)
prompt. Commands entered in the RedBoot environment are indicated by
the RedBoot prompt (RedBoot>).
We will next take a look at the individual commands in order to manually perform the three separate tasks (compiling, linking, and locating) described earlier in this chapter. Then we will learn how to automate the build procedure with makefiles.
Compile
As we have implemented it, the Blinking LED example consists of two source modules: led.c and blink.c. The first step in the build process is to compile these two files. The basic structure for the gcc compiler command is:
arm-elf-gcc []options...file
The command-line options we’ll need are:
-gTo generate debugging info in default format
-cTo compile and assemble but not link
-WallTo enable most warning messages ...