You are on page 1of 5

coverstory By David Marsh, Contributing Technical Editor

Auto industry drives


embedded boundary-scan
debugging
BOUNDARY-SCAN TECHNIQUES CONTINUE
TO EVOLVE TO TACKLE THE DEVELOPMENT
AND DEBUGGING OF DEEPLY EMBEDDED
SYSTEMS. THE AUTOMOTIVE INDUSTRY’S
SPECIAL REQUIREMENTS ARE ENCOURAG-
ING MAJOR SEMICONDUCTOR AND TEST-
TOOL VENDORS TO WORK TOGETHER FOR
A NEW GLOBAL DEBUGGING STANDARD.

Photo courtesy Infineon Technologies

s EDN Europe reported in its last issue, boundary-scan tech-

At a glance ..........................23
A niques continue to develop from their original pc-board test en-
For more information ......24 vironment to meet evolving needs, such as in-system configuration
and system-on-chip testing (Reference 1). Yet another area in which
boundary-scan debugging enjoys wide- ple cores and deep on-chip memories are
spread application is the automotive in- becoming more difficult to emulate and
dustry. Today’s deeply embedded in-ve- debug, compromising the automotive in-
hicle systems frequently comprise dustry’s notoriously short design cy-
networked components, such as engine- cles—especially among the interdiscipli-
management units and active safety con- nary development teams that tackle
trols, that require increasingly capable today’s vehicle development projects. In-
processors to provide power-train su- system programmability is also critical to
pervision. Complex devices with multi- automotive development because as
22 edn europe | August 2001 www.ednmag.com
much as 70% of a vehicle’s final system- nals to serially load or unload data, to
calibration data relies on iterative in-ve- AT A GLANCE provide clock and breakpoint control,
hicle tests. and to freeze and reset the processor. A
e System-on-chip processors and today’s
Debugging embedded processors in comparable BDM implementation ap-
packages mandate on-chip debug systems.
real time traditionally requires a logic pears in later Motorola microcontrollers,
analyser with a chip-specific preproces- such as the growing 68HC12 family that
e Automotive applications demand nonin-
sor, an in-circuit emulator, or both. Such powers many automotive control units
trusive access to calibration constants.
equipment can provide a programmer’s (Figure 1). Sampling now, the latest fam-
view of chip resources and typically ily member is the MC9S12DP256; it aug-
e Motorola’s pioneering background-
comprises a general-purpose base unit ments typical microcontroller peripher-
debug-mode serves low-to-midrange
with dedicated pods that emulate the als with features such as 256 kbytes of
applications.
target processor in FPGA-based hard- flash memory and as many as five CAN
ware. But more and more, today’s (controller-area-network) interfaces.
e Today’s complex processors require
processor-clock speeds and inaccessible In the 68HC12, the BDM interface re-
parallel debugging access to track on-chip
packaging techniques limit or preclude duces to just two active pins in a six-pin
events.
external techniques. It’s also very diffi- header: the BKGD (background) serial-
cult to trace on-chip memory accesses communications line and hardware-reset
e IEEE-ISTO 5001-99 harmonises propri-
because these cycles don’t appear at the signal. The BKGD line uses a clocking
etary on-chip-debug mechanisms.
processor’s pins—although some semi- scheme that resolves bidirectional com-
conductor vendors produce special munications that are—from the proces-
bond-out versions of the target micro- 5001-99 specification for free at www. sor’s view—asynchronous from host to
controller that provide access to other- ieee-isto.org. processor and synchronous from proces-
wise hidden core nodes. Instruction sor to host. The remaining header pins
pipelines, concurrent execution, and OCD STARTS WITH A ROM MONITOR carry the supply voltages and the flash-
predictive branching provide further de- Providing further impetus for 5001-99, memory programming voltage to permit
bugging challenges. To address such proprietary OCD implementations vary in-system programming. The 68HC12’s
concerns, Motorola started adding on- enormously in their capabilities and debugging mechanisms divide into hard-
chip monitoring to its CPU32-series rarely feature common physical inter- ware and microcoded functions that lie
cores to pioneer BDM (background-de- faces. Written into the CPU32’s microc- outside of the processor core to minimise
bug mode) some 10 years ago. Other ode in chips such as the 68331, Motoro- intrusiveness. The hardware functions
semiconductor vendors have since fol- la’s original BDM emulates a traditional don’t require the processor to be running
lowed suit with proprietary on-chip ROM monitor and includes a similar BDM to allow nonintrusive access to on-
hardware, often employing the proces- command set. Debugging commands in- chip memory during normal program
sor’s IEEE 1149.1 test interface. Generi- clude read and write data, address, and operation, but the debug hardware may
cally, such OCD (on-chip-debugging) system-control registers; read and write steal processor clock cycles if the memo-
techniques link the chip’s internal re- memory or blocks of memory; flush and ry address is off-chip. The microcoded
sources with a host PC’s development refill the pipeline before resuming execu- functions require BDM to be active and
environment to make chip activity visi- tion; reset the processor’s peripherals; typically use the processor’s dead cycles to
ble and to furnish debugging controls. and call user patch-code. The original execute debugging commands, stealing
These similar proprietary OCD imple- hardware-debugging interface is via a 10- clock cycles only if no dead cycles appear
mentations are an obvious candidate for pin header that carries seven control sig- within 128 cycles of receiving a command.
a standardisation effort to rationalise the
debugging interface and promote tool- HOST (BKGD PIN) ON CHIP
16-BIT SHIFT REGISTER
chain development. Recognising this SYSTEM BACKGROUND
need, semiconductor developers Hitachi, SERIAL LINK

