Hi
To temporarily unsecure the device (until next reset) the backdoor keys can be used. This has to be performed by the program though since the debugger has no access in the secured state.
If you have secured a device and have no way to unsecure it in the program that is loaded (eg by commanding a mass erase) the only way to do it is via EZPORT and commanding a mass erase that way. The debugger (CFFlasher or other methods) will not work since the BDM is not active.
Search the forum for some programs that can be used to unlock FLASH via EZPORT. It is usually necessary to have a second board running the program connected via the EZPORT (much like a SPI connection).
Regards
Mark
www.uTasker.com