Hi. Without playing with security, the K64F got into a read protected mode. That's from JLink tool with J-Link OpenSDA
Connecting to target via SWD
InitTarget()
Protection bytes in flash at addr. 0x400 - 0x40F indicate that readout protection is set.
For debugger connection the device needs to be unsecured.
Note: Unsecuring will trigger a mass erase of the internal flash.
Device will be unsecured now.
Timeout while unsecuring device. Erase never starts.
NXP Web Chat suggested to try P&E Recovery Tool. However, after putting PE firmware on the OpenSDA, the recovery tool couldn't find the board.
I'd also like to try with my J-Link Plus, but I couldn't figure out what configuration is needed to use it asides from pluggin the ARM Cortex M connector into the K64 JTAG header J5.
Any other ideas?
Thanks to this answer How to use external J-Link Plus with TWRK64F?, I was able to connect a J-Link Plus externally. Then, I've used the GUI Flash tool in MCUXpresso with the J-Link, and selected the "Resurrect locked Kinetis device", which worked the first time.
So, in my setup, I was (only) able to unlock it using an external J-Link Plus.