Infineon, and Motorola joined with au- TAGGING BUS


ENTAG INSTRUCTION ADDRESS
tomotive-tool developers Agilent ACTIVE INTERFACE
Figure 1 BDM DECODE AND
Technologies, Robert Bosch, and ACTIVE BDMACT AND CONTROL DATA
ETAS to form the Nexus 5001 Forum TRACE
EXECUTION LOGIC
TRACE CLOCKS
back in April 1998. Working under the ACTIVE
BDM
umbrella of the IEEE Industry Standards STATUS
and Technology Organisation, the Nexus REGISTER CLKSW
Forum released its first specification in SHIFT-DATA STANDARD BDM
VALID SDV FIRMWARE BDM CLOCK
September 1999. Such a standardisation ENABLE LOOK-UP TABLE SWITCH
ENBDM
pace had been hitherto unknown in tra- BDM CONTROL

ditional IEEE circles. Today, the Nexus NOTE: BDM=BACKGROUND-DEBUG MODE.


Forum’s member list reads like a global
directory of semiconductor vendors and
software-development toolmakers. You Motorola’s BDM (background-debug mode) provides full access to on-chip resources that include
can download the Forum’s IEEE-ISTO an embedded monitor via a single-wire serial link.
www.ednmag.com August 2001 | edn europe 23
coverstory Boundary-scan debugging

