应该用DFlashFullPartition后,应该就可以直接读写了,我用的XEP100,如:
void Fee_DFlashFullPartition(uint16 DFPART, uint16 ERPART)
{
while(FSTAT_CCIF == 0) // busy
{
}
FSTAT = 0x30; //clear ACCERR and PVIOL
FCCOBIX = 0x00;
FCCOB = 0x0F00; //Partition D-Flash Command
FCCOBIX = 0x01;
FCCOB = DFPART;
FCCOBIX = 0x02;
FCCOB = ERPART;
FSTAT_CCIF = 1; //lunch command
while(FSTAT_CCIF == 0) //wait for done
{
}
}
FCLKDIV_FDIV |= 0x03;
EPAGE = 0xFF; // Init
FCCOBIX = 0;
FCCOBHI = 0x0F;
FCCOBIX = 1;
FCCOB = DFPART;
FCCOBIX = 2;
FCCOB = ERPART;
FSTAT_CCIF = 1;
while( !FSTAT_CCIF ); // Full Partition D-Flash
FCCOBIX = 0;
FCCOBHI = 0x11;
FCCOBLO = 0x13;
FCCOBIX = 1;
FCCOB = 0xF000;
FCCOBIX = 2;
FCCOB = 0x0102;
FCCOBIX = 3;
FCCOB = 0x0304;
FCCOBIX = 4;
FCCOB = 0x0506;
FCCOBIX = 5;
FCCOB = 0x0708;
FSTAT_CCIF = 1;
while( !FSTAT_CCIF ); // Write EEE
按理上述操作结束后,0x13F000'G 的地方应该有数据写入了,但我在DEBUG时,相应地址的数据没有被改变,并且保存DFPART、ERPART的地址(0x120000'G,0x120004'G)的值也没有改变,但我用
FCCOBIX = 0;
FCCOBHI = 0x15;
FCCOBIX = 1;
temp = FCCOB;
FCCOBIX = 2;
temp = FCCOB;
FSTAT_CCIF = 1;
while( !FSTAT_CCIF ); // Get Partition Info
查询时,可以准确返回出DFPART,ERPART的值。
这份文档之前也看过,不过XEP100系列的EEE用法不太一样,谢谢哈。
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |