Kinetis controller in secure state

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

Kinetis controller in secure state

跳至解决方案
5,314 次查看
epoc
Contributor I

I'm working with the Kinetis K60 tower system, IAR EWB and built-in OSJTAG debugger. During a 'download and debug' I inadvertently put the controller in the 'secure' state. I believe I had the wrong configuration file selected. I know have all of the original working setting restored and am no longer able to interface with the controller. How do I get the controller out of the secure state?

0 项奖励
回复
1 解答
2,022 次查看
mjbcswitzerland
Specialist V

Hi

 

Do you know exactly which settings were configured?

 

The Kinetis has a protection mode which blocks a mass erase, which is unrecoverable. The goal of this protection mode is to ensure that it is not possible to program any further software to a protected device - this avoids the possibility of programming a software containing a trojian (or similar) into a device that has shipped (in this state) as part of a product.

 

This is quite an extreme protection mechanism which may be of interest in a few applications but developers have to be very careful not to accidently set it, otherwise it will be necessary to replace the device to be able to continue with development. When developing small pieces of new code it is useful to work from SRAM (since the K60 has enough for quite interesting things). When programming to FLASH one has to be careful what is at the addresses 0x400..0x40f - Rowely Crossworks (for example) doesn't program this area by default and so protects against inadvertently setting a configuration that may be critical.

 

Regards

 

Mark

 

uTasker for Kinetis

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,022 次查看
egoodii
Senior Contributor III

One solution that worked for me:

 

The tools J-Link/J-Trace have a special 'commander mode' command 'unlock kinetis' that does the job!

 

Earl

2,022 次查看
d_shah
Contributor II

Earl,

 

As per the IAR site (link below) It works only if the device is configured with  "Flash Security enabled", if  "Mass Erase is disabled" device can not be recovered from locked state.

 

http://supp.iar.com/Support/?note=77989

 

If there is any other alternative, please suggest.

 

d2v0

2,023 次查看
mjbcswitzerland
Specialist V

Hi

 

Do you know exactly which settings were configured?

 

The Kinetis has a protection mode which blocks a mass erase, which is unrecoverable. The goal of this protection mode is to ensure that it is not possible to program any further software to a protected device - this avoids the possibility of programming a software containing a trojian (or similar) into a device that has shipped (in this state) as part of a product.

 

This is quite an extreme protection mechanism which may be of interest in a few applications but developers have to be very careful not to accidently set it, otherwise it will be necessary to replace the device to be able to continue with development. When developing small pieces of new code it is useful to work from SRAM (since the K60 has enough for quite interesting things). When programming to FLASH one has to be careful what is at the addresses 0x400..0x40f - Rowely Crossworks (for example) doesn't program this area by default and so protects against inadvertently setting a configuration that may be critical.

 

Regards

 

Mark

 

uTasker for Kinetis

0 项奖励
回复
2,022 次查看
epoc
Contributor I

Thank you Mark,

 

It looks like I ended up writing to the register that blocks mass erase. It just so happens that the data written to that location was just right to set it in that mode. I'm currently working toward replacing the controller on the TWR-K60N512 dev. board I'm working with. Thank you for the tip on using RAM during the development cycle. This is my first foray into using Freescale controllers, ARM and highly integrated 32-bit devices. It's been quite the learning curve. Thank you

0 项奖励
回复