Writing to program-once registers

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Writing to program-once registers

ソリューションへジャンプ
2,928件の閲覧回数
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,449件の閲覧回数
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,449件の閲覧回数
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,449件の閲覧回数
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,450件の閲覧回数
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,449件の閲覧回数
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,449件の閲覧回数
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,449件の閲覧回数
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,449件の閲覧回数
adrian11
Contributor I

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

0 件の賞賛
返信
2,449件の閲覧回数
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