I never protect the FLASH memory but this time it is my client requirement. I have my own bootloader and the application ready. Everything works fine if the protection level is zero. But if I switch it (it does not matter if I use ST-LINK utility or it is done from the bootloader) to the Level 1 the program just do not work. I know that is ridiciolus to say "program does not work" - but during the tests I wrote simple LED blinking program. It only enables the GPIO clock and toggles the LED. It works fine on level 0, but stops working on Level1. As I understand switching from level 0 to 1 or 2 does not erase the FLASH (it does in the opposite direction). I cant take a look inside as any debug interfaces are disabled.
Boot 0 is connected via 10k resistor to the GND.