1.7.1 Dual Partition Memory Organization
In the Dual Partition Flash modes, the device’s memory is divided evenly into two physical sections, known as Partition 1 and Partition 2. Each of these partitions contains its own program memory and Configuration Words. During the program execution, the code on only one of these partitions can be executed and that will be the Active Partition. The other partition, or the Inactive Partition, cannot be used for execution but can be programmed.
The Active Partition is always mapped to program address, 0x800000, while the Inactive Partition will always be mapped to program address, 0xC00000. Even when the code partitions are switched between active and inactive by the user, the address of the Active Partition will still be 0x800000 and the address of the Inactive Partition will be 0xC00000.
The Boot Sequence Configuration Word (FBTSEQ) determines whether Partition 1 or Partition 2 will be active after Reset. If the part is operating in Dual Partition mode, the partition with the lower Boot Sequence Number will operate as the Active Partition (FBTSEQ is unused in Single Partition mode). The partitions can be switched between active and inactive by reprogramming their Boot Sequence Numbers, but the Active Partition will not change until a device Reset is performed. If both the Boot Sequence Numbers are the same, or if both are corrupted, the part will use Partition 1 as the Active Partition. If only one Boot Sequence Number is corrupted, the device will use the partition without a corrupted Boot Sequence Number as the Active Partition.
The user can also change which partition is active at run time using the
BOOTSWP instruction. The BOOTSWP instruction must
be enabled before it can be used (located in the FICD Configuration Word). Issuing a
BOOTSWP instruction does not affect which partition will be the
Active Partition after a Reset. Figure 1-2 shows how Partitions 1 and 2 are swapped between the Active and
Inactive Partitions during FBTSEQ reprogramming and BOOTSWP execution,
respectively.
The P2ACTIV bit (NVMCON[10]) can be used to determine which physical partition is the
Active Partition. If P2ACTIV = 1, Partition 2 is active; if P2ACTIV =
0, Partition 1 is active.
