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?
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?
已解决! 转到解答。
Adrian
Once something has been programmed in the "program-once" area it can NEVER be deleted or changed again.
Regards
Mark
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
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
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:
Regards
Mark
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