440
8331B–AVR–03/12
Atmel AVR XMEGA AU
In order to use the flash range CRC command, all the boot lock bits must be unprogrammed (no
locks). The command execution will be aborted if the boot lock bits for an accessed location are
set.
33.11.2.7
Erase Application Section
The erase application command is used to erase the complete application section.
1.
Load the Z-pointer to point anywhere in the application section.
2.
Load the NVM CMD register with the erase application section command
3.
Execute the SPM instruction. This requires the timed CCP sequence during self-
programming.
The BUSY flag in the STATUS register will be set until the operation is finished. The CPU will be
halted during the complete execution of the command.
33.11.2.8
Erase Application Section / Boot Loader Section Page
The erase application section page erase and erase boot loader section page commands are
used to erase one page in the application section or boot loader section.
1.
Load the Z-pointer with the flash page address to erase. The page address must be
written to ZPAGE. Other bits in the Z-pointer will be ignored during this operation.
2.
Load the NVM CMD register with the erase application/boot section page command.
3.
Execute the SPM instruction. This requires the timed CCP sequence during self-
programming.
The BUSY flag in the NVM STATUS register will be set until the erase operation is finished. The
FBUSY flag is set as long the flash is busy, and the application section cannot be accessed.
33.11.2.9
Application Section / Boot Loader Section Page Write
The write application section page and write boot loader section page commands are used to
write the flash page buffer into one flash page in the application section or boot loader section.
1.
Load the Z-pointer with the flash page to write. The page address must be written to
FPAGE. Other bits in the Z-pointer will be ignored during this operation.
2.
Load the NVM CMD register with the write application section/boot loader section page
command.
3.
Execute the SPM instruction. This requires the timed CCP sequence during self-
programming.
The BUSY flag in the NVM STATUS register will be set until the write operation is finished. The
FBUSY flag is set as long the flash is busy, and the application section cannot be accessed.
An invalid page address in the Z-pointer will abort the NVM command. The erase application
section page command requires that the Z-pointer addresses the application section, and the
erase boot section page command requires that the Z-pointer addresses the boot loader
section.
33.11.2.10
Erase and Write Application Section / Boot Loader Section Page
The erase and write application section page and erase and write boot loader section page com-
mands are used to erase one flash page and then write the flash page buffer into that flash page
in the application section or boot loader section in one atomic operation.