The UCB Flash must be writable to configure the debug password protection.
Using this procedure you may lock the device!
1. Configure winIDEA to use a password via Hardware | CPU Options | SoC.
2. Set a password.
Refer to the winIDEA Help Password protection chapter for a detailed procedure.
Debug Password via Hardware | CPU Options | SoC and Debug Password via UCB plugin are not exactly the same, but their values should be the same otherwise the debug connection to the target is locked.