MCU:TMS570LS20216 with pf035a_api_eabi_vfp.lib;
I want to write Ecc code to Flash-Ecc of Address:0x480000
Code below:
#inclide "F035.h"
void flash_test(void)
{
U8 i;
U32 dwRetSt1 = 0;
U32 dwRetSt2 = 0;
U32 dwRetSt3 = 0;
U32 dwRetSt4 = 0;
U32 FlashDataTemp[10];
for (i = 0; i < 10; i++)
{
FlashDataTemp[i] = i + 0xa5;
}
dwRetSt1 = Flash_Compact_B( (UINT32 *)0x100000, 2, 0, 100,(FLASH_ARRAY_ST)FLASHWREG, &status );
dwRetSt2 = Flash_Erase_Sector_B( (UINT32 *)0x100000, 0x1000, 2, 0, 100,(FLASH_ARRAY_ST)FLASHWREG );
dwRetSt3 = Flash_Prog_Data_B( (UINT32 *)0x100000, (UINT32 *)&FlashDataTemp[0], 10, 2, 100,
(FLASH_ARRAY_ST)FLASHWREG, &status, 10, CMND_PROG_DATA_MAIN );
dwRetSt4 = Flash_Prog_Data_B( (UINT32 *)0x480000, (UINT32 *)&FlashDataTemp[0], 4, 2, 100,
(FLASH_ARRAY_ST)FLASHWREG, &status, 10, CMND_PROG_DATA_MAIN );
}
Result:
dwRetSt1 = 1;//right
dwRetSt2 = 1;//right
dwRetSt3 = 1;//right Data Program right
dwRetSt4 = 0;//fault Then status: 0x00480004;0x00A500A5;0x00000001;0x00000001
Have any Registers to enable writing data to Flash-Ecc???
Sorry for poor english and nasty code!hope for your applying as soon as possible,thank you!!