9.1.1.3 Storage Area Flash

Storage Area Flash (SAF) is the area in program memory that can be used as data storage. The SAF block size is configurable using the SAFSZ configuration bits. Refer to the "Device Configuration" chapter for more information about the available SAF block size selections using the SAFSZ configuration bits. If enabled, the code placed in this area cannot be executed by the CPU. The SAF block is placed at the end of memory and the size of this area is dependent on the SAF Block Size Selection configuration bits.

The WRTSAF Configuration bit is used to write-protect the SAF and the SAFLOCK Configuration bit is used to make the SAF one-time programmable. Enabling the SAFLOCK bit makes the selected SAF size write-protected regardless of the WRTSAF bit setting.

Important: If write-protected locations are written to, memory is not changed and the WRERR bit is set.
Table 9-1. Program Flash Memory Partition
Region Address Partition(3)
BBEN = 1

SAFSZ = 0xFF

BBEN = 1

SAFSZ ≠ 0xFF

BBEN = 0

SAFSZ = 0xFF

BBEN = 0

SAFSZ ≠ 0xFF

Program Flash Memory 00 0000h

. . . .

Last Boot Block Memory Address(1)

Application Block Application Block Boot Block Boot Block

Last Boot Block Memory Address(1) + 1

. . . .

Last Program Memory Address (2) / Beginning of SAF Block - 1

Application Block Application Block
Beginning of SAF Block(2)

. . . .

Last Program Memory Address(2)

Storage Area Flash Block(4) Storage Area Flash Block(4)
Note:
  1. Last Boot Block address is based on BBSIZE Configuration bits.
  2. Last Program Memory address is based on "Program and Data Memory Map" table above, as well as the SAFSZ Configuration bits.
  3. Refer to the “Device Configuration” chapter for BBEN, BBSIZE and SAFSZ definitions.
  4. A configurable Storage Area Flash block is implemented at the end of user Flash memory, if enabled.