KL17Z Flash Security Protection FPROT and FSEC using fsl_flash KDS component

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

KL17Z Flash Security Protection FPROT and FSEC using fsl_flash KDS component

Jump to solution
1,326 Views
sys
Contributor III

Hi all,

I'm using MKL17Z256VFM4 on KDS for our project: for data storage I'm using the high-level component "fsl_flash" provided with Kinetis SDK driver.

I have this question: how should I do to protect the whole code-flash area? I mean, how to set FPROT register from Flash Configuration Field, that then affects FTFA_FSEC register?

On datasheet I read that it has to be set in the boot/reset sequence, so I think not in main.c module, am I right?

But, I dont see any way to pre-set the FPROT register directly from Processor Expert.

I see this setting in the low-level "Init_FTFL", but I cannot set it in the high-level one, and I dont want to have to use low-level component.

How can I do?

Thanks in advance!

Sandro

Labels (1)
0 Kudos
1 Solution
764 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Sandro,

I've also created a demo for KL17, finally I found out a easily way to set the FTFA_FPROTn register just as the Fig 1 illustrates.

2015-10-27_10-44-59.jpg

                                                                          Fig 1

Hope it helps,

Have a great day!

Ping

View solution in original post

0 Kudos
4 Replies
764 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Sandro,

I'd highly recommend that you can refer to the flash_demo for FRDMKL27Z in the KSDK 1.2 which illustrates various operations of the flash.

Please go for download the KSDK through the link as below.

Software Development Kit for Kinetis MCUs|Freescale
Have a great day,
Ping

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

0 Kudos
764 Views
sys
Contributor III

Thanks for the answer Ping,

I just tooked a look at the flash_demo before asking the question...but I didnt find what I'm looking for.

In the demo, there is examples on how to UNPROTECT the flash, programming the FSEC register.

What I dont understand is how I PROTECT the flash before reset, i.e. how to set the FSEC register during binary download (so "directly" on building the .elf file)

Just to be clear: on MKE02Z Processor Expert (Cpu component) there is the Flash Configuration Field options...is there a similar way to do it?

Sorry for the mess,

thanks in advance

Sandro

0 Kudos
765 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Sandro,

I've also created a demo for KL17, finally I found out a easily way to set the FTFA_FPROTn register just as the Fig 1 illustrates.

2015-10-27_10-44-59.jpg

                                                                          Fig 1

Hope it helps,

Have a great day!

Ping

0 Kudos
764 Views
sys
Contributor III

Dear Ping,

great! This solves perfectly my problem! :-)

thanks a lot!

:smileyhappy:

Sandro

0 Kudos