STM32 RDP2 prevents the modification of OPTLOCK?
Hi everyone,
we have a bootloader that writes new application code to the flash bank 2 in an STM32H7 and afterwards swaps the banks to execute the new code. The procedure for swapping is something like this:
unlock OPTLOCK
set SWAP_BANK_OPT
set OPTSTART
lock OPTLOCK
system reset
This works fine with a Level 0 readout protection (RDP). However it is not working with a RDP level 2.
The reference manual states that only the SWAP_BANK_OPT bit is adjustable when RDP2 is set. It also states that you have to unlock OPTLOCK before changing SWAP_BANK_OPT.
Does this mean if OPTLOCK is set (locked) when RDP2 is active you can not change SWAP_BANK_OPT since you can not modfiy OPTLOCK?
So the solution to use SWAP_BANK_OPT would be to unlock OPTLOCK before activating RDP2?
Is there any other reason that would prevent IAP when RDP2 is set?
