Datasheet
349
SAM4S Series [DATASHEET]
11100F–ATARM–29-Jan-14
When Flash programming is completed, the FRDY bit in EEFC_FSR rises. If an interrupt has been enabled by
setting the bit FRDY in EEFC_FMR, the interrupt line of the EEFC is activated.
Three errors can be detected in EEFC_FSR after a programming sequence:
Command Error: a bad keyword has been written in EEFC_FCR.
Lock Error: the page to be programmed belongs to a locked region. A command must be run previously to unlock
the corresponding region.
Flash Error: when programming is completed, the WriteVerify test of the Flash memory has failed.
Only one page can be programmed at a time. It is possible to program all the bits of a page (full page programming) or
only some of the bits of the page (partial page programming).
Depending on the number of bits to be programmed within the page, the EEFC adapts the write operations required to
program the Flash.
When the Programming Page command is given, the EEFC starts the programming sequence and all the bits written at 0
in the latch buffer are cleared in the Flash memory array.
During programming, i.e. until FDRY rises, access to the Flash is not allowed.
Full Page Programming
To program a full page, all the bits of the page must be erased before writing the latch buffer and launching the WP
command. The latch buffer must be written in ascending order, starting from the first address of the page. See Figure 20-
7, "Full Page Programming".
Partial Page Programming
To program only part of a page using the WP command, the following constraints must be respected:
Data to be programmed must be contained in integer multiples of 64-bit address-aligned words.
64-bit words can be programmed only if all the corresponding bits in the Flash array are erased (at logical value 1).
See Figure 20-8, "Partial Page Programming"
Programming Bytes
Individual bytes can be programmed using the partial page programming mode. In this case, an area of 64 bits must be
reserved for each byte, as shown in Figure 20-9, "Programming Bytes in the Flash".