31.1.3 Flash Architecture

Each Flash partition is built up of several pages, also called sectors. The controller works with a panel made from 4KB pages with each page containing 4 rows of Flash data. A row is the largest selectable region for contiguous programming of Write Words. A Row contains 4 Write Words.

A page of Flash is the smallest unit of memory that can be erased in a single operation. A panel’s Program Flash Memory (PFM) space can also be erased in a single operation. All other erases use multiple operations.

A Write Word is the only unit of memory that can be programmed at a time. All other programming operations are made up of several contiguous Write Word Program operations. The FCW supports:

  • Row Write: Write Word by Write Word programming until the whole Row is written. Data is read by the FCW from System SRAM.
  • Quad Write: The FCW performs 4 writes of data from holding registers
  • Single Write: The FCW performs one write of data from holding register(s)

See the table in the Definitions section.

Program Flash Memory (PFM)

PFM is the largest section of Flash memory. It can span across two panels. When two Panels are used, the location for Panel 1 is in the lower address range and Panel 2 in the upper address range. The order in which each PFM exist in the Flash memory space can be controlled by software. The PFM address range is contiguous across both panels.

Dual panel systems support Live Update which allows reading from one panel while write to the other. It does not matter which of the logical regions are being accessed as long as they are in different panels.

Boot Flash Memory (BFM)

Boot Flash Memory is meant to support sophisticated boot loaders. It has 4 pages that are either divided between dual panels, or all pages are in a single BFM panel.

PIC32C devices have a Boot ROM to control configuration loading and to provide a root of trust for secure boot. When the Boot ROM has finished loading the configuration it sets up the CPU to start execution from the base address of the BFM.

The BFM can be used in either Dual Boot or Single Boot. With a dual panel system, each panel has BFM code. Dual Boot designates each panel’s BFM as a boot source. This allows for the safe updating of one boot image while the other image stays intact. A Single Boot, with two panels, allows the boot image to span both panel’s BFM space providing for a larger boot code space. The BFM only has the memory in the existing panel when a single panel exists.

Configuration Flash Memory (CFM)

CFM contains several pages. Like BFM it is either divided between dual panels, or all pages are in a single CFM panel. This memory is dedicated to the configuration of the device (See the following table). These pages have hardware-imposed restrictions on their usage. They are not for code and may not be accessible after the device is protected.

One page contains factory calibration data including the unique ID of the device . This page cannot be written or erased.

The Boot Configuration (Boot CFG) page contains pre-boot options to be configured by the Boot ROM. This page can be read protected and write/erase protected by the Flash system.

The User-OTP page implements a Flash-based “One Time Programmable” region. It is always erase protected by hardware such that its content survives a Chip Erase operation. It is intended to store calibration values for external devices but is fully user defined. That is it can be written only once, but accessed thereafter.

The User Configuration (User CFG) page stores pre-boot options that have a different protection model than Boot CFG. This page can be write/erase locked.

For systems that have dual panels, the second panel’s CFM contains additional pages to support dual boot. Boot CFG 2 and User CFG 2 allows for safe updates of configuration data while also updating application code in PFM, or boot code in BFM. This is different than a bootloader.

Table 31-2. Flash CFM Configuration Address Map
Panel:Address: Size: Contents: Notes:
Start:End:
10x0A00_00000x0A00_0FFF4 KByteUser CFG-1-
10x0A00_10000x0A00_1FFF4 KByteUser OTP-1-
10x0A00_20000x0A00_2FFF4 KByteBOOT CFG-1-
10x0A00_30000x0A00_3FFF4 KByteROM CFG-1-
10x0A00_40000x0A00_4FFF4 KByteVSS0 -
10x0A00_50000x0A00_5FFF4 KByteVSS1-
10x0A00_60000x0A00_6FFF4 KByteRSVD-
10x0A00_70000x0A00_7FFF4 KByteCAL-OTPCannot be written or erased.
20x0A00_80000x0A00_8FFF4 KByteUser CFG-2-
20x0A00_90000x0A00_9FFF4 KByteUser OTP-2-
20x0A00_A0000x0A00_AFFF4 KByteBOOT CFG-2-
20x0A00_B0000x0A00_BFFF4 KByteRSVDNo access.
20x0A00_C0000x0A00_CFFF4 KByteRSVDNo access.
20x0A00_D0000x0A00_DFFF4 KByteRSVDNo access.
20x0A00_E0000x0A00_EFFF4 KByteRSVDNo access.
20x0A00_F0000x0A00_FFFF4 KByteRSVDNo access.
Note: All RSVD addresses are “Address Holes” and therefore generate a bus error back to the initiator.