GD32A50x User Manual
68
Check the BUSY bit in FMC_STAT1 register to confirm that no flash memory operation
is in progress (BUSY equal to 0). Otherwise, wait until the operation has been finished.
Unlock the OBWEN bit in FMC_CTL1 register if necessary.
Wait until the OBWEN bit is set in the FMC_CTL1 register.
Write the value to LKVAL / EPLOAD / EPSIZE / EFALC in FMC_OB1CS register.
Write the OB1START in FMC_OB1CS register.
Wait until all the operations have been completed by checking the value of the BUSY bit
in FMC_STAT1 register.
Lauch
a system reset or setting the OBRLD bit in FMC_CTL1 register before accessing
data flash / EEPROM.
Read and verify the flash memory if necessary.
Note:
1.
The option bytes 1 block of flash memory reloaded to FMC_OB1CS registers after each
system reset or OBRLD bit set in FMC_CTL1 register.
2. The modified option bytes 1 effect only after a system reset or setting the OBRLD bit in
FMC_CTL1 register.
3. After the system reset or setting the OBRLD bit in FMC_CTL1 register, if the LKVAL is
0x33CC, the OB1LK bit in FMC_OB1CS register will be set and the option bytes 1 cannot be
modified any more.
4. If the unexpected value is written in option bytes 1, the PGSERR bit will be set after setting
the OB1START bit and the operation will be ignored.
5. To modify the EPSIZE / EFALC bits, the extend flash will be erased by hardware first, then
modify the
option bytes 1.
6. After modifying the option byte 1, it is strongly recommended to perform a power reset.
2.3.17.
Option bytes description
Option bytes 0 description
The option bytes 0 block of flash memory reloaded to FMC_OBSTAT and FMC_WP0 registers
after each system reset or OBRLD bit set in FMC_CTL1 register, and the option bytes 0 work.
The option complement bytes are the opposite of option bytes 0. When option bytes 0 reload,
if the option complement bytes and option bytes 0 does not match, the OBERR bit in
FMC_OBSTAT register is set, and the option byte is set to 0xFF. The
is the detail of option bytes 0.
Table 2-6. Option bytes 0
Address
Name
Description
0x1fff f800
OB_SPC
option bytes 0 security protection value
0xA5 : no security protection