We are about to enable flash security over the system and flash protection over the bootloader. The process is understood and I have found the functions that are provided for checking security (FLASH_GetSecurityState) and bypassing security using a configured key (FLASH_SecurityBypass) and have implemented them in the code.
The problem is that testing it seems like a one way street where I could easily brick my target. I tried called the backdoor function but there is code in FTFx_CMD_SecurityBypass to bypass the call if security is not enabled. If I comment it out so that it performs the bypass anyway, I get a hard fault (not sure if that is the reason, but that's what happens).
So, I am looking for a suggestion on how to set up some tests of the bypass mechanism without the possibility of bricking my device. My setup is a K81 system with a JLink debugger. I have also coded a mechanism in the firmware to accept the 8 backdoor key bytes via a serial port.
Hi,
Thank you so much for your interest in our products and for using our community.
You can take as reference the following community post:
How correct use of Backdoor Key in FRDM-KL82Z board
Hope it helps you.
Have a nice day!