Cross Compilations249
8.4.2In-circuit emulators
In-circuit emulators are devices that are used to emulate a CPU. You can plug in this
device in place of a CPU on your circuit board. The device has the same number of pins and the
same package type as the CPU and fits into the CPU socket. The other side is connected to a PC
or a workstation where a debugger is running. Using an in-circuit emulator, you can start and
stop execution of a program as you wish. This is in contrast to a software emulator, where the
CPU emulator is a program running on your machine, isolated from the circuit board on which
you want to test your software. An in-circuit emulator provides you access to real hardware for
testing purpose.
Usual arrangement of in-circuit emulator is shown in Figure 8-2. The emulator is plugged
into the actual embedded system on one side and connected to your PC on the other side.
8.4.3Introduction to JTAG and BDM
JTAG or Joint Test Action Group is a method of accessing memory and CPU resources
without having an application running on the target. BDM or background debugging mode also
achieves this objective. Many CPUs provide JTAG or BDM port/connection to connect a serial
or parallel port on your host to the target CPU board using a cable. There are a few open source
projects that give you information, utilities and hardware diagrams about the procedure.
Using JTAG or BDM, you don’t need an in-circuit emulator and a debugger running on
your host machine can connect to a target board. But keep in mind that not all CPUs provide this
facility. Most Motorola controllers and PowerPC CPUs have this interface.
Target Device
In-circuit
emulator
hardware
Host workstation
Figure8-2 In-circuit emulator connection diagram.