I am working with the STM32f407 : I have a bootloader in the first flash sector (ie. @ 0x0800 0000), and my main program in the following sectors (ie. @ 0x0800 4000). I want to protect my bootloader against unwanted writes, so I used the WRP bits to protect it.
What I've done is write 0xFFFE (ie. Sector 0 with write protection enable) to the 0x1FFF C008 Option Bytes. By reading it back I'm sure that it has been well written. (I'm writing the Option Bytes by DFU using dfu-utils).
After reset I am able to write to sector 0 using either DFU or ST-LINK, which I should not be allowed to.
Am I missing something ?