What is the right way to use FTFE_FlashConfig on Kinetis K60?

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

What is the right way to use FTFE_FlashConfig on Kinetis K60?

Jump to solution
822 Views
SergeMaslenniko
Contributor II

Hello!

I need to prevent my firmware from downloading from the MCU (Kinetis K60).

For this purpose I want to set 00 or 11 on FSEC.

What is the right way to use FTFE_FlashConfig?

Do I need read the whole sector of the flash, correct the certain values and finally write it into the flash or there is another way to replace FSEC value?

Thank you in advance.

Yours faithfully,

Serge

0 Kudos
1 Solution
502 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Serge,

The FSEC is used to prevent external access to flash resource, which includes debug and EzPort, and the content of FSEC[SEC] bits are loaded from flash config field out of reset,  so the values in flash config field should be defined in the target image before you program it into the device, you needn't do it in the run time. For example, if you use PE in CW 10.4, you do set it up in the following view:

1.PNG

but if you just want to prevent the firmware from erase operation, you may use FTFL_FPROTn instead, these registers are used to protect program flash regions from program and erase operations, the contents of these registers are also loaded from flash config field out of reset, and can even be modified after that. Please note, you may put an area from unprotected to protected state , but backwards operation is ignored.

Hope that helps,

B.R

Kan

View solution in original post

0 Kudos
1 Reply
503 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Serge,

The FSEC is used to prevent external access to flash resource, which includes debug and EzPort, and the content of FSEC[SEC] bits are loaded from flash config field out of reset,  so the values in flash config field should be defined in the target image before you program it into the device, you needn't do it in the run time. For example, if you use PE in CW 10.4, you do set it up in the following view:

1.PNG

but if you just want to prevent the firmware from erase operation, you may use FTFL_FPROTn instead, these registers are used to protect program flash regions from program and erase operations, the contents of these registers are also loaded from flash config field out of reset, and can even be modified after that. Please note, you may put an area from unprotected to protected state , but backwards operation is ignored.

Hope that helps,

B.R

Kan

0 Kudos