Trouble with security flash on KL46Z

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

Trouble with security flash on KL46Z

跳至解决方案
3,645 次查看
frdmcharly
Contributor III

Hello Freescale Community! I'm using a FRDM-KL46Z and enabling the security flash option on the "Component Inspector - CPU". Which is the way to download the program on the board?

 

If I download the program with "Run", CW asks me "Device is secure. Erase to unsecure?" then I click yes and the console say:

 

INF: CMD>RE

INF: Initializing.

INF: Device is Secure.

INF: Device is secured. Erasing ...

INF: Target has been RESET and is active.

 

But the program never starts running on the board. Somebody knows why?

 

If I download the program with "Flash File To Target" choosing:

 

* The correct connection

* Flash configuration file: KL46Z256M4.xml

* The .elf of the program on file to flash

 

Clicking on "Erase and Program" the program downloads to the board and runs well after pressing the reset button... but when I try the attach option in debug mode, it allows me to debug as if the security flash option is disabled.

标签 (1)
标记 (4)
0 项奖励
回复
1 解答
3,183 次查看
frdmcharly
Contributor III

Hello Jorge! Thanks for your reply!

Correct, the way to download a program with security flash option enabled is throwing the "Flash File To Target" choosing:

* The correct connection

* Flash configuration file: KL46Z256M4.xml

* The .elf file of the program on "file to flash"

But! Before clicking on "Erase and Program" it's necessary "Erase Whole Device". If you don't erase the whole device it's then permitted to enter the debug mode even if the security mode is enabled.

在原帖中查看解决方案

0 项奖励
回复
5 回复数
3,183 次查看
frdmcharly
Contributor III

In the document "Using the Kinetis Security and Flash Protection Features" at FSEC field description says when "FSEC[SEC] = 01" the "MCU security status is secure" then the debug mode must be disabled, but I still can get access the debug mode, somebody know why?

FSEC_K20_Debug.png

Please help me :-/ !

0 项奖励
回复
3,181 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Carlos,

I just made a video that shows how flash secure works. see attached.

can this help you?


Have a great day,
Zhang Jun

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

0 项奖励
回复
3,181 次查看
frdmcharly
Contributor III

Hi Zhang Jennie! Thanks for your video, but doing those steps, even after pressing restart button, the program never starts on the board.

Do you know why? Maybe I need doing something else, or download the program to the board in a different way.

0 项奖励
回复
3,181 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Carlos Miguens:

From Processor Expert set the security bits to "00". Then use the "Flash file to target" instead of the debugger to load the .elf as you did before.

Then try to launch an "Attach" or "Connect" debug configuration. You should not be able to access the KL46.


Regards!,
Jorge Gonzalez

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

3,184 次查看
frdmcharly
Contributor III

Hello Jorge! Thanks for your reply!

Correct, the way to download a program with security flash option enabled is throwing the "Flash File To Target" choosing:

* The correct connection

* Flash configuration file: KL46Z256M4.xml

* The .elf file of the program on "file to flash"

But! Before clicking on "Erase and Program" it's necessary "Erase Whole Device". If you don't erase the whole device it's then permitted to enter the debug mode even if the security mode is enabled.

0 项奖励
回复