Any updates about this? I’m facing the same problem with a custom board. I have configured rdp to 0xaa but at flash time I get this error:
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_es3Vq7.srec
File : ST-LINK_GDB_server_es3Vq7.srec
Size : 113.66 KB
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 56]
Error: failed to erase memory
Error: failed to erase memory
Thanks.