38.3.2.2 Configuration of Scan Region

The Flash can be divided into sections, as illustrated in the figure below.
Figure 38-3. Division of Flash Into Sections

Determine the section sizes in blocks corresponding to the Flash memory page size. The sizes of these sections are set by the Boot Size (FUSE.BOOTSIZE) and Code Size (FUSE.CODESIZE) fuses. Refer to the Fuse section for more information. The Boot Loader Code (BOOT) section stretches from FLASHSTART to BOOTEND, the Application Code (APPCODE) section stretches from BOOTEND to APPEND, and the remaining is the Application Data (APPDATA) section.

If FUSE.BOOTSIZE is written to ‘0’, the entire Flash is considered the BOOT section. If FUSE.CODESIZE is written to ‘0’ and FUSE.BOOTSIZE > 0, the APPCODE section runs from BOOTEND to the end of the Flash, meaning no APPDATA section.

Which region to scan is configured in the CRC Source (SRC) bit field in the CRCSCAN.CTRLA register.

Starting a scan of an unconfigured Flash region will set the ERROR bit in the CRCSCAN.STATUSA register. For starting a scan with SRC set to CODE or DATA when BOOTSIZE=’0’ (the whole Flash is BOOT) or SRC set to DATA when CODESIZE=’0’ (no DATA section) will both result in CRC failure.

Table 38-1. Configuration of Scan Regions
CRC SourceScan RegionBOOTSIZECODESIZE
BOOTBOOT> 0-
The entire Flash 0-
CODEAPPCODE> 0-
DATAAPPDATA> 0BOOTEND + APPEND < FLASHEND