AnsweredAssumed Answered

Flash Programmer for Kinetis will not program Flash Configuration Field on K40

Question asked by ride on Jan 21, 2014
Latest reply on Feb 20, 2014 by Hui_Ma

I created a Flash Programmer for Kinetis task with an Erase (whole device) and Program task for programming the PFlash in memory range 0x0 - 0x0003FFFF.  Security is Enabled in the programming file Flash Configuration Field.  The Verify fails when programming the Flash Configuration Field at 0x00000400.  If I turn off the verify operation the process will complete, but when I read out the Flash Configuration Field contents they are not equivalent to what is specified in the programming file.

 

The programming file srecord is:

 

S31500000400FFFFFFFFFFFFFFFFFFFFFFFF7FFDFFFF

 

When I dump out what was programmed:

 

 

 

S32500000400FFFFFFFFFFFFFFFFFFFFFFFF7EFDFFFF

 

What is interesting is that it looks like FDPROT register is the reason for failing.  But after programming and rebooting security is not enabled.  I can do a Flash Memory dump again.  But it looks from what I can tell is that the Flash Configuration Fields are configured for Security to be enabled.

 

The real ugly mess is that I can use a debugger launch configuration to program the ELF output for the same S19 programming file and if I answer "No" to the 2 Device is Secure - Erase to Unsecure prompts after the program has been downloaded, I can reboot and Security is enabled and the Flash Memory dump provides the Device is Secure - Erase to Unsecure prompt.

 

I want to use a Flash Programmer for Kinetis Task, as I have a separate S19 file for programming in a Serial Number to a Data Flash memory location.  I want to do this only once in life of the product at production time and do not want any way lingering in code to be able to rewrite the Serial Number.  It seemed to me to be an easier process to edit a 1 line S19 record file with each unique Serial Number and then program the device without having to edit the Application S19 file.

 

I am running CodeWarrior 10.3.

 

Thanks for any help on this issue.

 

Outcomes