AnsweredAssumed Answered

"Device is secure. Erase to ensecure?".

Question asked by Arturo Arteaga on Mar 7, 2017
Latest reply on Mar 23, 2017 by Arturo Arteaga



I would like to reprogram a MK20DX64VLH7 microcontroller that I have in a board with , but I haven´t been able to download the new firmware and erase a previous firmware that I´ve just download  before succesfully. In the monitor it appears the next message: "Device is secure. Erase to ensecure?". I repetedly choose "Yes" but without any success, until the next message appears: "Launching LED Debug (4) has encountered a problem. Error in services launch sequence". In details appears written: "Error in services launch sequence Timed out trying to launch GDB Server."


I use KDS application, and "Debug Configuration" Option and GDB PEMicro with "Multilink Universal" programmer.

I´ve followed the KDS User Guide in order to set Debug Configurations.


Maybe there is one problem with the secure configuration of microcontroller, but I don´t know.


How can I erase the flash memory to reprogramm again?




I didn´t program the 0x40C address related to "NV_SEC" because I´ve only done the tutorial from Processor Expert, but I don´t know if this application program this address (0x40C) by default when I choose "Generate Processor Expert Code".



Anyway I tell you that it appears in this this address in my application:



NV_SEC (Address: 0x40C):


Init. value. 7E
After reset. FF


whose bits are:


KEYEN bits:
Init. value. 01
After reset. 11


MEEN bits:
Init. value. 11
After reset. 11


FSLACC bits:
Init. value. 11
After reset. 11


SEC bits:
Init. value. 10
After reset. 11




I don´t know how I can access to these registers by the "Processor Expert Application".


I would like to know how I could erase the firmware loaded in the MK20DX64VLH7 microcontroller to be able to reprogram it, as well as reprogramming in unsecure mode in order not to have this problems again. Or to program a firmware erasing the firmware loaded before. Do you know if there are any application to manage this. I have used "pe_gdb_server" and "multilink_universal" applications before but without any success.


Moreover I didn´t check a box to secure. The security boxes from the flash are disable by default and Protection regions are unprotected in Component Inspector Properties in  the "Processor Expert Application" in KDS.


According to this I think there shouldn´t be any problem with accesses related to security.

I will continue researching.


Thanks previouslly for your answer.


your sincerelly,


Arturo Arteaga