cancel
Showing results for 
Search instead for 
Did you mean: 

About bank0 write data problem

jacky123429358
Associate
Posted on January 07, 2009 at 05:58

About bank0 write data problem

1 REPLY 1
jacky123429358
Associate
Posted on May 17, 2011 at 09:54

I've a problem with bank switch in STR912W42X6

I would use bank0 to restore data ,when i write data in FMI_B0S2 ,why FMI_B0S3 have same data with FMI_B0S2.

__ramfunc u8 EepromFormat(){

u16 gg1,gg2

SCU_AHBPeriphClockConfig(__FMI, ENABLE);

SCU_AHBPeriphReset(__FMI, DISABLE);

SCU_PFQBCCmd(DISABLE);

SCU_AHBPeriphReset(__VIC, ENABLE);

FMI_BankRemapConfig(0x0, 0x6,0x80000, 0x0);

FMI_WriteProtectionCmd(FMI_B0S2, DISABLE);

FMI_WriteProtectionCmd(FMI_B0S3, ENABLE);

FMI_EraseSector(FMI_B0S2);

FMI_Timeout_Status1 = FMI_WaitForLastOperation(FMI_BANK_0);

gg1=FMI_ReadWord(FMI_B0S2);

if(gg1==0xffff)

{

FMI_WriteHalfWord( FMI_B0S2,0xAAAA );// write data to FMI_B0S2

FMI_WaitForLastOperation(FMI_BANK_0);

}

gg2= FMI_ReadWord(FMI_B0S3);//gg2 is the same whith FMI_B0S2

}