Writing to program-once registers

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Writing to program-once registers

跳至解决方案
2,925 次查看
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?

标签 (2)
标记 (1)
0 项奖励
回复
1 解答
2,446 次查看
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 项奖励
回复
8 回复数
2,446 次查看
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,446 次查看
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 项奖励
回复
2,447 次查看
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 项奖励
回复
2,446 次查看
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 项奖励
回复
2,446 次查看
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 项奖励
回复
2,446 次查看
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 项奖励
回复
2,446 次查看
adrian11
Contributor I

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

0 项奖励
回复
2,446 次查看
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