Microcoded functions include read and queue, the processor suspends execution bination of JTAG pins and device-pin
write the processor’s register set, execute and activates BDM. You can then execute mapping to accelerate I/O performance
a user instruction and return to BDM the instruction and observe the results. during debugging. Accordingly, the
(trace mode), enable instruction “tag- Together, the 68HC12’s debugging mech- TC1775’s debugging system illustrates
ging,”and resume normal processing.You anisms provide tools such as P&E Mi- some of the techniques that you can ex-
activate BDM by sending a debugging crosystems’ less-than-$500 development pect from 5001-99-standard-compliant
command that enables the debugging mi- environment with powerful but low-cost chips. The TC1775’s debug system com-
crocode. The processor can then enter access to the processor’s resources. Run- prises support for the main TriCore
BDM via a debug-hardware command, ning on a PC host, the P&E tool uses a processor and its peripheral-control
by encountering breakpoints, or via the parallel-port based “wiggler” to provide processor, a trace module for the TriCore
enter-background-mode instruction. the BDM interface. P&E’s tools also sup- processor, and an extended JTAG-based
When BDM mode is active, the 68HC12 port BDM-enabled Motorola targets, in- debugger interface that Infineon calls
maps its debugging-control and microc- cluding the 68HC16, 68HC3xx, Cold- Cerberus (Figure 2). The main TriCore
ode registers to the top of its 64-kbyte Fire, MCore, and PowerPC families. processor partitions debugging into
memory space. These registers reflect the event-generation mechanisms and sub-
status and type of BDM instruction that’s DEBUG-PORT REMAPPING SPEEDS I/O sequent debugging actions. The idea is to
executing and provide temporary storage As is the case for traditional RS-232 integrate a simple but powerful debug-
for data and commands. based ROM monitors, the main restric- ging system and rely upon external sup-
As for operation with a traditional em- tions on serial-debugging performance port for more complex actions. Ewald
ulator, the 68HC12’s debugging system are due to I/O bandwidth between the Liess, Infineon’s applications manager for
includes hardware-breakpoint capabili- chip and the host PC. Accelerator cards, microcontroller products, explains,“The
ties to halt instruction execution on ad- such as P&E’s Lightning adapter or Eth- driving philosophy behind the OCDS
dress or address-and-data combinations. ernet-based interfaces, such as Abatron’s support is that the complete architectur-
You can typically set breakpoints to halt debuggers, can communicate 10 times al state of the system is visible from the
the processor before or after an instruc- faster than a parallel-port-based “wig- TriCore’s FPI (flexible-peripheral-inter-
tion executes and have the breakpoint gler.”Abatron quotes maximum host-to- connect) bus.” In other words, he notes,
trigger a software interrupt or force target speeds of 2 Mbps and debug-code you can access every piece of architec-
BDM. Like most contemporary proces- loading at as fast as 320 Kbytes/sec for its tural state in the TC1775 through a map-
sors, the CPU12 core uses queued in- BDI2000 interface. This accelerated se- ping into the FPI’s address space.
struction pipelining that accelerates ex- rial throughput suits midrange debug- The TC1775’s hardware-breakpoint-
ecution speed but obscures program- ging tasks with complex processors such generation logic responds to on-chip
flow analysis. You can reconstruct pro- as Infineon Technologies’ TC1775 mi- events or to an external break command
gram flow from debugging events or, if crocontroller, but faster throughput re- from an emulator. You can set the hard-
you’re using an external logic analyser, quires additional parallel access to on- ware-breakpoint logic to trigger upon in-
monitor two dedicated device pins that chip resources. struction execution or data read/writes at
provide time-multiplexed information Currently in its first generation and an address or within an address range.
about instruction execution and data with features such as a DSP-like multi- Trigger-event-specifier registers provide
movements. But because instruction ex- plier-accumulator, a separate peripheral- combinational trigger capabilities to gen-
ecution begins before becoming visible control processor, twin-CAN communi- erate a single trigger from multiple events,
to a logic analyser or debugging envi- cation links, and direct calibration such as code- and data-space-protection
ronment, the CPU12’s designers includ- support, Infineon’s TC1775 targets auto- violations. Specifier registers within the
ed a separate tagging mechanism that motive use. The 329-pin BGA package chip’s OCDS control-register set control
tracks instruction status. When a tagged mandates the OCDS (on-chip-debug- debug actions when external and software
instruction reaches the head of the ging-support) system, which uses a com- breaks occur and, upon instruction, move

FOR MORE INFORMATION...


