How to protect flash on MKL17Z256VLH4?

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

How to protect flash on MKL17Z256VLH4?

823 次查看
pcpro178
Contributor III

Can anyone tell me if this would be a proper implementation for protecting the program flash from JTAG reads?  The functions used here are taken straight from the Kinetis SDK v2.0 API Reference Manual (KSDK20APIRM).  It's got some good information on individual API functions, but not much on wider implementation.

flash_protection_state_t protectionState;
stat = FLASH_IsProtected(&Config, 0, 0x40000UL, &protectionState);
stat = (kStatus_FLASH_Success == stat) ? kStatus_Success : kStatus_Fail;

pstat.valueLow32b = (pflash_protection_status_low_t)UINT32_MAX;
if ((kStatus_FLASH_Success == stat) && (kFLASH_ProtectionStateProtected != protectionState))
stat = FLASH_PflashSetProtection(&Config, &pstat);

标签 (1)
标记 (1)
0 项奖励
回复
1 回复

688 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jim,

   Actually, this is very simple.

   In your application project, you just need to modify the flash configuration field in the flash address 0x400.

   Please tell me what the IDE you are using, then I will give you an example for your reference.


Have a great day,
Kerry

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

0 项奖励
回复