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);
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!
-----------------------------------------------------------------------------------------------------------------------