For more information on products such as those discussed in this article, go to our information-request page at www.edn-info.com. When you contact
any of the following manufacturers directly, please let them know you read about their products in EDN Europe.
Abatron Ashling Microsystems Infineon Technologies P&E Microcomputer Robert Bosch
www.abatronag.ch www.ashling.com www.infineon.com Systems www.bosch.de
Enter No. 442 Enter No. 445 Enter No. 448 www.pemicro.com Enter No. 451
Enter No. 450
Agilent Technologies ETAS Motorola Semiconductor Samtec
www.agilent.com www.etas.de www.mot-sps.com www.samtec.com
Enter No. 443 Enter No. 446 Enter No. 449 Enter No. 452

AMP Hitachi Semiconductor SUPER INFO NUMBER


www.amp.com www.hitachi-eu.com For more information on the products available from all of the
Enter No. 444 Enter No. 447 vendors listed in this box, Enter No. 453 at www.edn-info.com.

24 edn europe | August 2001 www.ednmag.com


between the processor’s protected core-
special-function registers and its HARDWARE
general-purpose registers. Debug Figure 2 PERIPHERAL-
BRKIN BREAK-INPUT
SYSTEM- AND -OUTPUT
CONTROL CONTROL
actions include halting execution; enter- PROCESSOR
BRKOUT SIGNALS
UNIT
ing the debug monitor; entering soft-
16 PIPELINE STATUS,
ware-debug mode; and asserting the ex- TRACE INDIRECT ADDRESS,
FLEXIBLE- TRACE PORT
ternal break pin to synchronise external PERIPHERAL- [15:0] AND BREAKPOINT-
TRICORE CONTROL 5 QUALIFIER DATA
hardware, such as an emulator. Debug- INTERCONNECT CPU
BUS
ging actions can generally occur immedi- OCDS OCDSE
ENABLE OCDS
ately before or after a trigger event. A de-
bug-status register provides overall TDI

control. TDO
IEEE 1149.1
The TC1775 augments the five 1149.1- CERBERUS AND
TMS CONTROL
JTAG
standard device pins with emulator hard- INTERFACE
SIGNALS
TCK (JTAG INTERFACE)
ware-control signals that comprise
OCDS enable, break input, and break TRST

output. A trace command optionally


NOTE: OCDS=ON-CHIP-DEBUGGING SUPPORT.
remaps the microcontroller’s 16-bit I/O
port 5 to carry trace information. An em- Infineon’s first-generation TriCore processor includes an on-chip-debug system with capabilities
ulator can use this information to recon- similar to those of 5001-99 Class-2 devices.
struct TriCore or peripheral-control-
processor program flow in real time or pipeline-status codes and waiting for an chitectures, the 5001-99 specification di-
offline. Debugging the peripheral-con- indirect branch, such as a return-from- vides debugging performance into four
trol processor relies upon a dedicated subroutine instruction. A four-entry compliance classes (Table 1). The mini-
“debug” instruction that the debug tool FIFO decouples the processor’s 32-bit mum Class-1 capability is similar to Mo-
inserts at critical code segments, reflect- program counter from the 8-bit pro- torola’s BDM, and the highest level Class
ing traditional code-instrumentation gram-counter bus that outputs indirect- 4 capability extends the real-time pro-
practice. This debug instruction triggers branch-target addresses, one byte at a gram-tracing and on-the-fly memory-
in response to condition codes becoming time on sequential processor cycles. The access capabilities of chips such as the
true to store the current instruction ad- FIFO rarely overruns; Infineon’s analy- TC1775 to include data acquisition and
dress and I/O channel number. Option- sis shows that overruns can happen only memory substitution. In an automotive
ally, you can halt channel execution or following several back-to-back jump-in- context, on-the-fly memory access is
generate a synchronisation signal on a direct instructions. You will typically not essential to provide a mechanism for
device pin. encounter this condition. A $400 TC1775 changing calibration constants, for ex-
Program-flow information also facili- starter kit is available now. ample while an engine is running. Data-
tates software-development tools, such as acquisition capabilities make visible on-
profilers and code-coverage analysers. FOUR CLASSES POWER 5001 DEBUGGING chip data values, such as an engine-
Each cycle, the TC1775’s processor core OCD’s main limitations lie with the management unit’s calibration constants.
transmits state information that com- complexity and capability of the test log- In a system that supports it, memory
prises 5 bits of pipeline status, 8 bits of ic, available buffer-memory depth for substitution can follow an exception or
indirect-program-counter information, capturing results, and communication reset event to redirect internal processor
and 3 bits that describe breakpoint qual- speed with the external development en- accesses to external program and data
ifiers. An emulator synchronises with vironment. To balance these issues and memory via an optional Nexus auxiliary
program execution by examining the meet the needs of a range of processor ar- port.

