Hi all,
I'm currently working on stm32f4xx controller, i need to protect the flash memory, so i used RDP as stated below, its worked and flash memory was not readable, but after that i was not able to re-program the flash using ULINK Pro or Ulink Me, can you please suggest best way to overcome this.
//HAL_FLASH_Unlock(); HAL_FLASH_OB_Unlock(); FLASH_RDP.RDPLevel = OB_RDP_LEVEL_1; FLASH_RDP.OptionType = OPTIONBYTE_RDP; HAL_FLASHEx_OBProgram(&FLASH_RDP); HAL_FLASH_OB_Launch(); HAL_FLASH_OB_Lock(); HAL_FLASH_Lock();
Thanks.
Heh... "It is critically important that you are sharper than the people who might hack your device"
I gave you working example. I'm using it so I'm sure it works. This text from manual has noting to OptionBytes (really, see NEXT page *1).
(*1) STM32F4xx Reference Manual: page 94 (3.7.3, "Table 17. Access versus read protection level") Access to Read/Write/ERase to "Main Flash Memory and Backup SRAM" in Level 1 is disabled. Next row: "Option Bytes" - in Level 1 you CAN Read/Write/Erase. If you cannot erase that OptionBytes, maybe you set Level 2.