4.4.2 FLKEY: Flash Lock and Key
Bit
7
6
5
4
3
2
1
0
Name
FLKEY
Access
RW
Reset
0x00
SFR Page = 0x0; SFR Address: 0xB7
Bit
Name
Reset
Access
Description
7:0
FLKEY
0x00
RW
Flash Lock and Key Register.
Write:
This register provides a lock and key function for flash erasures and writes. Flash writes and erases are enabled by writing
0xA5 followed by 0xF1 to the FLKEY register. Flash writes and erases are automatically disabled after the next write or
erase is complete. If any writes to FLKEY are performed incorrectly, or if a flash write or erase operation is attempted while
these operations are disabled, the flash will be permanently locked from writes or erasures until the next device reset. If an
application never writes to flash, it can intentionally lock the flash by writing a non-0xA5 value to FLKEY from firmware.
Read:
When read, bits 1-0 indicate the current flash lock state.
00: Flash is write/erase locked.
01: The first key code has been written (0xA5).
10: Flash is unlocked (writes/erases allowed).
11: Flash writes/erases are disabled until the next reset.
4.4.3 FLSCL: Flash Scale
Bit
7
6
5
4
3
2
1
0
Name
Reserved
BYPASS
Reserved
Access
R
RW
R
Reset
0
0
0x00
SFR Page = 0x0; SFR Address: 0xB6
Bit
Name
Reset
Access
Description
7
Reserved
Must write reset value.
6
BYPASS
0
RW
Flash Read Timing One-Shot Bypass.
Value
Name
Description
0
ONE_SHOT
The one-shot determines the flash read time. This setting should be used for op-
erating frequencies less than 14 MHz.
1
SYSCLK
The system clock determines the flash read time. This setting should be used for
frequencies greater than 14 MHz.
5:0
Reserved
Must write reset value.
When changing the BYPASS bit from 1 to 0, the third opcode byte fetched from program memory is indeterminate. Therefore, the
operation which clears the BYPASS bit should be immediately followed by a benign 3-byte instruction whose third byte is a don't care.
An example of such an instruction is a 3-byte MOV that targets the CRC0FLIP register. When programming in C, the dummy value
written to CRC0FLIP should be a non-zero value to prevent the compiler from generating a 2-byte MOV instruction.
EFM8SB2 Reference Manual
Flash Memory
silabs.com
| Smart. Connected. Energy-friendly.
Rev. 0.1 | 29