![](http://datasheet.mmic.net.cn/110000/MC3S12HZ256J3CAA_datasheet_3506324/MC3S12HZ256J3CAA_514.png)
Chapter 18 Background Debug Module (BDMV4)
MC9S12HZ256 Data Sheet, Rev. 2.05
514
Freescale Semiconductor
18.3.2.1
BDM Status Register (BDMSTS)
Read: All modes through BDM operation
Write: All modes but subject to the following:
BDMACT can only be set by BDM hardware upon entry into BDM. It can only be cleared by the
standard BDM rmware lookup table upon exit from BDM active mode.
CLKSW can only be written via BDM hardware or standard BDM rmware write commands.
All other bits, while writable via BDM hardware or standard BDM rmware write commands,
should only be altered by the BDM hardware or standard rmware lookup table as part of BDM
command execution.
ENBDM should only be set via a BDM hardware command if the BDM rmware commands are
needed. (This does not apply in special single-chip mode).
76543210
R
ENBDM
BDMACT
ENTAG
SDV
TRACE
CLKSW
UNSEC
0
W
Reset:
Special single-chip mode:
Special peripheral mode:
All other modes:
11
0
1 ENBDM is read as "1" by a debugging environment in Special single-chip mode when the device is not secured or secured
but fully erased (Flash and EEPROM).This is because the ENBDM bit is set by the standard firmware before a BDM command
can be fully transmitted and executed.
1
0
02
0
2 UNSEC is read as "1" by a debugging environment in Special single-chip mode when the device is secured and fully erased,
else it is "0" and can only be read if not secure (see also bit description).
0
= Unimplemented or Reserved
= Implemented (do not alter)
Figure 18-3. BDM Status Register (BDMSTS)
Note:
Table 18-2. BDMSTS Field Descriptions
Field
Description
7
ENBDM
Enable BDM — This bit controls whether the BDM is enabled or disabled. When enabled, BDM can be made
active to allow rmware commands to be executed. When disabled, BDM cannot be made active but BDM
hardware commands are allowed.
0 BDM disabled
1 BDM enabled
Note: ENBDM is set by the rmware immediately out of reset in special single-chip mode. In secure mode, this
bit will not be set by the rmware until after the EEPROM and FLASH erase verify tests are complete.
6
BDMACT
BDM Active Status — This bit becomes set upon entering BDM. The standard BDM rmware lookup table is
then enabled and put into the memory map. BDMACT is cleared by a carefully timed store instruction in the
standard BDM rmware as part of the exit sequence to return to user code and remove the BDM memory from
the map.
0 BDM not active
1 BDM active