Freescale Semiconductor TWR-S12G64 Scalable Platform for Automotive Applications TWR-S12G64-KIT TWR-S12G64-KIT Data Sheet

Product codes
TWR-S12G64-KIT
Page of 1292
16 KByte Flash Module (S12FTMRG16K1V1)
MC9S12G Family Reference Manual,
Rev.1.23
796
Freescale Semiconductor
Trying to alter data in any protected area in the P-Flash memory will result in a protection violation error
and the FPVIOL bit will be set in the FSTAT register. The block erase of a P-Flash block is not possible if
any of the P-Flash sectors contained in the same P-Flash block are protected.
Although the protection scheme is loaded from the Flash memory at global address 0x3_FF0C during the
reset sequence, it can be changed by the user. The P-Flash protection scheme can be used by applications
requiring reprogramming in single chip mode while providing as much protection as possible if
reprogramming is not required.
Table 24-17. FPROT Field Descriptions
Field
Description
7
FPOPEN
Flash Protection Operation Enable — The FPOPEN bit determines the protection function for program or
erase operations as shown in
 for the P-Flash block.
0 When FPOPEN is clear, the FPHDIS bit defines an unprotected address range as specified by the FPHS bits
1 When FPOPEN is set, the FPHDIS bit enables protection for the address range specified by the FPHS bits
6
RNV[6]
Reserved Nonvolatile Bit — The RNV bit should remain in the erased state for future enhancements.
5
FPHDIS
Flash Protection Higher Address Range Disable — The FPHDIS bit determines whether there is a
protected/unprotected area in a specific region of the P-Flash memory ending with global address 0x3_FFFF.
0 Protection/Unprotection enabled
1 Protection/Unprotection disabled
4–3
FPHS[1:0]
Flash Protection Higher Address Size — The FPHS bits determine the size of the protected/unprotected area
in P-Flash memory as shown in
. The FPHS bits can only be written to while the FPHDIS bit is set.
2–0
RNV[2:0]
Reserved Nonvolatile Bits — These RNV bits should remain in the erased state.
Table 24-18. P-Flash Protection Function
FPOPEN
FPHDIS
Function
1
1
For range sizes, refer to
1
1
No P-Flash Protection
1
0
Protected High Range
0
1
Full P-Flash Memory Protected
0
0
Unprotected High Range
Table 24-19. P-Flash Protection Higher Address Range
FPHS[1:0]
 Global Address Range
Protected Size
00
0x3_F800–0x3_FFFF
2 Kbytes
01
0x3_F000–0x3_FFFF
4 Kbytes
10
0x3_E000–0x3_FFFF
8 Kbytes
11
0x3_C000–0x3_FFFF
16 Kbytes