GD32A50x User Manual
62
1. Set Shared RAM to fast program mode by configuring the SRAMCMD bits to "01".
2. Check the row (32 double-word) in flash to confirm all data in flash is all 0xFF. The
check blank command can be used to check the page the row in.
3. Unlock the FMC_CTLx register if necessary.
4. Check the BUSY bit in FMC_STATx register to confirm that no flash memory operation
is in progress (BUSY equals to 0). Otherwise, wait until the operation has finished.
5. Set the FSTPG bit in FMC_CTLx register.
6. Write the one row data(32 double-word) to be programed by BUS with desired
absolute address (0x08XX XXXX). The 32 double-word should be written sequentialy
and continuously. Or else the PGERR bit in FMC_CTLx register will be set after setting
the START bit.
7. Set START bit to launch fast program operation to flash.
8. Wait until all the operations have been finished by checking the value of the BUSY bit
in FMC_STATx register.
9. Read and verify the Flash memory if required using a BUS access.
It is recommended
to flush the cache if cache is enabled.
When the operation is executed successfully, the ENDF in FMC_STATx register is set, and
an interrupt will be generated if the ENDIE bit in the FMC_CTLx register is set. In sequential
fast programming, if the row is confirmed erased, repeat 6~8 to fast program next row.
The program operation will be ignored on erase / program protected pages and WPERR bit
in FMC_STATx will be set.
In these conditions, a flash operation error interrupt will be generated if the ERRIE bit in the
FMC_CTLx register is set. The software can check the PGSERR / PGAERR / WPERR /
PGERR bit in the FMC_STATx register to detect which condition occurred in the interrupt
handler.
Figure 2-4. Process of fast programming operation
operation flow.