When I build my application I received the message, "Device is secure. Erase to unsecure?" What do I do?

Most microcontroller offer different levels of protection, usually with special configuration registers and settings:

Depending on the device/flash features, CodeWarrior provides Protect/Unprotect and Secure/Unsecure target task actions of the flash programmer:

Figure 1. Protect/Unprotect, Secure/Unsecure Target Task Actions

Protect/Unprotect, Secure/Unsecure Target Task Actions

In case during development you wrote/selected wrong settings to your device, and with this accidentally secure it. And if your wrong settings includes disable mass erase as well, you will not be able to recover your device anymore. So you have to be very careful not to secure any devices as this might be a permanent thing, unless your settings requires so.

Note: Connecting to the wrong device might trigger a false alarm about the device being secured. To avoid getting this message accidentally, always carefully check to which board/device you are connecting.