| Electronic Components Datasheet Search |
|
PM0068 Datasheet(PDF) 14 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
PM0068 Datasheet(HTML) 14 Page - STMicroelectronics |
|
14 / 31 page ![]() Reading/programming the STM32F101xF/G and STM32F103xF/G embedded Flash memory 14/31 Doc ID 17100 Rev 2 FPEC preliminarily reads the value of the addressed option byte and checks that it has been erased. If not, the program operation is skipped and a warning is issued by the PGERR bit in the FLASH_SR register. The end of the program operation is indicated by the EOP bit in the FLASH_SR register. The FPEC takes the LSB and automatically computes the MSB (which is the complement of the LSB) and starts the programming operation. This guarantees that the option byte and its complement are always correct. The sequence is as follows: ● Check that no Flash memory operation is ongoing by checking the BSY bit in the FLASH_SR register. ● Unlock the OPTWRE bit in the FLASH_CR register. ● Set the OPTPG bit in the FLASH_CR register. ● Write the data (half-word) to the desired address. ● Wait for the BSY bit to be reset. ● Read the programmed value and verify. When the Flash memory read protection option is changed from protected to unprotected, a Mass Erase of the main Flash memory is performed before reprogramming the read protection option. If the user wants to change an option other than the read protection option, then the mass erase is not performed. The erased state of the read protection option byte protects the Flash memory. Erase procedure The option byte erase sequence (OPTERASE) is as follows: ● Check that no Flash memory operation is ongoing by reading the BSY bit in the FLASH_SR register. ● Unlock the OPTWRE bit in the FLASH_CR register. ● Set the OPTER bit in the FLASH_CR register. ● Set the STRT bit in the FLASH_CR register. ● Wait for BSY to reset. ● Read the erased option bytes and verify. 2.4 Protections The user area of the Flash memory can be protected against read by untrusted code. The pages of the Flash memory can also be protected against unwanted write due to loss of program counter contexts. The write-protection granularity is two pages. 2.4.1 Read protection The read protection is activated by setting the RDP option byte and then, by applying a system reset to reload the new RDP option byte. Note: If the read protection is set while the debugger is still connected through JTAG/SWD, apply a POR (power-on reset) instead of a system reset (without debugger connection). |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |