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

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

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

跳至解决方案
872 次查看
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 项奖励
1 解答
552 次查看
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 项奖励
1 回复
553 次查看
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 项奖励