Writing to program-once registers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Writing to program-once registers

Jump to solution
2,927 Views
adrian11
Contributor I

I am trying to perform a simple write to the program-once area with no luck. I am suspecting that maybe I am not performing the mass erase operation correctly. Will the ARM Flash Programmer app form USBDM do the trick?

Untitled.png

Once the Mass Erase is complete and new firmware is loaded, I attempt to write teh program once registers. My procedure is pretty straighforward; write 0x41 to FCCOB_0, write 0x01 to FCCOB_1, 0x3 to FCCOB_4, and finally toggle the CCIF bit.

Is this enough to write 0x3 to the 2nd program-once record?

Labels (2)
Tags (1)
0 Kudos
Reply
1 Solution
2,448 Views
mjbcswitzerland
Specialist V

Adrian

Once something has been programmed in the "program-once" area it can NEVER be deleted or changed again.

Regards

Mark

View solution in original post

0 Kudos
Reply
8 Replies
2,448 Views
pgo
Senior Contributor V

Hi adrian,

The sequence you provided appears to be for read-once not write-once.

It is necessary to do the full sequence (FCCOB0,1,4,5,6,7, etc.) I believe as a 4-byte record is programmed. (described in 27.4.10.8 of KL16 manual)

In any case I can't see that the mass-erase option etc has much bearing on the results since the write-once region is not erasable.

bye

2,448 Views
adrian11
Contributor I

I was under the impression that the program-once register area can be cleared only with a mass-erase operation. Is that incorrect?

0 Kudos
Reply
2,449 Views
mjbcswitzerland
Specialist V

Adrian

Once something has been programmed in the "program-once" area it can NEVER be deleted or changed again.

Regards

Mark

0 Kudos
Reply
2,448 Views
adrian11
Contributor I

Well, one more thing. If you look at the following doc, you'll see mentions that mass erase clears all of he blocks:

"All blocks of flash are erased regardless of protection settings. This includes program flash, data flash, the program

flash IFR swap indicator address, data flash IFR space (including EEE partition information), EEPROM backup

memory (E-flash), and FlexRAM."

Are program-once (block 0) registers an exception?

(section 4.2) http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4835.pdf

0 Kudos
Reply
2,448 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi adrian a

    Program-once  memory is really a special memory.

   If you do the program, this area can't be erased, you just can read it with read once command.

Regards,

Jingjing

0 Kudos
Reply
2,448 Views
mjbcswitzerland
Specialist V

Hi

That document doesn't mention the program once area.

If you are unsure simply program something to it and try to erase it with a mass erase and you will see that it is impossible.

If it were erased it would not be called "program-once" but "program-and-delete-like-all-other-flash-area" and it would also be quite pointless in having.

In every user's manual you will also find that it is stated that it can't be erased, which makes the operation clear and unambiguous:

pastedImage_0.png

Regards

Mark

0 Kudos
Reply
2,448 Views
adrian11
Contributor I

Thanks for making it clear. I appreciate it. :smileyhappy:

0 Kudos
Reply
2,448 Views
mjbcswitzerland
Specialist V

Hi

The programming sequence is

FTFL_FCCOB0 = 0x43

FTFL_FCCOB1 = length (0..7 for devices with long word programming / 0..15 for devices with phrase programming)

FTFL_FCCOB7_4 = first long word to be programmed (long word pointer can be used)

FTFL_FCCOBB_8 = second long word to be programmed - for devices with phrase programming (long word pointer can be used)

Regards

Mark

µTasker Kinetis support