How to protect flash on MKL17Z256VLH4?

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

How to protect flash on MKL17Z256VLH4?

430 Views
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);

Labels (1)
0 Kudos
1 Reply

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