Hi,
I had saved the data to the flash and read immediately,it is successfully ,But I read it after power off and reset ,the data is 0xff, why?Who can tell me!,thank you!
below is my code:
UINT32 writechuankou(UINT32 bps)
{
int i=0,j=0,temp=0,pstatus=0;
FLASH_STATUS_ST status;
BOOL mt0;
UINT32 adress0=0x00060000;
UINT32 Flash_Data=0x888;
UINT32 buff=0x00;
UINT32 k=0;
mt0=Flash_Compact_B((UINT32*)0x00004000,0,1,50,(FLASH_ARRAY_ST)0xFFF87000,&status);
Flash_Erase_B((UINT32*)0x00004000,0x00004000,0,1,50,(FLASH_ARRAY_ST)0xfff87000,&status);
temp=Flash_Prog_B((void *)0x00004002 ,(UINT32 *)&bps,1, 0, 50,(FLASH_ARRAY_ST)0xfff87000,&status);
Flash_Read_V((UINT32*)0x00004002, &buff, 1, 0, 0, (FLASH_ARRAY_ST)0xfff87000);
i=0;
return buff;
}
UINT32 readchuankou(void)
{
int i=0,j=0,temp=0,pstatus=0;
FLASH_STATUS_ST status;
BOOL mt0;
UINT32 buff=0x00;
lash_Read_V((UINT32*)0x00004002, &buff, 1, 0, 0, (FLASH_ARRAY_ST)0xfff87000);
return buff;
}