About P-FLASH

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

About P-FLASH

1,460 次查看
zy
Contributor I

Hello everybody!

I am using XET256,I have some problems about using P-Flash.

If I want to program P-Flash from 0x780002 to 0x780007, and P-Flash in address 0x780000 and 0x780001 have been programed, so I  fill 0x780000 as 0xffff ,like that: 

FCCOBIX=0;

FCCOB=0X0678;

FCCOBIX=1;

FCCOB=0X0000;

FCCOBIX=2;

FCCOB=0XFFFF;

FCCOBIX=3;

FCCOB=value1

FCCOBIX=4

FCCOB=value2

FCCOBIX=5

FCCOB=value3

FSTAT=0X80;

 

Whether this will generate a P-Flash Command Error? If it will set ACCERR FPVIOL MGSTAT1 or MGSTAT2?

标签 (1)
0 项奖励
回复
4 回复数

1,235 次查看
kef
Specialist I

I think you will get ECC error.

0 项奖励
回复

1,235 次查看
zy
Contributor I

Thank you for your response. In this situation the data in 0x780002-0x780007 is correct? 

If I fill 0x780000-0x780001 with their original data, will generate any errors?

0 项奖励
回复

1,235 次查看
kef
Specialist I
  • In this situation the data in 0x780002-0x780007 is correct?

I think it depeneds on the state of ECC bits. One time you may get you bytes matching data you were trying to program. Another time you may get verify errors. When you command flash to write 8 bytes, more than 8 bytes are written to flash, since additional ECC correction bits are written to the flash. When you write xx0-xx1 bytes, and others all FF, ECC correction pattern is programed exactly for that old xx0-xx7 byte pattern. It is obvious that when you later program xx2-xx7, ECC correction has almost no chances to be programmed properly. You need to erase all 8 bytes. Unfortunately you can erase only whole flash sector.

 

  • If I fill 0x780000-0x780001 with their original data, will generate any errors?

Yes, it will. Old ECC correction has to be erased .

0 项奖励
回复

1,235 次查看
zy
Contributor I

Thank you! So I must restrict the program start address, to be sure it's bit[0:2] is zero.

0 项奖励
回复