AnsweredAssumed Answered

K66 locks when flashing image

Question asked by panpwr on Aug 12, 2015
Latest reply on Sep 17, 2016 by Mark Butcher

Hi all,


We have some data we need to read from the program once registers.

We are able to read and write the data when we use the JLink commander.

When we try to read from the application the process fails.

I noticed that after the application is stopped and I try reading the program once registers with the JLink commander, it fails until I issue the command unlock kinetis.

Only after I do that I can read the registers again. I assume that this happens, because the flash gets protected somehow and the writing of the FCCOB fails and with that the read fails.


The question is, why does the flashing of an application gets th@e flash protected?


Here is the code we use to read the program once registers:


   FTFE_FCCOB0 = 0x41; //Program Once read command

   FTFE_FCCOB1 = 0x00; //Program Once index 0

   FTFE_FSTAT = 0x80;


   while(!(FTFE_FSTAT & FTFE_FSTAT_CCIF_MASK)); //Wait for the read operation to complete


   address[0] = FTFE_FCCOB4;

   address[1] = FTFE_FCCOB5;

   address[2] = FTFE_FCCOB6;

   address[3] = FTFE_FCCOB7;  

   address[4] = FTFE_FCCOB8;

   address[5] = FTFE_FCCOB9;




Ohad Benjamin