Erase Section

Erases a contiguous flash section.

The Erase Section command will first unlock all regions which are within the requested flash range to erase. If the requested flash area (start address; pages) constitutes the entire flash of the device, the Erase All command will be used. Otherwise a sequence of page erases will be performed.

Note: Erasing sections can also be done by writing to the flash controller directly.
Table 1. Erase Section Command Format
Field Size Description
AVR32_CMD_ERASE_SECTION 1 byte Command ID
Version (0x00) 1 byte Command version
Unlock 1 byte Boolean flag indicating whether to unlock flash regions before erase
Memory type 1 byte Memory type to access; see Memory Types
Start address 4 bytes Start address of flash section to erase
Pages 2 bytes Number of pages to erase

Responses: