Trouble with security flash on KL46Z

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

Trouble with security flash on KL46Z

Jump to solution
1,415 Views
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.

Labels (1)
0 Kudos
1 Solution
953 Views
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.

View solution in original post

0 Kudos
5 Replies
953 Views
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 Kudos
953 Views
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 Kudos
953 Views
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 Kudos
953 Views
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!
-----------------------------------------------------------------------------------------------------------------------

954 Views
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 Kudos