C8051F120/1/2/3/4/5/6/7
190
Rev. 1.2
The FLASH Access Limit security feature (see Figure 16.2) protects proprietary program code and data from being
read by software running on the C8051F120/1/2/3/4/5/6/7. This feature provides support for OEMs that wish to pro-
gram the MCU with proprietary value-added firmware before distribution. The value-added firmware can be pro-
tected while allowing additional code to be programmed in remaining program memory space later.
The Software Read Limit (SRL) is a 17-bit address that establishes two logical partitions in the program memory
space. The first is an upper partition consisting of all the program memory locations at or above the SRL address, and
the second is a lower partition consisting of all the program memory locations starting at 0x00000 up to (but exclud-
ing) the SRL address. Software in the upper partition can execute code in the lower partition, but is prohibited from
reading locations in the lower partition using the MOVC instruction. (Executing a MOVC instruction from the upper
partition with a source address in the lower partition will return indeterminate data.) Software running in the lower
partition can access locations in both the upper and lower partition without restriction.
The Value-added firmware should be placed in the lower partition. On reset, control is passed to the value-added
firmware via the reset vector. Once the value-added firmware completes its initial execution, it branches to a predeter-
mined location in the upper partition. If entry points are published, software running in the upper partition may exe-
cute program code in the lower partition, but it cannot read or change the contents of the lower partition. Parameters
may be passed to the program code running in the lower partition either through the typical method of placing them
on the stack or in registers before the call or by placing them in prescribed memory locations in the upper partition.
The SRL address is specified using the contents of the FLASH Access Register. The 8 MSBs of the 17-bit SRL
address are determined by the setting of the FLACL register. Thus, the SRL can be located on 512-byte boundaries
anywhere in program memory space. However, the 1024-byte erase sector size essentially requires that a 1024
boundary be used. The contents of a non-initialized FLACL security byte are 0x00, thereby setting the SRL address
to 0x00000 and allowing read access to all locations in program memory space by default.
Bits 7-0: FLACL: FLASH Access Limit.
This register holds the most significant 8 bits of the 17-bit program memory read/write/erase limit
address. The lower 9 bits of the read/write/erase limit are always set to 0. A write to this register sets
the FLASH Access Limit. This register can only be written once after any reset. Any subsequent
writes are ignored until the next reset. To fully protect all addresses below this limit, bit 0 of FLACL
should be set to ‘0’.
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Reset Value
00000000
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
SFR Address:
SFR Address:
SFR Page:
0xB7
F
Figure 16.3. FLACL: FLASH Access Limit
Summary of Contents for C8051F120
Page 2: ...C8051F120 1 2 3 4 5 6 7 2 Rev 1 2 Notes ...
Page 8: ...C8051F120 1 2 3 4 5 6 7 8 Rev 1 2 26 2 Flash Programming Commands 318 26 3 Debug Support 321 ...
Page 16: ...C8051F120 1 2 3 4 5 6 7 16 Rev 1 2 Notes ...
Page 48: ...C8051F120 1 2 3 4 5 6 7 48 Rev 1 2 ...
Page 98: ...C8051F120 1 2 3 4 5 6 7 98 Rev 1 2 ...
Page 106: ...C8051F120 1 2 3 4 5 6 7 106 Rev 1 2 Notes ...
Page 183: ...C8051F120 1 2 3 4 5 6 7 Rev 1 2 183 Notes ...
Page 184: ...C8051F120 1 2 3 4 5 6 7 184 Rev 1 2 ...
Page 214: ...C8051F120 1 2 3 4 5 6 7 214 Rev 1 2 Notes ...