I want use 16 byte flash as data that I can write some run time data as parameter even when system power off.
but there are some question I want ask.
1. If system already set FSEC to 0xFF (Protection, as I check the manual, it seems ca only erase all & can't erase
block ), there is any other method can archive let 16 byte flash as data that I can write some run time data as
parameter even when system power off.
2. Can I set the security bit to disable then do the 16 byte operation when it complete then set the security bit enable ?
or can I use the program once file as data to store ?
Tiger Lo
Hello Tiger Lo,
1. If system already set FSEC to 0xFF (Protection, as I check the manual, it seems ca only erase all & can't erase
block ), there is any other method can archive let 16 byte flash as data that I can write some run time data as
parameter even when system power off.
Answer: FSEC is used for security, not the flash protect. You can find more details from the KL03 reference manual:
You can find, flash security is used for the programmer interfaces, if you use the internal code to operate the flash, it won't be influenced.
You can use your code erase and write the flash.
2. Can I set the security bit to disable then do the 16 byte operation when it complete then set the security bit enable ?
Answer, security has no relationship with your 16 byte operation, you can use one flash sector as your own data store area.
3.can I use the program once file as data to store ?
Answer: No, program once area is just can program one times, then you can't modify it. So I suggest you still use one flash sector as your own data area.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Kerry,
As your opinion security FSEC =0xFF it is irrelevant with flash sector erase/write/read which used internal flash code , right ?
As I use the KL03 development system to develop some flash code, I can't set FSEC equal to 0xFF, otherwise it won't let me download code.
so I can't test this condition, thanks for your opinion.
the other issue is I check the code , there is backdoor enable/disable , what's condition need use backdoor enable/disable function ?
// Check security status.
result = FlashGetSecurityState(&flashSSDConfig, &securityStatus);
if (FTFx_OK != result)
{
error_trap();
}
// Print security status.
switch(securityStatus)
{
case FLASH_NOT_SECURE:
PRINTF("\r\n Flash is UNSECURE!");
break;
case FLASH_SECURE_BACKDOOR_ENABLED:
PRINTF("\r\n Flash is SECURE, BACKDOOR is ENABLED!");
break;
case FLASH_SECURE_BACKDOOR_DISABLED:
PRINTF("\r\n Flash is SECURE, BACKDOOR is DISABLED!");
break;
default:
break;
}
Tiger Lo.
Hello Tiger Lo,
1. As your opinion security FSEC =0xFF it is irrelevant with flash sector erase/write/read which used internal flash code , right ?
Yes, it just relevant with the Debug interface.
2. As I use the KL03 development system to develop some flash code, I can't set FSEC equal to 0xFF, otherwise it won't let me download code.
Actually, after you secure it, when you want to download it, you need to do the mass erase at first, you can use the JLINK command, and input: unlock kinetis
If you are using P&E debugger ,and KDS, in the debug configuration, you can select the mass erase, then you will can download it.
3. Backdoor
It is used for the customer which want to secure the chip, but still leave a backdoor to themselves, then use the key to unlock it.
More detail, I think you can read the reference manual, flash chapter.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Kerry.
I use P&E debugger ,and Keil , in configure debug tool , there seems no mass erase, or Do I miss in somewhere ?
Tiger Lo.
Hello Tiger Lo,
Yes, in MDK, P&E debugger interface, I also didn't find the mass erase option, the MDK may didn't add this function for P&E tool.
Maybe you can use the JLINK debugger or KDS with P&E debugger tool to do the mass erase.
Wish it helps you
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Kerry,
Thanks for your help, I try some function.
Tiger Lo.