读没啥好说的,关心擦写吧。
这个手册上都讲得详细了,先FLASH开锁,
The main Flash memory programming sequence in standard mode is as follows:
1.Check that no main Flash memory operation is ongoing by checking the BSY bit in the FLASH_SR register.
2. Set the PG bit in the FLASH_CR register.
3. Perform the data write (half-word) at the desired address.
4. Wait until the BSY bit is reset in the FLASH_SR register.
5. Check the EOP flag in the FLASH_SR register (it is set when the programming operation has succeeded), and then clear it by software.