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 = FTFE_FCCOB4;
address = FTFE_FCCOB5;
address = FTFE_FCCOB6;
address = FTFE_FCCOB7;
address = FTFE_FCCOB8;
address = FTFE_FCCOB9;