TABLE 1—5001-99’S FOUR CLASSES


IEEE-ISTO 5001-1999 Class Class 1 Class 2 Class 3 Class 4
Trace features None Adds ownership trace and Adds data-write trace and Allows tracing to be triggered by
program trace via read/write memory on the a watchpoint via auxiliary ports
auxiliary ports fly via auxiliary ports
Debug-communication Half-duplex Communication may be full- Communication may be full- Communication may be full-
method communication duplex using auxiliary port duplex using auxiliary port duplex using auxiliary port
Runtime control Supports runtime-con- Supports runtime-control Supports runtime-control Supports runtime-control features
trol features using features using 1149.1 inter- features using 1149.1 using 1149.1 interface or
IEEE-1149.1 interface face or auxiliary port interface or auxiliary port auxiliary port
Auxiliary port None Allows port sharing; the Allows port sharing with Allows port sharing with high-
auxiliary port may share high-speed I/O ports speed I/O ports
slow I/O port pins
Data acquisition None None Supports data acquisition Supports data acquisition
Memory substitution None None None Supports memory substitution (fetching
or reading data over the IEEE-ISTO 5001-
1999 auxiliary port); optional memory
substitution triggering on a watchpoint

www.ednmag.com August 2001 | edn europe 25


coverstory Boundary-scan debugging

To interface with the OCD hardware,


U-BUS
5001-99-compliant chips include the U-BUS PROGRAM-
TRACE
NRR (Nexus-recommended-register) BRKPT_OUT SNOOP
ENCODING
set, which supports as many as 127 OCD MESSAGE
L-BUS L-BUS DATA-TRACE PIN MCKO
registers to provide control and status in- SNOOP ENCODING QUEUES INTERFACE
MESSAGE MDO[0:1]
formation for as many as 32 embedded- OUT OR MDO[0:7]
L-BUS OWNERSHIP-
processor cores. Physically, the specifica- L-BUS
TRACE
FORMATTER MSEO
SNOOP
tion includes the 1149.1 interface and ENCODING
5001-99
MDI[0]
provides for an optional parallel interface L-BUS L-BUS READ/WRITE
PIN
OR MDO[0:1]
INTERFACE
SIGNALS
ACCESS REGISTERS
connector to accelerate I/O speed. Class- MASTER
CONTROL INTERFACE MSEI
MESSAGE
1 devices include the minimum 5001-99 USIU IN EVTI
RCPU-DEVELOPMENT ACCESS FORMATTER
features and require “connec- RSTI

tor A,” a dual-row, 20-pin Figure 3 RCPU MCKI


WATCHPOINT CAPTURE
AMP System-50 header that carries the USIU
SECURITY
four-wire 1149.1 interface; additional re-
NOTES:
set and voltage-reference pins provide a L-BUS=LOAD/STORE BUS.
hardware reset and establish the debug RCPU=POWERPC RISC PROCESSOR.
U-BUS=UNIFIED BUS.
interface’s signaling levels. Optionally, USIU=UNIFIED-SYSTEM-INTERFACE UNIT.

connector A includes the following sig-


