Programming Embedded Systems: With C and GNU Development Tools
Format: PDF / Kindle (mobi) / ePub
If you have programming experience and a familiarity with C--the dominant language in embedded systems--Programming Embedded Systems, Second Edition is exactly what you need to get started with embedded software. This software is ubiquitous, hidden away inside our watches, DVD players, mobile phones, anti-lock brakes, and even a few toasters. The military uses embedded software to guide missiles, detect enemy aircraft, and pilot UAVs. Communication satellites, deep-space probes, and many medical instruments would have been nearly impossible to create without embedded software.
The first edition of Programming Embedded Systems taught the subject to tens of thousands ofpeople around the world and is now considered the bible of embedded programming. This second edition has been updated to cover all the latest hardware designs and development methodologies.
The techniques and code examples presented here are directly applicable to real-world embedded software projects of all sorts. Examples use the free GNU software programming tools, the eCos and Linux operating systems, and a low-cost hardware platform specially developed for this book. If you obtain these tools along withProgramming Embedded Systems, Second Edition, you'll have a full environment for exploring embedded systems in depth. But even if you work with different hardware and software, the principles covered in this bookapply.
Whether you are new to embedded systems or have done embedded work before, you'll benefit from the topics in this book, which include:
- How building and loading programs differ from desktop or servercomputers
- Basic debugging techniques--a critical skill when working withminimally endowed embedded systems
- Handling different types of memory
- Interrupts, and the monitoring and control of on-chip and externalperipherals
- Determining whether you have real-time requirements, and whetheryour operating system and application can meet those requirements
- Task synchronization with real-time operating systems and embeddedLinux
- Optimizing embedded software for size, speed, and power consumption
- Working examples for eCos and embedded Linux
So whether you're writing your first embedded program, designing thelatest generation of hand-held whatchamacalits, or managing the peoplewho do, this book is for you. Programming EmbeddedSystems will help you develop the knowledge and skills youneed to achieve proficiency with embedded software.
Praise for the first edition:
"This lively and readable book is the perfect introduction for those venturing into embedded systems software development for the first time. It provides in one place all the important topics necessary to orient programmers to the embedded development process.
--Lindsey Vereen, Editor-in-Chief, Embedded Systems Programming
the processor; and the TX1 off-page connector indicates that this signal is an output from the processor. Another helpful idea is to add a little text note next to each off-page connector with the page number(s) where that particular net is used. This might not make sense for a 5-page schematic, but flipping through 20 pages of schematics can be a nightmare. Additional tips can be found in the December 2002 Embedded Systems Programming* article “Design for Debugability,” which can be found online
compiler (gcc) and assembler (as) can be configured as either native compilers or cross-compilers. These tools support an impressive set of host-target combinations. The gcc compiler will run on all common PC and Mac operating systems. The target processor support is extensive, including AVR, Intel x86, MIPS, PowerPC, ARM, and SPARC. Additional information about gcc can be found online at http://gcc.gnu.org. Regardless of the input language (C, C++, assembly, or any other), the output of the
project. Preface | xix From Anthony Massa This is my second adventure in the realm of book writing. I thought writing a second edition would be a lot less work because most of the material was already finished. Boy, was I wrong. The second edition was as bit of a struggle and took more effort and time than I expected, but I think the book turned out better as a result. I am very thankful to our editor, Andy Oram. His feedback was fantastic, he was a guiding light to push the book to
The test * will find single-bit address failures such as stuck * high, stuck low, and shorted pins. The base address * and size of the region are selected by the caller. * * Notes: For best results, the selected base address should * have enough LSB 0's to guarantee single address bit * changes. For example, to test a 64 KB region, select * a base address on a 64 KB boundary. Also, the number * of bytes must describe a power-of-two region size. * * Returns: 0 if the test fails. The failure
0; } The main program would then regularly check whether any global flag is set, perform the necessary action, and reset the flag. As discussed earlier in this chapter, care must be taken to avoid a race condition since the global flags are shared between the ISR and the main program. Avoid race conditions A lot of forethought must go into designing your software if the embedded system you are working on uses interrupts. The communication mechanisms between the main program and the interrupt