MM912_634 Advance Information, Rev. 10.0
Freescale Semiconductor
234
One cycle after bdm_unsecure is asserted the secure firmware is disabled from the map.
In secure mode aBDM access to a non register address will be translated to a peripheral register address, and BDM registers
are not accessible.
No BDM global access is possible if the chip is secured.
In secured expanded mode or emulation mode, FLASH and EEPROM are disabled by the MMC.
5.34.2
BDM
When security is active and the blank check is performed and failed, only BDM hardware commands are available. If the blank
check is succeeds, all BDM commands are available.
The BDM status register contains a bit called UNSEC. This bit is only writable by the secure firmware in special single chip mode.
Based on the state of this bit, the BDM generates a signal called “unsecure”. The bit and signal are always reset to 0 (=
de-asserted = secure).
If the user resets into special single chip mode with the part secured, an alternate BDM firmware (“SECURE firmware”), is placed
in the map along with the standard BDM firmware. The secure firmware has higher priority than the standard firmware, but it is
smaller (less bytes). The secure firmware covers the vector space, but does not reach the beginning of the BDM firmware space.
When blank check is successfully performed, UNSEC is asserted. The BDM program jumps to the start of the standard BDM
firmware program and the secure firmware is turned off. If the blank check fails, then the ENBDM bit in the BDMSTS register is
set without asserting UNSEC, and the BDM firmware code enters a loop. This enables the BDM hardware commands. In secure
mode the MMC restricts BDM accesses to the register space.
With UNSEC asserted, security is off and the user can change the state of the secure bits in the FLASH. Note that if the user
does not change the state of these bits to “unsecured”, the part will be secured again when it is next taken out of reset.
5.34.3
DBG
S12X_DBG will disable the trace buffer, but breakpoints are still valid.
5.34.4
XGATE
XGATE internal registers XGCCR, XGPC, and XGR1 - XGR7 can not be written and will read zero from IPBI.
Single stepping in XGATE is not possible.
XGATE code residing in the internal RAM cannot be protected:
1.
start MCU in NSC, let it run for a while
2.
reset into SSC, MASERS the NVM
3.
reset into SSC, blank check of BDM secure firmware succeeds
4.
MCU is temporarily unsecured
5.
BDM can be used to read internal RAM (contents not affected by reset)
5.35
Secure firmware Code Overview
The BDM contains a secure firmware code. This firmware code is invoked when the user comes out of reset in special single chip
mode with security enabled. The function of the firmware code is straight forward:
Verify the FLASH is erased
Verify the EEPROM is erased
If both are erased, release security
If either the FLASH or the EEPROM is not erased, then security is not released. The ENBDM bit is set and the code enters a
loop. This allows BDM hardware commands, which may be used to erase the EEPROM and FLASH.
Note that erasing the memories and erasing / reprogramming the security bits is NOT part of the firmware code. The user must
perform these operations.
The blank check of FLASH and EEPROM is done in the BDM firmware. As such it could be changed on future parts. The current
scheme uses the NVM command state-machines (FTX, EETX) to perform the blank check.