I am developing a K20 board with Keil and IAR. In this morning, I have programmed three chips, except one for being locked.
First of all, I can try to access target K20 with CMSIS-DAP for communication, all of them can be detected in Keil MDK.
The SWDIO is: 0x2BA01477,
If I remove the target, this SWDIO will be "SWD/JTAG Communication Failure".
If I connect it to KL25Z on board, the SWDIO will be "0x0BC11477".
By this setup dialog, I know the K20 is hooked up.

Then I tried "Erase" command from pull down menu.

The system warns me: Kinetis Device is locked and it will execute Mass Erase command. So I click OK.

Another warning, can not access memory.

Finally, it warns me Flash Erase failed.

Then I tried it in IAR EWW 6.7. Same result for Erase all command. With different warning message: Reading CPU status failed.

Here is the full log message, it shows DAP access for reset is failed.
Hardware
I have checked PTA4(NMI_b/EZP_CS_b), it has 10K pull up, so it is 3V3. And crystal, USB and power supply are good.
Any idea why it is locked? The K20 is a brand new one from FSL sample service. Should I use JLINK? Or USBDM for K to unlock it?
I am wondering how often locking issue happens? Why can I detect it via DAP in MDK, but failed in IAR?