We have locked several MK21FN1M0V12 devices because of a bad writing in internal flash. The Flash Configuration Field has been improperly set, resulting in the chip security being enabled.
We are working on the board with CodeWarrior for MCU v10.6 running on Windows.
We have tried several things but nothing succeeded. Here is a summary:
Since Mass Erase is still enabled, it should be possible, theoretically, to reset the FCF.
It seems it fails because the core is in a "reboot" loop since garbage has been written to flash (invalid code and/or bad stack pointer etc). Could it be that the procedure fails because the core cannot be halted?
Finally, there is no "reset" button on the board. Would a reset button have helped here?
Thanks and best regards.
Hi olivier capron,
If the chip mass erase still enabled, the chip can do the mass erase, then you can unlock it.
Now, please use the JLINK debugger with the JLINK commander window, follow my step:
1. connect the chip, choose the correct part number.
2. input: unlock kinetis
Wait the unlocking device is ok
3. input:r
to reset the chip.
4.input:mem 0x400,0x10
Just to check the flash configuration field, to check the flash data.
Please follow my step, and post your result.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello,
Thank you for your support.
Unfortunately, as mentioned in our question, we already had tried this without success. Please find attached a capture showing the result.
As already explained, we tried to manually trigger a mass erase using the MDM-AP Control register, which is accessible. But the mass erase does not occur. It seems that the core is constantly resetting and thus cannot perform the erase. What do you think?
Thanks and best regards,
Hi oliver capron,
Please refer to this question post:
K22 RESET line: Is a pull-up and a cap required?
There has a document about the lock, check that document, whether you meet the according requirement at first?
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------