Datasheet

Embedded Flash memory RM0352
34/138 DocID024647 Rev 1
6.3.4 Command register
Status bits:
Writing to the COMMAND register will start the action that will be performed on the
Flash.
The CMDSDTART flag will go high and stays high until it is cleared. The busy flag will
go low again when the command has finished.
When the command has finished the CMDDONE flag goes high.
When a MASS READ command was given and when CMDDONE is high, the
READOK flag can be checked or the LFSRVAL register can be read (contains the
signature of the mass read).
ERASE
For page erase we can erase one of 32 pages in program memory.
The APB actions that need to be performed are:
Write ADDRESS register value of the page you want to erase:
XADR[7:3] = Page address.
Write ERASE command value to the COMMAND register.
MASS ERASE
MASS ERASE can be performed on the whole program memory space.
The APB action that needs to be performed is:
Write MASS ERASE command value to the COMMAND register.
WRITE
One word can be programmed per WRITE command.
Table 20. Flash command register
Command Flash section Description Value Flash lock
ERASE
(1)
1. Please refer to Note: on page 31 for system clocking constraints associated to this command.
Program memory Erase page defined by register ADDRESS. 0x11 Blocked
MASSERASE
(1)
Program memory Mass erase (Flash is completely erased). 0x22 Allowed
WRITE
(1)
Program memory
Program one location (defined by registers DATA
and ADDRESS).
0x33 Blocked
MASSWRITE
(1)
Program memory
Program all locations. With the same value (DATA
register value).
0x44 Allowed
MASSREAD Program memory
Read all locations and compare with DATA register
value or produce LFSR signature.
0x55 Blocked
SLEEP Put Flash in sleep mode. 0xAA Allowed
WAKEUP Get Flash out of sleep mode. 0xBB Allowed