FLASH_OB_EnableWRP() function
Enable the write protection of the desired bank1 or bank 2 sectors
Arguments
WRPSector
specifies the sector(s) to be write protected. This parameter can be one of the following values: @arg WRPSector: A value between OB_WRP_SECTOR_0 and OB_WRP_SECTOR_23 @arg OB_WRP_SECTOR_All
Banks
Enable write protection on all the sectors for the specific bank This parameter can be one of the following values: @arg FLASH_BANK_1: WRP on all sectors of bank1 @arg FLASH_BANK_2: WRP on all sectors of bank2 @arg FLASH_BANK_BOTH: WRP on all sectors of bank1 & bank2
Return value
HAL FLASH State
Notes
When the memory read protection level is selected (RDP level = 1), it is not possible to program or erase the flash sector i if CortexM4 debug features are connected or boot code is executed in RAM, even if nWRPi = 1 Active value of nWRPi bits is inverted when PCROP mode is active (SPRMOD =1). BANK2 starts from OB_WRP_SECTOR_12