You can enable RDP from within your code by writing to the option bytes (see the Flash Programming Manual for your MCU series for the bit assignments.)
As for DISabling RDP, "fuggedabouddit." Transitioning from RDP 1 to RDP 0 mass-erases the flash by design. Transitioning from RDP 2 to RDP 1 or 0 is supposed to be impossible, it's a one-way trip that permanently disables JTAG.
A post from 9 years ago likely refers to the F1 implementation, where RDP 2 doesn't exist, and JTAG isn't locked.
The 7 year date of the second post reflects the date the forum previously melted down, the top level post date reflects the true age. Can we please not resurrect zombie threads unless there is some strong reason to do so.
Sorry about that; I saw a very recent post on F1 RDP vulnerabilities, and didn't notice the year on this posting.
Retrieving data ...