I have made a custom board with a MK64FN1MOVLL12 MCU, the board is based on the FRDM-K64F dev board..
I have tried using the freedom board with J-link loaded on it as a programmer, which worked in the beginning.
But now it seems that I have locked the MCU accidental, as it now says it is in secure mode.
My problem is that I can't get it out of secure mode, I have tried J-Flash Lite's unlock/erase, but it times out.
Also JLink Commander's unlock function timesout (unlock kinetis).
I have even tried activating a mass erase manually, by writing to the control register, but nothing happens.
when trying to unlock from KDE I get following message in the console
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link OpenSDA 2 compiled Oct 13 2015 12:10:27
Hardware: V1.00
S/N: 621000000
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...ERROR: Kinetis (connect): Timeout while unsecuring device. Erase never starts.
Kinetis (connect): Failed to unsecure Kinetis device.
ERROR: Error while identifying Cortex-M core.
ERROR: Could not connect to target.
Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
Shutting down...
Have I somehow bricked the board, or am I missing something to fix this?
When reading the MDM-AP status register I get either 0x00000036 or 0x00000034 (found via swdreadap 0 in jlink)
The custom MCU's reset pin is pulsing with 71kHz, which I figure is the watchdog messing around