Unable to unlock K64F

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to unlock K64F

2,716 Views
frederiknielsen
Contributor I

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

Labels (1)
0 Kudos
Reply
5 Replies

1,771 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

Do you mean the FRDM-K64 board can not connect or your custom board ?

If the FRDM-K64 board , please copy and pest the “Jlink_OpenSDA_v2.bin” to the bootloader mode of the board,

then use the OpenSDA (j16 pin) to test , check whether it can work well .

If you want erase the chip , you can entry "unlock kinetis" on the J-Link Commander :

pastedImage_0.png

Hope it helps

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Have a great day,
Alice

0 Kudos
Reply

1,771 Views
frederiknielsen
Contributor I

FRDM-K64F can connect to the board fine, with Jlink interface, it's the "unlock kinetis" function that won't work.

As also shown in the console output in my first post, all normal way to unlock the MCU seems to fails

0 Kudos
Reply

1,771 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Frederik,

In your first post , i see it show connect to target error :

pastedImage_0.png

so how do you know it can connect the board well ?

I recommend you copy and past the "Jlink_OpenSDA_v2.bin” to the bootloader mode of the board , then have a try .

IF it still can not work well , please show the how do you operation and the new information in the console window .

BR

Alice

0 Kudos
Reply

1,771 Views
frederiknielsen
Contributor I

I already had the Jlink bootloader, but installed the one you linked to anyway..

Correct it seems to not connect now, but I have been able to connect and program this board before.

Anyway, here is a screen of trying the "unlock kinetis" feature in Commander.

unlock1.png

The reason I still assume I have connection to the MCU, is that I can get results from the MDM-AP status register

unlock2.png

The change in readout is because the watchdog is resetting the MCU with 71kHz

0 Kudos
Reply

1,771 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

I think your chip has disalbe mess erase function , so it can not erase or write now.

I recommend you contact the local FAE and send back to FSL .

BR

Alice

0 Kudos
Reply