
MM912_634 Advance Information, Rev. 10.0
Freescale Semiconductor
189
5.31.4.4
Standard BDM Firmware Commands
BDM firmware commands are used to access and manipulate CPU resources. The system must be in active BDM to execute
suspended while the CPU executes the firmware located in the standard BDM firmware lookup table. The hardware command
BACKGROUND is the usual way to activate BDM.
As the system enters active BDM, the standard BDM firmware lookup table and BDM registers become visible in the on-chip
memory map at 0x3_FF00–0x3_FFFF, and the CPU begins executing the standard BDM firmware. The standard BDM firmware
watches for serial commands and executes them as they are received.
5.31.4.5
BDM Command Structure
Hardware and firmware BDM commands start with an 8-bit opcode followed by a 16-bit address and/or a 16-bit data word,
depending on the command. All the read commands return 16 bits of data despite the byte or word implication in the command
name.{Satatement}
8-bit reads return 16-bits of data, only one byte of which contains valid data. If reading an
even address, the valid data will appear in the MSB. If reading an odd address, the valid data
will appear in the LSB.
16-bit misaligned reads and writes are generally not allowed. If attempted by BDM hardware
command, the BDM ignores the least significant bit of the address and assumes an even
address from the remaining bits.
Table 268. Firmware Commands
Opcode
(hex)
Data
Description
62
16-bit data out Increment X index register by 2 (X = X + 2), then read word X points to.
READ_PC
63
16-bit data out Read program counter.
READ_D
64
16-bit data out Read D accumulator.
READ_X
65
16-bit data out Read X index register.
READ_Y
66
16-bit data out Read Y index register.
READ_SP
67
16-bit data out Read stack pointer.
WRITE_NEXT
42
16-bit data in
Increment X index register by 2 (X = X + 2), then write word to location
pointed to by X.
WRITE_PC
43
16-bit data in
Write program counter.
WRITE_D
44
16-bit data in
Write D accumulator.
WRITE_X
45
16-bit data in
Write X index register.
WRITE_Y
46
16-bit data in
Write Y index register.
WRITE_SP
47
16-bit data in
Write stack pointer.
GO
08
none
Go to user program. If enabled, ACK will occur when leaving active background mode.
0C
none
Go to user program. If enabled, ACK will occur upon returning to active background mode.
TRACE1
10
none
Execute one user instruction then return to active BDM. If enabled,
ACK will occur upon returning to active background mode.
TAGGO -> GO
18
none
(Previous enable tagging and go to user program.)
This command will be deprecated and should not be used anymore.
Opcode will be executed as a GO command.
Note:
180. If enabled, ACK will occur when data is ready for transmission for all BDM READ commands and will occur after the write is complete
for all BDM WRITE commands.
181. When the firmware command READ_NEXT or WRITE_NEXT is used to access the BDM address space the BDM resources are
accessed rather than user code. Writing BDM firmware is not possible.
182. System stop disables the ACK function and ignored commands will not have an ACK-pulse (e.g., CPU in stop mode). The GO_UNTIL
command will not get an Acknowledge if CPU executes the stop instruction before the “UNTIL” condition (BDM active again) is reached