BAT32G1x9 user manual | Chapter 35 FLASH control
1147 / 1149
Rev.1.02
35.4 Flash operation method
35.4.1
Sector erase
sector erase, the erase time is implemented by hardware and can also be configured via FLSERCNT. The
operation process is as follows:
1)
Set up FLERMD. ERMD0 is 1'b0, select thesector erase mode, and set the value of ERMD 1 according
to whether hardware verification is required;
2)
Set FLPROT to 0xF1 to de-protect FLOPMD. Then set FLOPMD1 to 0x55 and FLOPMD2 to 0xAA
3)
Write arbitrary data to the first address of the wiped targetsector. Example: *((unsigned long *)
0x00000200)=0xffffffff.
4)
Software query status register FLSTS. OVF, when OVF=1, indicates that the erase operation is
complete.
5)
If hardware verification after erase (ERMD1=1) is set, FLSTS.EV F can be determined by the software
to check whether the verification is correct.
6)
Before proceeding to the next operation, the software sets "1" to clear FLSTS.
Start
unlock protection
register
Set page erase mode
starting address write as
0xFFFFFFFF
erase ends