11-50
ColdFire CF4e Core User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Background Debug Mode (BDM)
else
A7 = User Stack Pointer
OTHER_A7 = Supervisor Stack Pointer
The BDM programming model supports reads and writes to A7 and OTHER_A7 directly.
It is the responsibility of the external development system to determine the mapping of A7
and OTHER_A7 to the two program-visible definitions (supervisor and user stack
pointers), based on the SR[S].
BDM Accesses of the EMAC Registers
The presence of rounding logic in the output datapath of the EMAC requires special care
for BDM-initiated reads and writes of its programming model. In particular, any result
rounding modes must be disabled during the read/write process so the exact bit-wise
EMAC register contents are accessed.
For example, a BDM read of an accumulator (ACC
x
) requires the following sequence:
BdmReadACCx (
rcreg
wcreg
rcreg
wcreg
macsr;
#0,macsr;
ACCx;
#saved_data,macsr;
// read current macsr contents & save
// disable all rounding modes
// read the desired accumulator
// restore the original macsr
)
Likewise to write an accumulator register, the following BDM sequence is needed:
BdmWriteACCx (
rcreg
wcreg
wcreg
wcreg
macsr;
#0,macsr;
#data,ACCx;
#saved_data,macsr;
// read current macsr contents & save
// disable all rounding modes
// write the desired accumulator
// restore the original macsr
)
Additionally, writes to the accumulator extension registers must be performed after the
corresponding accumulators are updated because a write to any accumulator alters the
corresponding extension register contents.
For more information on saving and restoring the complete EMAC programming model,
see the appropriate section of the EMAC chapter.
BDM Accesses of Floating-Point Data Registers (FPn)
The ColdFire debug architecture allows BDM accesses of the entire programming model
(including all FPU-related registers) of the processor core using
RCREG
and
WCREG
.
However, certain hardware restrictions require the accesses related to the 64-bit FPn data
registers be performed in a certain manner to guarantee correct operation.
The serial BDM command structure supports 8-, 16- and 32-bit accesses, but there is no
direct mechanism for accessing 64-bit data values. Rather than changing this
well-established protocol and command set, BDM accesses of 64-bit data values are
treated as two independent 32-bit references. In particular, 64-bit FPn data registers are
treated as two separate values from the BDM perspective. Each FPn is partitioned into
upper and lower longwords, FPU
n
and FPL
n
.
F
Freescale Semiconductor, Inc.
n
.