Cover | Table of Contents | Index | Colophon
Index
[ Symbols ], [ Numbers ], [ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ],
Symbols[ Top ]
# (number sign) shell prompt, 62
$( ) variable syntax in makefiles, 67
& (AND) operator, 124
clearing bits, 125
testing bits, 124
using with struct overlay, 130
/ (slash), active low signals, 26
<< (left shift) operator, 124, 126
>> (right shift) operator, 124, 126
\ (backslash), line continuation in makefiles, 68
^ (XOR) operator, 124
toggling bits, 125
using with struct overlay, 130
_ (underscore), linker commands beginning with, 61
| (OR) operator, 124
setting bits, 125
using with struct overlay, 130
~ (tilde)
active low signals, 26
bitwise NOT operator, 124
NOT operator
clearing bits, 125
using with struct overlay, 130
Numbers[ Top ]
80x86 processor family (Intel), 35
A[ Top ]
acknowledging an interrupt, 147, 150
eCos ISR, 216
example, 152
timer interrupt, 160
active high signals, 26
active low signals, 26, 30
Ada, 14
address bus, 29
signals, 30
testing, 108-110
address bus net, 26
address decoder, 29
Address Resolution Protocol (ARP), 246
address spaces, 28
PXA255 processor on-chip peripherals, 36
addresses, assignment with GNU linker tool, 59
alarms, 191
alternate-function pins, 47
analog circuits, 239
controlling digitally, 240
analog signals, converting digital signals to, 242
APIs (application programming interfaces)
eCos operating system, 199
additional information about, 213
operating systems, differences in, 186
serial device driver (example), 137
application-specific integrated circuits (ASICs), 38
Arcom board
contact information, 265
debug monitor (RedBoot), 60, 72
debugging using gdb, 78
embedded Linux, 219
interrupt map (partial), 149
memory map (example), 31
print server device, 20
PXA255 XScale processor, 36
reference, 263-265
VIPER-Lite development board, 17
build process, 61
ARM processors, 36
interrupt and exception priorities, 144
interrupt vector table, 148
reset address and reset code, 75
Windows version of ARM-based GNU tools, 268
ARP (Address Resolution Protocol), 246
ASICs (application-specific integrated circuits), 38
assemblers, 56
assembly language, 14
global interrupts, enabling/disabling, 148
I/O space register access, 48
improving software efficiency, 250
memory tests, 113
reset code, 39
startup code, 58
task context switches, 181
asynchronous events, 133, 143
atomic execution, 154
automatic variables, 41
automotive embedded systems, 2
B[ Top ]
bash shell, 62
BDM (background debug mode), 85
BGA (ball grid array), 27
bidirectional signals, 27
big-endian, 99
binary utilities (binutils) package, 64, 272
size utility, 66
bit banging, 235
bit manipulation
bitfields, 127
bitmasks, 126
bitfields vs., 128
macro, 127
clearing bits, 125
setting bits, 125
shifting bits, 126
testing bits, 124
toggling bits, 125
bitwise operators, 124
using with bitmasks, 126
using with struct overlay for peripheral registers, 130
Blinking LED program (example), 44-51
build process, 61-66
compiling, 62
formatting output file, 64
linking and locating, 63
makefile, using, 67
delay_ms function, 50
downloading, 70-76
ledInit function, 46-49
ledToggle function, 50
linker script, 60
using hardware timer for LED blinks, 155-161
blocking, 181
boards
basic questions about, 20
(see also Arcom board)
bootloader, 72
BOOTP (Bootstrap Protocol), 246
breakpoints
hardware and software, support by emulators, 85
removing with gdb, 84
setting with gdb debugger, 80
build process, 54
automating with makefiles, 66-69
Blinking LED program, 61-66
compiling, 62
formatting output file, 64
linking and locating, 63
compiling, 56
linking object files, 57-59
locating, 59
burner, 75
bus nets, 26
off-page connectors, 27
buses
I2C (Inter-Integrated Circuit), 233
timing diagrams, 30
buttons, debouncing, 208, 213, 226
byte-oriented communication, 78
C[ Top ]
C language, 13, 14
bitwise operators, 124
compiling Blinking LED program source files with gcc, 62
fixed-size integer data types, ISO standard, 16
header files
memory map for Arcom board, 32
PXA255 processor registers, 37
header files for boards, 31
stack used by programs, 59
standard library for use in embedded systems, 58
startup code for programs, 59
struct overlays on peripheral registers, 129
wrapper functions for I/O space register access, 48
C++, 14, 15
performance penalty, limiting, 259-261
cable modem routers and firewalls, 243
cache, enabling to avoid external memory accesses, 259
capacitors, values for, 24
central processing unit (see CPU)
C-front compiler, 260
checksums, 114
chip-select signals, 29
PXA255 processor, 40
CKEN (Clock Enable Register), 259
classes, C++, 260
CLK (clock signal), 30
clock stretching, 233
clocks
reducing frequency to conserve power, 258
used for timers, 156
code
efficient, 11
example code for this book, 270
optimizing
decreasing code size, 252-254
increasing efficiency, 249-252
portability or reuse, 12
robust, 12
coding guidelines/standards, 15
COFF (Common Object File Format), 56
command shell, 62
command-line interface (CLI), 71
communicating with RedBoot CLI, 72
gdb (GNU debugger), 78, 84
Monitor and Control program (example), 165, 167-172
commands
linker, beginning with underscore (_), 61
RedBoot, 73
FIS, 76
Common Object File Format (COFF), 56
compilers
C++, 260
C99-compliant, 17
integer size, choosing, 16
object file formats, 56
optimization
debugging and, 83
problems with, 254
purpose of, 56
compiling, 56
Blinking LED program, 62
Complex Programmable Logic Devices (CPLDs), 237
component type (IC symbols), 24
Concurrent Versions System (CVS), 91
condition variables, 191, 231
connectors
net, 27
off-page, 27
constructors (C++), 261
context
processor, 150
saving and restoring, 160, 216
task, 182
context switches, 181, 193
control bus, 29
control registers, 122
bit manipulation, 124-128
memory-mapped, 123
struct overlays, 129
cooperative multitasking, 174
costs (see development cost; production cost)
counters, 191
timers vs., 156
CPLDs (Complex Programmable Logic Devices), 237
CPU (central processing unit), 35
CPU_RESET off-page connector, 27
CRCs (cyclic redundancy checks), 116-118
critical sections, 154
disabling interrupts for, 193
protecting with mutexes without disabling interrupts, 187
cross-compiler, 56
object file output, 56
cross-platform debugging, 77
CVS (Concurrent Versions System), 91
cyclic redundancy checks (CRCs), 116-118
Cygwin, setting up, 267
D[ Top ]
data bus, 29
signals, 30
testing, 106
data bus net, 26
data flow through system, 20
databooks, processor, 34
DataDisplay Debugger, 78
datasheets, hardware components, 22
dead code elimination, 254
deadlines, 192
deadlock, 188
debouncing buttons and switches, 208, 213, 226
debug monitors, 60, 71-74, 77
disadvantages to using, 78
RedBoot, 72-74
ROM emulators vs., 85
debugging, 77-92
compiler optimization and, 83
digging into the hardware, 92
emulators, using, 84
hardware, 87-91
optimized programs, 255
remote debuggers, using, 77-84
simulators, using, 86
software executing from flash memory or ROM, 76
version control, 91
debugging tools, 12
default parameter values (C++), 261
deferred service routine (see DSR)
delay_ms function, 50
measuring length of time spent in, 89
dereferencing memory, 256
design requirements, 7
embedded design examples, 8-11
digital watch, 9
Mars rover, 10
video game player, 9
range of values for embedded systems, 8
destructors (C++), 261
deterministic operating systems, 193
developers, embedded software, 11-13
development cost, 7
digital watches, 9
video game players, 9
development tools, 12
GNU, 55
setting up, 266-270
device drivers, 5, 39, 130-141
design philosophy, 130-133
benefits of good design, 131
hiding hardware specifics, 132
designing, 140
embedded system vs. PC counterparts, 131
Monitor and Control program (example), 165
serial device driver (example), 133-140
API, 137
extending functionality, 139
initialization routine, 136
register interface, 135
state variables, 135
testing, 138
device programmer, 75, 96
device registers
memory-mapped, pointers to, 254
ordinary variables in local memory vs., 123
DHCP (Dynamic Host Configuration Protocol), 246
digital signal processors (DSPs), 36
bootloader program, 72
digital signals, 240
digital watches, 9
disabling interrupts, 191, 193
display driver, 44
divisor, 116
DMA (direct memory access), 98
channels, 36
using DMA controller to conserve power, 258
DNS (Domain Name System), 247
downloading embedded software, 70-76
debug monitor, using, 71-74
remote debuggers, using, 77-84
into ROM, 75
DRAM (Dynamic RAM), 94
DRAM controllers, 94, 95
DSPs (digital signal processors), 36
bootloader program, 72
DSR (deferred service routine), 150, 192
eCos interrupt handling, 213-218
dual line bus, 30
Duff's device, 252
duty cycles, 240
simple PWM circuit, 241
Dynamic Host Configuration Protocol (DHCP), 246
dynamic schedulers, 183
E[ Top ]
earliest-deadline-first scheduler, 175
eCos operating system, 198-218
APIs
additional information about, 213
POSIX, 199
interrupt handling, 213-218
message passing, 210-213
networking support modules, 247
resources for further information, 199
setting up development environment, 274-276
task mechanics, 199-202
tasks
mutex synchronization, 202-205
semaphore synchronization, 205-209
edge-sensitive interrupts, 146
EEPROM, 96, 255
memory tests on, 102
efficiency of code, 11
increasing, 249-252
electrical wiring causing memory problems, 103
ELF (Executable and Linkable Format), 56
converting to Intel Hex Format file, 65
embedded applications
Monitor and Control (example), 164-172
command-line interface, 167-172
serial ports, 166
embedded C++ standard, 260
embedded programming, 43-52
"Hello, World!" (example), 43
Blinking LED program (example), 44-51
delay_ms function, 50
ledInit function, 46-49
ledToggle function, 50
infinite loops, 51
embedded systems
common components, 4
defined, 1
design requirements, 6
history and future developments, 2
software layers, 132
Embedded Systems Design
"Design for Debugability", 27
"Introduction to In-Circuit Emulators", 85
"My Favorite Software Debouncers", 208
"Selecting a Real-Time Operating System", 197
Embedded Systems Programming (see Embedded Systems Design)
emulators
JTAG, 85
memory test, running from, 114
ROM, 85
endianness, 98-102
in devices, 99
in networking, 100
preprocessor macros solution, 101
entry point of program, 74
EPROM (erasable-and-programmable ROM), 96
errata documents for devices, 23
event flags, 191
exceptions, 143
priorities on the ARM processor, 144
Executable and Linkable Format (ELF), 56
converting to Intel Hex Format file, 65
executable binary image
conversion of relocatable program to, 59
converting embedded software source code to, 54
executable binary image (continued)
downloading
into ROM, 75
remote debuggers, using, 77-84
downloading to embedded system, 70-76
formatting for Blinking LED program, 64
generating with make utility, 68
size, finding, 66
external memory, reducing access to, 259
external peripherals, 38, 122
F[ Top ]
FAT (File Allocation Table) filesystem, 121
FFUART (Full Function UART), 134
Field Programmable Gate Array (FPGA), 238
FIFO (first-in-first-out) scheduling algorithm, 174
filesystem, creating with flash memory, 121
firmware, 11
FIS (Flash Image System), 76
fixed width integers, 16
fixed-point arithmetic, 251
fixed-priority scheduling, limitations of, 183
flash memory, 76, 97, 118-121
creating filesystem with, 121
device driver, 131
flash drivers, 120
issues to consider in field updates, 118
storing fixed data, 255
testing, 102
working with, 119
floating pin, 41
floating-point arithmetic, 251
flow of data through the system, 20
Forth, 14
FPGA (Field Programmable Gate Array), 238
Full Function UART (FFUART), 134
full-duplex mode
serial interface, 233
SPI, 236
functions
checking execution with gdb, 83
debug symbols for, 82
inline, 249
symbol table in object file, 57
unresolved references in object files, 58
G[ Top ]
GAL (Generic Array Logic), 237
game players, video, 9
Ganssle, Jack, 15
gcc (GNU C compiler), 17, 56
_ _attribute_ _ keyword, 151
compiler command for Blinking LED program, 62
invoking the linker indirectly, 68
linking object files, 65
optimization, 83
optimization options, 254
setting up, 272
web site, 56, 62
gdb (GNU debugger), 78-84
breakpoints
removing, 84
changing symbol value with print command, 81
checking symbol values, 81
checking which functions have executed, 83
commands, information about, 84
connection problems, 79
processor register values, viewing and printing, 83
setting up, 273
single-stepping source code, 82
symbol value lookup using memory map, 82
general-purpose computers, 1
interfaces to embedded systems, 2
general-purpose pins, 47
I/O pins, PXA255 processor, 48
generator polynomial, 116
Generic Array Logic (GAL), 237
global interrupt enable/disable bit, 147
global variables, 251
declaring with volatile keyword, 254
GNU tools, 17, 55
binutils package, web site information, 66
C compiler (see gcc)
debugger (see gdb)
libgloss package, 59
linker (ld), 57
address assignment, 59
linker and locator command, 63
linker scripts, 61
make utility, 66-69
objcopy, 65
size utility (binutils package), 66
software development, setting up, 266-270
example code installation, 270
Linux, 268
Windows host installation, 267-268
software tools, building, 271-273
strip, 64
GoAhead WebServer, 247
goto statements, 253
GPIO Pin Level Register (GPLR), 50
GPIO Pin Output Clear Register (GPCR), 50
GPIO Pin Output Set Register (GPSR), 50
GPIO pins, PXA255 processor, 46
GPIO registers, PXA255 processor, 47
ground, symbols for, 23
H[ Top ]
half-duplex mode (serial interface), 233
hand-coded assembly, 250
hard real-time system, 3
hardware, 4, 19-42, 92
breakpoints, 85
data flow through the system, 20
datasheets for components, 22
debugging tools, 87-91
design requirements, 6
electrical wiring problems, 103
embedded design examples, 8-11
digital watch, 9
Mars rover, 10
video game player, 9
embedded platform, 15
embedded software development and, 11
embedded system components, 4
errata documents for devices, 23
external peripherals, 38
general operation of the system, 19-21
hiding with device drivers, 131
initializing, 39-42
processor environment and peripherals, 40
reset code, 39
startup code, 41
troubleshooting, 41
Linux, accessing, 220
memory map, 29-32
processor communication with peripherals, 32
processors, 28
schematics, 21
fundamentals, 23-28
tracking state of, 135
verification using simulator, 87
hardware abstraction, 130
header files for boards, 31
headers, object file, 56
heap size, limiting, 256
"Hello, World!" program (example), 43
host computer, 54
compilers, 56
host to network long macro, 101
host to network short macro, 101
HTML for devices with web-based management, 243
HTTP (Hypertext Transfer Protocol), 246
hybrid memory devices, 96, 255
summary of, 97
HyperTerminal, 72
I[ Top ]
I/O space, 28
register access, 48
I2C (Inter-Integrated Circuit bus), 233
ICE (in-circuit emulator), 12, 84
ICMP (Internet Control Message Protocol), 246
ICMR (Interrupt Controller Mask Register), 147, 159
ICs (integrated circuits), 2
application-specific (ASICs), 38
conserving power used, 256
identifying particular pins on, 90
schematic representations, 24
idle mode, 258
idle task, 182
IGMP (Internet Group Management Protocol), 246
IM (Interrupt Mask), 147
improperly inserted memory chips, 105
in-circuit emulator (ICE), 12, 84
increment test, 110
inductor-capacitor (LC), 242
inductors, values for, 24
infinite loops, role of, 51
initializing
DRAM controller, 95
serial device driver (example), 136
timers, 159
(see also hardware, initializing)
inline functions, 249
input and output, 5
digital watches, 9
I/O pins of embedded processors, 47
I/O signals, using for debugging and performance measurement, 88
input pin on processor in unknown state, 41
memory-mapped I/O, 28
output devices, 43
signals, 27
Insight GUI, 78
integers
endianness, 98
size of, 16
integrated circuits (see ICs)
integration, 71
Intel Hex Format file, 65
Intel processors
80x86 family, 35
address spaces, 28
PXA255 XScale, sold to Marvell Technology Group, 17
Inter-Integrated Circuit (I2C) bus, 233
internal peripherals, 122
International Organization for Standardization (ISO) C standard (C99), 16
Internet Control Message Protocol (ICMP), 246
interrupt controller, 144
configuring for timer, 159
Interrupt Controller Mask Register (ICMR), 147, 159
interrupt handlers (see ISRs)
interrupt keyword, 150
interrupt nesting, 145
interrupt service routines (see ISRs)
interrupt vector table, 148
interrupts, 33, 134, 142-163
device drivers, priority levels for, 140
disabling, 193
edge-sensitive, 146
enabling and disabling, 147
handling
eCos operating system, 213-218
embedded systems using operating system, 191
Linux operating system, 231
implementing for UARTs, 140
improved Blinking LED program, 155-161
ISRs (interrupt service routines), 150-155
latency, 193
level- and edge-sensitive, 146
mapping source to ISR function, 148-150
overview, 142
priorities, determining, 144
processor databook information, 34
related events and, 143
summary of key points, 161-163
(see also ISRs)
ISO (International Organization for Standardization) C standard (C99), 16
ISRs (interrupt service routines), 33, 133, 150-155, 192
actions performed by, 150
determining source of interrupts, 151, 152
eCos interrupt handling, 213-218
mapping between interrupt sources and ISR functions, 148-150
operating system interrupt stacks, 256
shared data and race conditions, 153-155
timer, 160
using polling instead of, 251
J[ Top ]
JTAG debuggers, 85
jumpers, schematic reference designator, 27
junctions, 26
K[ Top ]
kernel, 174
Linux, 219
L[ Top ]
last-in-first-out (LIFO), 41
latency (interrupts), 152, 191, 193
laxity, 176
LC (inductor-capacitor), 242
ld (linker) tool, 57
address assignment, 59
invoking directly or indirectly in makefile, 68
linker and locator command, 63
multilibs, specifying, 65
ledInit function, 46-49
LEDs (light emitting diodes), 23
debugging with, 88
(see also Blinking LED program)
ledToggle function, 50
level-sensitive interrupts, 146
libgloss package (GNU), 59
libraries
avoiding standard routines to decrease code size, 253
multilibs, linking via gcc, 65
standard C library for use in embedded systems, 58
lifetime of system, 8
LIFO (last-in-first-out), 41
light emitting diodes (see LEDs)
lightweight IP (lwIP), 246
linker script, 60, 64
GNU linker script files, web site, 61
viperlite.ld file, 63
linker tool (see ld tool)
linking object files, 57-59
Blinking LED program, 63
gcc compiler, using, 65
make utility, using, 68
startup code, 58
lint program, 90
Linux systems
choosing to use with embedded systems, 198
command shell, 62
embedded development environment, setting up, 277-283
embedded examples, 219-231
accessing Linux hardware, 220
GNU software development tools, 268
message passing, 227-231
minicom (terminal program), 72
network support, 247
resources for further information, 231
tasks
mechanics of, 220-222
mutex synchronization, 222
semaphore synchronization, 224-227
little-endian, 99
local variables, 41
locating object files
Blinking LED program, 63
make utility, using, 68
locators, 59
locking the scheduler, 179
locks (Linux), 231
logic analyzers, 87
logical devices, 133
loop unrolling, 252
lwIP (lightweight IP), 246
M[ Top ]
mailbox, 190
main program, 41
Blinking LED program using a timer, 157
race conditions with ISR for shared resource, 155
make utility, 66-69
build targets, 68, 69
resources for further information, 69
makefiles, 66-69
build rule, basic layout, 67
building Blinking LED program, 67
executing build instructions, 69
keeping updated, 69
variables, 67
malloc function, 256
map files, 64
program entry point, 74
maps, interrupt, 148-150
Mars Pathfinder, 10
Mars rover, 10
maskable interrupts, 144
enabling and disabling, 147
masked ROMs, 95
master (I2C bus), 233
Master In Slave Out (MISO) signal, 236
Master Out Slave In (MOSI) signal, 236
memory, 4, 7, 93-121
basic operations performed by RedBoot debug monitor, 60
device, 111
digital watches, 9
DMA (direct memory access), 98
endian issues, 98-102
external
chip-selects for PXA255 processor, 40
reducing access to conserve power, 259
memory (continued)
flash memory, 76, 118-121
loading code with bootloader, 72
peripherals vs., 28
physical location, establishing for relocatable program sections with GNU linker, 60
processor connections, 28
reducing usage, 255
resource constraints for embedded systems, 12
test strategy, developing, 105-114
address bus test, 108-110
data bus test, 106
memory device test, 110-112
practical example, 112-114
testing, 102-105
common problems, 103
electrical wiring problems, 103
improperly inserted chips, 105
missing memory chips, 104
types of, 93
hybrid, 96
ROM, 95
validating contents, 114-118
checksums, using, 114
cyclic redundancy checks (CRCs), 116-118
video game players, 10
memory maps, 29-32
C-language header files for boards, 31
creating, 30
debug symbol values, looking up, 82
memory space, 28
PXA255 processor peripheral control registers, 48
memory-mapped I/O, 28
message passing, 190
eCos operating system, 210-213
Linux operating system, 227-231
message queue, 190
micro IP stack, 247
microcontrollers, 35
microprocessors, 2, 35
Microwire (serial interface), 234
milliwatts per MIPS (mW/MIPS), 7
minicom (terminal program), 72
minimal laxity first scheduling, 176
MIPS (millions of instructions per second), 7
MISO (Master In Slave Out) signal, 236
missing memory chips, 104
mmap function, 220
modulating frequency, PWM circuits, 241
Monitor and Control application (example), 164-172
command-line interface, 167-172
serial ports, working with, 166
MOSI (Master Out Slave In) signal, 236
Motorola SPI (serial peripheral interface), 234
multilibs, linking via gcc, 65
multitasking, 173
scheduling tasks, 174
mutexes (mutual exclusions), 187
deadlock and priority inversion, 188-190
eCos operating system, 202-205
Linux task synchronization, 222
priority inversion, 189
mW/MIPS (milliwatts per MIPS), 7
N[ Top ]
n prefix (signal names), 26
National Semiconductor, Microwire, 234
NC (no connect) pins, 26
nesting interrupts, 145, 192
net labels, 26
nets, 26
bus net, 26
off-page connectors, 27
network byte order, 100
network to host long macro, 101
network to host short macro, 101
networking
endianness, 100
support in embedded devices, 242-247
benefits of adding, 243
solutions for, 244-247
newlib package (Cygnus), 58
no connects (processor pins), 26
noise effects, minimization with PWM, 242
nonmaskable interrupts, 144, 147
NRE (nonrecurring engineering), 7
number of units, 7
NVRAM (nonvolatile RAM), 97
O[ Top ]
objcopy tool, 65
object files, 54, 56
contents, 56
copying with objcopy, 65
linking, 57-59
Blinking LED program, 63
gcc compiler, using, 65
startup code, 58
locating, 59, 63
removing sections with strip utility, 65
section sizes and total file size, listing, 66
startup code, 57
off-page connectors, 27
on-chip peripherals, 36, 122
one-time programmable (OTP) devices, 96
open processor pins, 26
open source software, 53
GNU tools, 55
open wires, 103
OpenTCP, 246
operating systems, 173-197
device drivers vs., 131
eCos
examples, 198-218
setting up development environment, 274-276
gcc compiler support, 56
history and purpose, 173
interrupt handling, 191
kernel, 174
lack of common API, 186
Linux
embedded development environment, setup, 277-283
embedded examples, 219-231
message passing, 190
network stacks, 247
real-time, 3, 6, 255
characteristics of, 192
deciding whether to use, 194
other functionality, 191
selecting, 195-197
schedulers, 174-180
locking and unlocking, 179
real-time, 175-178
scheduling points, 178
target platform for embedded software, 54
tasks, 180-185
mechanics of, 184
states of, 180
synchronization, 185-190
(see also Windows systems)
operator overloading (C++), 261
optimizations, 71, 248-261
code efficiency, increasing, 249-252
code size, decreasing, 252-254
compiler, debugging and, 83
limiting impact of C++, 259-261
power-saving, 256-259
problems with optimizing compilers, 254
reducing memory usage, 255
oscilloscopes, 87
connecting correctly, 88
LED and I/O signal, debugging with, 88
OTP (one-time programmable) devices, 96
output (see input and output)
P[ Top ]
PAL (Programmable Array Logic), 237
parameter values, default (C++), 261
Pathfinder mission (NASA), 10
peeking (reading), 72
pending interrupts, 145
performance
measurement, using I/O signal and oscilloscope, 89
real-time systems, 192
(see also optimizations)
peripherals, 122-141
bit manipulation (see bit manipulation)
common, 232-242
programmable logic, 236-239
pulse width modulation (PWM), 239-242
serial peripheral interface (SPI), 234
control and status registers, 122
bit manipulation, 124-128
memory-mapped, 122
struct overlays, 129
device drivers, 130-141
design philosophy, 130-133
designing, 140
serial device driver (example), 133-140
disabling to conserve power, 259
external, 38
peripherals (continued)
initializing, 40
interfaces, 11
memory map for Arcom board (example), 31
memory-mapped, 28
on-chip, 36
operating while processor is in idle mode, 258
processor communication with, 32
processor connections to, 28
PXA255 peripheral control registers, 48
simulators and, 86
Philips I2C specification, 233
pins, processor, 26
identifying particular pins on an IC, 90
input pin in unknown state, 41
PXA255 processor
bidirectional GPIO pins, 46
PLA (Programmable Logic Array), 237
platform, embedded system, 15
PLD (Programmable Logic Device), 237
Point to Point Protocol (PPP), 242
pointers to memory-mapped registers, 123, 254
poking (writing), 72
polling, 33, 134
UARTs and, 140
using instead of ISRs, 251
polymorphism (C++), 261
POP (Post Office Protocol), Version 3 (POP3), 246
port pins, 47
portability of code, 12
checking source code for problems, using lint, 90
POSIX (Portable Operating System Interface), 186
eCos operating system, 199
pthreads standard, Linux API, 219
power consumption, 7
power, conserving, 256-259
clock frequency, 258
processor modes, 257
reducing external memory access, 259
power, symbols for, 23
power-of-two addresses, 108
PPP (Point to Point Protocol), 242
#pragma, declaring an ISR, 151
preemption, 177
preemptive scheduling, 175
preprocessor macros for endianness issues, 101
print server, designing, 20
priority ceilings, 190
priority inheritance, 189
priority inversion, 189
priority, interrupts, 144, 191
priority-based scheduling
backup policy for tasks with same priority, 178
earliest deadline first, 175
mutex task queue, eCos system, 202
priority algorithm, 175
ready queue, 181
static priority algorithm, 176
supporting preemption, 177
task priorities, setting, 182-184
rate monotonic algorithm (RMA), 183
processing power, 7
processor context, 150
saving and restoring, 160, 216
processors, 28
address spaces, 28
bootloader program, 72
communication with peripherals, 32
control signals, other, 30
debugging software executing from flash memory or ROM, 76
digital watches, 9
emulators, using for debugging, 84
endianness, 99
gcc (GNU C compiler) support, 56
gcc compiler support, 56
integer size and, 16
learning about, 34-38
databooks, 34
development board, 35
in general, 35
Internet information, 34
PXA255 XScale, 36
machine language, 56
Mars Pathfinder, 10
memory map, 29-32
memory requirements and, 7
operating modes to conserve power, 257
register values, viewing and printing with gdb, 83
reset rules, 75
schematic representations, 26
simulators, 86
startup code, 59
video game players, 9
XScale ARM, 17
production cost, 7
digital watches, 9
video game players, 9
profilers, 249
profiling, 71
programmable logic, 236-239
CPLDs (Complex PLDs), 237
Field Programmable Gate Array (FPGA), 238
Generic Array Logic (GAL), 237
Programmable Array Logic (PAL), 237
Programmable Logic Array (PLA), 237
Programmable Logic Device (PLD), 237
programmable ROM (PROM), 96
programming languages
C, 13
choosing for this book, 14
embedded (other than C), 14
for PLD hardware designs, 237
(see also assembly language; C language)
project notebook, 20
PROM (programmable ROM), 96
prompts, shell and RedBoot, 62
protocols, networking, 243
common components of networking stacks, 244
support by network stacks, 246
pthreads, 219
public and private keywords (C++), 260
PWM (pulse width modulation), 239-242
advantages of, 242
applications of, 242
digitally encoding analog signal levels, 240
PWM signals with varying duty cycles, 240
simple circuit (example), 241
PXA255 processor
decreasing power consumption, 257
DRAM controller, on-chip, 95
GPDR0 register, 47
GPIO registers, 47
I2C bus interface unit, 233
interrupts supported, 144
operating modes, 257
reset address, 40
timers, 156
timing diagram examples, 30
UART, 134
PXA255 XScale ARM processor, 17, 36
Q[ Top ]
queues, ready and waiting tasks, 181
R[ Top ]
race conditions, 153-155
RAM (random access memory), 4, 93
Arcom board block diagram (example), 31
decreasing use of, 255
execution speed of code, 72
hardware initialization and, 41
hybrid memory devices, 96
testing, 102
rate monotonic algorithm (RMA), 183
RC (resistor-capacitor), 242
read and write signals, 29
reader-writer locks (Linux), 231
read-only memory (see ROM)
ready state (tasks), 180
idle task, 182
real-time executive scheduler, 175
real-time operating system (see RTOS)
real-time systems, 3
real-time tracing, 85
RedBoot, 60, 72-74
commands, 73
downloading executable binary image, 73
gdb-compatible debug monitor, 78
initialization message, 73
managing ROM, 76
networking support, 74
prompt (RedBoot>), 62
running programs, 74
RedHat Embedded Debug and Bootstrap program (see RedBoot)
reference designators, 23
connectors and jumpers, 27
ICs (integrated circuits), 24
test points, 27
references, unresolved, 57
register variables, 250
register width (processors), 7
registers
ICMR (Interrupt Controller Mask Register), 147
interface, serial port device driver (example), 135
memory-mapped, pointers to, 254
write-only, 129
reliability, 8
Mars rover, 10
relocatable program, 54, 58
conversion to executable binary image, 59
remainder, 116
remote debuggers, 77-84
use by emulators, 84
Remote Serial Protocol, 78
reserved bits, processor registers, 48
reset address, 75
reset address or reset vector, 39
reset code, 39, 75
resistor-capacitor (RC), 242
resistors, values for, 24
resource constraints, 12
resource reservation scheduling, 176
resources
considerations in device driver design, 141
shared between tasks in operating system, 187
shared, causing race conditions between ISR and main program, 155
reusable code, 12
Revision Control System (RCS), 91
RMA (rate monotonic algorithm), 183
robust code, 12
ROM (read-only memory), 4, 93
Arcom board block diagram (example), 31
downloading embedded software into, 75
managing ROM with RedBoot, 76
emulators, 85
execution speed of code, 72
hardware initialization and, 41
hybrid memory devices, 96
moving constant data into, 255
ROM monitors (see debug monitors; RedBoot)
types of, 95
round robin scheduling, 175, 186
tasks with same priority, 178
RTOS (real-time operating systems), 6, 173, 255
APIs, 186
characteristics of, 192
critical sections and, 155
deciding whether to use, 194
eCos examples, 198-218
locking and unlocking the scheduler, 179
other functionality, 191
scheduling tasks, 175-178
priority-based, 177
selecting, 195-197
resources for information, 197
running state (tasks), 180
S[ Top ]
Samek, Miro, 15
sampling intervals for debounce code, 213
schedulers, 174-180
common scheduling algorithms, 174
locking and unlocking, 179
promoting task to running state, 181
real-time, 175-178
priority-based, 177
scheduling points, 178
scheduling points, 178
schematics, 21
fundamentals of, 23-28
IC representations, 24
off-page connectors, 27
partial schematic (example), 25
reference designators, 23
symbols for ground and power, 23
test points, 27
title blocks, 28
values for components, 24
SCLK (serial clock) signal, 233, 236
SDA (serial data) signal, 233
semaphores, 187
eCos operating system, 205-209
signaling to toggle LED, 214
Linux task synchronization, 224-227
serial buses, asynchronous or synchronous connections, 232
serial clock (SCLK) signal, 233, 236
serial data (SDA) signal, 233
serial device driver (example), 133-140
API, 137
extending functionality, 139
initialization routine, 136
register interface, 135
state variables, 135
testing, 138
serial interface
bit banging, 235
Serial Line Interface Protocol (SLIP), 242
serial peripheral interface (SPI), 234
bus structure, 235
serial ports
device driver (example), block diagram of serial port, 134
working with, 166
shared data, race conditions and, 153-155
shells, 62
shortest job first scheduling, 174
shorting in electrical wiring, 103
signaling tasks (interrupts), 192
signals
address bus, 30
analog, 239
chip-select, 29
clock (CLK), 30
control bus, 29
data bus, 30
digital, 240
digital signal processors (DSPs), 36
I/O, using for debugging and performance measurement, 88
interrupt, level- and edge-sensitive, 146
logic levels, activation/deactivation, 26
related, schematic representation as bus net, 26
SPI (serial peripheral interface), 236
timing diagram, 29
timing requirements, 29
types, representation by off-page connectors, 27
Simple Mail Transfer Protocol (SMTP), 246
Simple Network Management Protocol), 245
simulators, 86
hardware verification, 87
single-stepping, 82
size utility, 66
Slave Select (SS1 and SS2) signals, 236
slaves I2C bus, 233
SMP (symmetric multiprocessing) systems, 191
SMSC Ethernet controller, 31
SMTP (Simple Mail Transfer Protocol), 246
SNMP (Simple Network Management Protocol), 245
soft real-time system, 3
software
GNU development tools, setting up, 266-270
GNU tools, building, 271-273
layers for an embedded system, 132
tasks (see tasks)
software, embedded, 5
developers, requirements of, 11-13
development cycle, 70
source code
checking for portability problems, using lint, 90
embedded software, converting to executable binary image, 54
stepping through lines, 82
version control, 91
SPI (serial peripheral interface), 234
bus structure, 235
spinlocks, 191
Splint program, 91
SRAM (Static RAM), 94
SS1 and SS2 (Slave Select) signals, 236
stacks, 59
endianness, 100
interrupt, 192
memory testing and, 113
network
common network protocol components, 244
in operating systems, 247
included on RedBoot, 74
lwIP (lightweight IP), 246
open source solutions, 246
resource requirements, 243
selecting for your device, 244
TinyTCP, 246
setting up, 41
size reductions, 255
standard library routines, 253
startup code, 41, 57, 58
for C programs, 59
hardware initialization and, 39
object file order and, 64
startup.asm, crt0.s file, 59
static priority scheduling algorithm, 176
RMA (rate monotonic algorithm), 183
status registers, 122
bit manipulation, 124-128
memory-mapped, 123
struct overlays, 129
stdint.h header file, 16
strip utility, 64
structs
bitfields, 127
overlay for UART registers, 135
overlays on peripheral registers, 129
address offsets, 130
Subversion, 91
switch statement, 249
inline replacement for, 250
switches, debouncing, 208, 213, 226
symbol tables (in object files), 57
symbols
changing value with gdb print command, 81
checking values with remote debugger, 81
debug, using memory map for lookup, 82
for ground and power, 23
stripping from object file, 65
unresolved, 57
symmetric multiprocessing (SMP) systems, 191
synchronization (tasks), 185-190
mutexes, 187
deadlock and priority inversion, 188-190
eCos operating system, 202-205
Linux operating system, 222
semaphores, 187
eCos operating system, 205-209
synchronous events, 143
T[ Top ]
table lookups, 249
target platform, 54
gcc compiler support, 56
task control blocks, 182
tasks, 173, 180-185
context, 182
context switches, 193
mechanics of, 184
eCos operating system, 199-202
Linux operating system, 220-222
passing data between, 190, 210-213
Linux operating system, 227-231
priorities, 182-184
rate monotonic algorithm (RMA), 183
schedulers, 174-180
locking and unlocking, 179
real-time, 175-178
scheduling points, 178
states, 180
context switch, 181
idle task, 182
synchronization, 185-190
eCos mutexes, 202-205
eCos semaphores, 205-209
Linux mutexes, 222
Linux semaphores, 224-227
mutexes and semaphores, 187-190
TCP/IP protocols, 243
endianness, 100
lwIP (lightweight IP) stack, 246
OpenTCP, 246
uC/IP stack, 247
uIP stack, 247
Telnet, 247
terminal programs, 72
test points, 27
TFTP (Trivial File Transfer Protocol), 74, 246
threads
Linux model, 219
(see also tasks)
time slice, 175
timers, 155-161
eCos interrupt handling, 214-218
how they work, 156
calculating interrupt interval, 158
clearing pending interrupts, 158
enabling timer interrupts, 159
initializing the timer, 159
PXA255 processor, 156
setting up timer for PXA255 processor, 159
sharing among tasks, 162
watchdog, 157
timing diagrams, 29
PXA255 processor, 30
timing requirements, 29
TinyTCP network stack, 246
title block (schematics), 28
tracing, real-time, 85
trampoline, 148
Transistor-Transistor-Logic (TTL), 237
traps, 34, 143
tristate bus, 30
Trivial File Transfer Protocol (TFTP), 74, 246
troubleshooting
processor-based boards, 39
watchdog timers, 157
TX1 off-page connector, 27
typedefs, fixed-size integers types, 16
U[ Top ]
UARTs, 133
SLIP or PPP protocols for network interface, 242
uC/IP network stack, 247
UDP (User Datagram Protocol), 243, 246
uIP network stack, 247
units, number of, 7
Universal Asynchronous Receiver Transmitter (see UARTs)
unlocking the scheduler, 179
unmanned spacecrafts (Mars rovers), 10
unsigned integers, pointers to registers, 124
User Datagram Protocol (UDP), 243, 246
user tasks, 182
utilization (tasks), 176
schedulability of fixed-priority tasks, 183
V[ Top ]
variables
condition variables (Linux), 231
debug symbols for, 82
device driver, tracking state of devices, 132
global, 251
makefile, 67
pointers to peripheral registers, 123
register, 250
size of, 251
state variables for hardware, 135
symbol table in object files, 57
VCC and VDD reference designators, 23
vector table, interrupts, 148
version control, 91
video game players, 9
VIPER-Lite board, 17
development kit, 263-265
(see also Arcom board)
virtual functions (C++), 261
volatile keyword, 123
declaring memory-mapped register pointers and global variables, 254
voltage levels, circuits, 23
analog circuits, 239
volume, product, 7
W[ Top ]
waiting state (tasks), 180
walking 1's test, 106
watchdog timers, 157
web browsers, configuration and control of systems using TCP/IP, 243
web page for this book, xviii
web-based management, 243
advantages of, 245
GoAhead WebServer, 247
Windows systems
Cygwin bash shell, 62
GNU software development tools
host installation, 267-268
source code, 266
HyperTerminal, 72
worst-case performance, 192
write signals, 29
X[ Top ]
xmodem protocol, 73
XScale ARM processor, 17
Return to Programming Embedded Systems
