My hardware design doesn't connect the BOOT0-Pin to a specific voltage level. That's why I need to write to the OPTR Register so that the BOOT0-Pin is not read at the boot sequence.I check the OPTR Register:FLASH->OPTR = ffeff8aa
RDP = aa
...
I found something related here: Unlock readout protectionIt first unlocks the Flash itself with HAL_FLASH_Unlock()Now it works!Here is the almost working example (it writes to OPTR Register but also reloads the program somehow):FLASH_OBProgramInitTyp...