nals to improve flexibility: Motorola’s MPC565 is the first microcontroller to include a 5001-99 Class-3 interface.
● CLOCKOUT, the target processor’s
system clock; row, 80-pin Samtec header on a 0.05-in. Infineon’s Liess observes that the com-
● EVTI (event-in input), to halt the matrix. pany’s first-generation TC1775’s OCDS
processor or to transmit program- and The 5001-99 hardware interface pro- implementation models 5001-99’s Class-
data-synchronisation messages from the vides debug control via the standard’s 2 requirements. Future TriCore OCDS
processor to the debug tool; API. Implemented as a standard set of implementations will meet higher level
● EVTO (event-out output), to pro- header files, the API is a two-layer mod- 5001-99 requirements, so that standard
vide precise breakpoint timing informa- el that comprises a target abstraction lay- production parts will offer a level of ac-
tion for the debug tool; er and an emulator-hardware abstraction cess to data tracing equal to that of ded-
● RDY, a handshake signal to speed in- layer. The chip vendor provides the tar- icated bond-out processors. And last De-
formation transfers; get-abstraction-layer information that cember, Motorola announced the
● TRST, the 1149.1 optional test-reset implements the Nexus debug semantics industry’s first truly 5001-99-compliant
input; and using the device under test’s OCD sys- device with its MPC565 PowerPC em-
● VENDOR, a device-specific I/O sig- tem. Target-to-tool communication oc- bedded processor (Figure 3). The
nal. curs via the emulator’s hardware-ab- MPC565 includes a Class-3 debug port
The specification also defines “con- straction layer, which also abstracts that tools from Ashling Microsystems
nector B,” a dual-row, 30-pin header that communication between external hosts support. (Another Nexus member, Ash-
carries a superset of connector A’s signals (such as a PC) and the emulator hard- ling also developed the first tools to per-
comprising two MDI (message-data-in- ware. Software tools build on the target form real-time tracing for Infineon’s Tri-
put) and four MDO (message-data-out- abstraction layer, typically using vendor- Core architecture.) The preferred
put) pins. Debugging tools can use con- specific APIs to the tool set’s application connector that Motorola includes on its
nector B in the 1149.1-only mode, an layer. At the lowest level, the Nexus API MPC565 development board is a 40-pin
auxiliary-port mode, or in combination. provides a uniform interface to debug derivative of the 80-pin connector C that
Connector B’s typical use is for static de- tasks such as entering and leaving debug supports eight mes-
bugging via the 1149.1 port with the aux- mode, reading and writing registers and sage-data outputs and You can reach
iliary port providing runtime trace sup- memory, halting on breakpoints, and two message-data in- Contributing
Editor David
port. The maximum-capability “con- single-stepping instructions. The API in- puts. Although not yet Marsh at
nector C” dispenses with the 1149.1 in- cludes powerful features, such as the abil- recognised as a 5001- forncett@
compuserve.com.
terface to support applications that re- ity to read and write memory and to approved standard,
quire a wider data pathway. The main ad- monitor program flow and data reads this connector config-
ditional pin function is an optional while the processor runs in real time, let- uration allows the standard 40-MHz
16-bit I/O port that can employ port re- ting you change calibration constants MPC565 to output data at maximum
placement, meaning that you can remap while the program runs. For applications speeds of 40 Mbytes/sec and input mes-
low- or high-speed I/O pins for the de- such as event tracking, a “watch-point” sages at 5 Mbytes/sec; a 56-MHz version
bugging tool’s use during debugging ses- function sends a message to the debug- of the processor is also available.k
sions. This pin-multiplexing strategy re- ging tool rather than halting execution as
duces the number of device-package pins for a breakpoint. The 5001-99 API also Reference
necessary to accommodate complex I/O provides a program-ownership mecha- 1. Marsh, David, “Simple boundary-
and debugging functions. The recom- nism that’s essential for tracking pro- scan techniques tackle sophisticated sys-
mended connector-C hardware is a four- gram flow within an RTOS environment. tems,” EDN Europe, July 2001, pg 34.
26 edn europe | August 2001 www.ednmag.com

You might also like