GD32F10x User Manual
51
The following steps show the erase sequence.
Unlock the FMC_CTL0 register if necessary.
Check the BUSY bit in FMC_STAT0 register to confirm that no Flash memory operation
is in progress (BUSY equal to 0). Otherwise, wait until the operation has finished.
Unlock the option bytes operation bits in FMC_CTL0 register if necessary.
Wait until OBWEN bit is set in FMC_CTL0 register.
Set OBER bit in FMC_CTL0 register.
Send the option bytes erase command to the FMC by setting the START bit in
FMC_CTL0 register.
Wait until all the operations have been finished by checking the value of the BUSY bit in
FMC_STAT0 register.
Read and verify the flash memory if required using a DBUS access.
When the operation is executed successful, the ENDF in FMC_STAT0 register is set, and an
interrupt will be triggered by FMC if the ENDIE bit in the FMC_CTL0 register is set.
2.3.8.
Option bytes modify
The FMC provides an erase and then program function which is used to modify the option
bytes block in flash. There are 8 couples option bytes. The MSB is the complement of the
LSB in each pair. And when the option bytes are modified, the MSB is generated by FMC
automatically, not the value of input data. The following steps show the erase sequence.
Unlock the FMC_CTL0 register if necessary.
Check the BUSY bit in FMC_STAT0 register to confirm that no Flash memory operation
is in progress (BUSY equals to 0). Otherwise, wait until the operation has finished.
Unlock the option bytes operation bits in FMC_CTL0 register if necessary.
Wait until OBWEN bit is set in FMC_CTL0 register.
Set the OBPG bit in FMC_CTL0 register.
A 32-bit word/16-bit half word write at desired address by DBUS.
Wait until all the operations have been finished by checking the value of the BUSY bit in
FMC_STAT0 register.
Read and verify the flash memory if required using a DBUS access.
When the operation is executed successfully, the ENDF in FMC_STAT0 register is set, and
an interrupt will be triggered by FMC if the ENDIE bit in the FMC_CTL0 register is set. Note
that the word/half word programming operation checks the address if it has been erased. If
the address has not been erased, PGERR bit in the FMC_STAT0 register will set when
program the address except programming 0x0.
The modified option bytes only take effect after a system reset is generated.
2.3.9.
Option bytes description
The option bytes block is reloaded to FMC_OBSTAT and FMC_WP registers after each
Содержание GD32F10 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F10x Arm Cortex M3 32 bit MCU User Manual Revision 2 6 Jun 2022 ...
Страница 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Страница 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Страница 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Страница 427: ...GD32F10x User Manual 427 value ...
Страница 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...