
Rev. 1.00
46 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
4 Flash Memory Controller (FMC)
Booting Configuration
The system provides two kinds of booting modes which can be selected using the BOOT pin. The
BOOT pin status is sampled during the power-on reset or system reset. Once the logic value is
decided, the first 4 words of vector will be remapped to the corresponding source according to the
booting mode. The booting modes are shown in the following table.
Table 7. Booting Modes
Booting Mode Selection Pin
Mode
Descriptions
BOOT
0
Boot Loader
The vector source is Boot Loader
1
Main Flash
The vector source is main Flash
The Flash Vector Mapping Control Register, VMCR, is provided to change the vector remapping
setting temporarily after the chip reset. The initial reset value of the VMCR register is determined
by the BOOT pin status which will be sampled during the reset duration.
Hard Fault Handler
NMI Handler
Program Counter
Initial Stack Point
0x0
0x4
0x8
0xC
0x0000_0000
+ 0x4
+ 0x8
+ 0xC
0x1F00_0000
+ 0x4
+ 0x8
+ 0xC
1 : Main Flash
0 : Boot Loader
Boot Setting
Figure 9. Vector Remapping
Page Erase
The FMC provides a page erase function which is used to reset partial content of the Flash memory.
Any page can be erased independently without affecting others. The following steps show the page
erase operation register access sequence.
1. Check the OPCR register to confirm that no Flash memory operation is in progress (OPM [3:0] is
equal to 0xE or 0x6). Otherwise, wait until the previous operation has been finished.
2. Write the page address to the TADR register.
3. Write the page erase command to the OCMR register (Set CMD [3:0] = 0x8).
4. Commit the page erase command to the FMC by setting the OPCR register (Set OPM [3:0] =
0xA).
5. Wait until all the operations have been completed by checking the value of the OPCR register
(OPM [3:0] is equal to 0xE).
6. Read and verify the page if required.