K20 locked, mass erase failed as well

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

K20 locked, mass erase failed as well

4,255 次查看
kai_liu
Senior Contributor I

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.

K20DetectedInKeilMDK.PNG.png

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

KinetisDeviceLocked.PNG.png

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

KinetisCannotAccessMemory.PNG.png

Another warning, can not access memory.

KinetisFlashErasefailed.PNG.png

Finally, it warns me Flash Erase failed.

IAR_ReadingCPUstatusFailed.PNG.png

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

IAR_ErrorLog.PNG.png

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?

标记 (2)
13 回复数

2,483 次查看
nishantpashine
Contributor I

Is any one listening!

0 项奖励
回复

2,483 次查看
nishantpashine
Contributor I

I'm getting the same Problem in MK20DX256VLH7 via JLINK2 and flashing via SWD mode.

I have connected data via 100K Pull-up, Clk with 100K pull-down and directly connected reset.Untitled.pngUntitled1.pngUntitled2.png

Kindly help.

Attached is the screen shots.

0 项奖励
回复

2,484 次查看
nesrinemhiri
Contributor III

Hi Kai Liu

when i see the EWARm debug log , you use the FlashKx0D!!!.board but you should use the FlashK20Xxxx.board

I hope that can help

have a nice day

Nesrine

2,483 次查看
kai_liu
Senior Contributor I

To be frank, I have not configurate that by myself. It should be selected by default from frdm-k20d50m-demo. I disabled Override default .board file in Debugger | Download tab.

The grey out one is : $TOOLKIT_DIR$\config\flashloader\Freescale\FlashKx0Dxxx16K1K.board

There is no FlashK20Xxxx.board in IAREW v6.7 & v6.5.

I will tried it in EWARM again.

But it failed in MDK as well, which I used mbed source code for testing. I believe it is well configurated.

0 项奖励
回复

2,484 次查看
nesrinemhiri
Contributor III

Hi

you can update the flash loader from the website of embedded IAR

go to help -> Product Updates then download patch

I hope that can help

2,484 次查看
kai_liu
Senior Contributor I

OK, I will try. Thanks.

0 项奖励
回复

2,484 次查看
huishao2
Contributor IV

Hi -

I got similar lock-up issue after issuing "Erase All Blocks Command" (0x44) from my code. My k20d50m can't be programmed anymore by IAR/I-jet.

Below is the error  message I got from IAR.  Just wondering if there is a solution figured out there?

pastedImage_0.png

thanks!

Hui

0 项奖励
回复

2,484 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Kai Liu:

Have you checked if the reset line is oscillating? I ask because you mention it is a new part.

To avoid problems with new parts it is recommended to place a 4.7K - 10K pull-up in the RESET_b line, and also a 100 nF capacitor to ground.


Regards!,
Jorge Gonzalez

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

2,484 次查看
kai_liu
Senior Contributor I

Hi, Jorge,

I have tried your suggestion in two steps.

1) remove 10K to ground, only 4K7 pull up, still locked.

2) add 100nF to ground, still locked.

Only 2.77V DC.

I will tried PEmicro multilink, JLINK clone and CoLinkEx.

Currently SWDIO is accessible, but RAM/ROM access is forbidden. I don't know how to access it in EZP mode. But I think it will be rejected as well.

Thanks for your suggestion.

0 项奖励
回复

2,484 次查看
kai_liu
Senior Contributor I

I have checked the reset pin because I have heard about it.

After reset the RESET_b is high at 2.7V by 4K7/10K divider, no caps to ground. That circuit comes from RESET part of OpenSDA. There are two kinds of reset actually.

RST_OPENSDA.PNG.png

MK20DX128 of OpenSDA is reset directly by resistor divider, 5V * 10/14.7 = 3.4V. I measured the locked one with 2.7V DC, no oscillation output. The other working one is stable at 3.3V. I will replace 10K to ground as 100nF cap to check out difference.

RST_OPENSDA_TGT.PNG.png

EZP_CS_b is high by 10K pull up.

Just a few moment ago, one of my working board is locked as well. I reconnect for several timers, then I found it can be reprogrammed again. I don't know why. However it was a uncertain factor in future production.

Yours sincerely

Allan K Liu

0 项奖励
回复

2,483 次查看
kai_liu
Senior Contributor I

UPDATE for JLINK on OpenSDA

I used JLINK Lite of openSDA to test, either in Keil MDK and JLINK commander.

MDK, mass erase failed, timeout for response.

JLINK commander, can read out SWDIO as well, but mass erase never starts up due to timeout.

I think SWDIO can be read out no matter the chip is secured or not.

I will try PEMicro multilink JTAG port to access it tomorrow.

0 项奖励
回复

2,483 次查看
kirukicosmas
Contributor I

Hello Kai and Jorge,

I am following your correspondence keenly because am facing same problem with KM33Z128CLH5.

However, the target chip is being said to be secured and needs mass erase.However, this mass erase is not successful. I have tried with CodeWarrior, CrossStudio and USBDM ARM programmer.I have tried various suggestions like pulling the reset pin to ground while mass erasing but no success it.

I need help on how to view the MDM-AP Control Register either on Codewarrior or CrossStudio to see whether the chip is indeed secured.

Do I issue commands or is it a simple code/script that I need?

regards,

Cosmas.

0 项奖励
回复

2,484 次查看
kai_liu
Senior Contributor I

May I know your programming failure rate among your chips?

BTW, FSL micro should embedded a small bootloader like others did. At least, we can program user code regardless of debugger issue.

0 项奖励
回复