
GD32F403xx User Manual
46
8.
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 f unction which is used to modify the option
bytes block in flash. There are 8 pair 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 f ollowing steps show the erase sequence.
1.
Unlock the FMC_CTL0 register if necessary;
2.
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;
3.
Unlock the option bytes operation bits in FMC_CTL0 register if necessary;
4.
Wait until OBWEN bit is set in FMC_CTL0 register;
5.
Set the OBPG bit in FMC_CTL0 register;
6.
A 32-bit word/16-bit half word write at desired address by DBUS;
7.
Wait until all the operations have been finished by checking the value of the BUSY bit in
FMC_STAT0 register;
8.
Read and verify the Flash memory if required using a DBUS access.
When the operation is executed successfully, the END F 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 af ter each
system reset, and the option bytes take effect. The complement option bytes are the opposite
of option bytes. When option bytes reload, if the complement option byte and option byte do
not match, the OBERR bit in FMC_OBSTAT register is set, and the option byte is set to 0xFF.
The OBERR bit is not set if both the option byte and its complement byte are 0xFF.
is the detail of option bytes.
Table 2-2. Option byte
Address
Name
Description
0x1fff f800
SPC
option byte Security Protection value
0xA5 : no security protection
any value except 0xA5 : under security protection
0x1fff f801
SPC_N
SPC complement value
Содержание GD32F403 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F403xx Arm Cortex M4 32 bit MCU User Manual Revision 2 6 Jul 2022 ...
Страница 177: ...GD32F403xx UserManual 177 Peripheral Channel 0 Channel 1 Channel 2 Channel 3 Channel 4 SDIO SDIO ...
Страница 217: ...GD32F403xx UserManual 217 ensures that no conversion is in progress ...