Embedded Systems Firmware Demystified

The last chapter presented hardware design options for a typical embedded system. This chapter concentrates on how to write and build a program destined for an embedded device.
Because you will be working in a cross-development environment on potentially untested hardware, the first programs are very small, very limited test programs. Even though the first test may be trivial programs, getting them into the target is not trivial. Before you can hope to begin testing your firmware, you must:
understand the hardware environment;
make sure you have the necessary programming and debugging tools;
make sure your programming and debugging tools are compatible with the hardware environment;
perform some simple tests to verify that the hardware is working.
You ll learn more about these considerations later in this chapter. First, I ll begin with a look at the cross-platform compilation process and how the embedded systems environment differs from the conventional PC environment.
Before going any further, you should be aware that the build procedure discussed in this book does not involve any fancy graphical user interface (GUI) interface nor does it require any expensive tools. The development environment used throughout this text is the Microcross GNU X-Tools , a fully functional set of the X-Tools suite is provided on the book CD. Supplying the completed tool set should eliminate the headaches typically associated with build environment incompatibilities. The examples in this chapter use tools like gcc, objcopy, objdump, and make. You can pick your own editor. I use