Part Number: TMS320F28374S
Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
I am facing a problem when I program data and ecc separately, using Fapi_issueProgrammingCommand() with Fapi_DataOnly and Fapi_EccOnly.
I have no problem when programming data, but I probably do some error when calculating or writing ecc.
Where is the problem with the following code?
short FlashProg_WriteEcc(unsigned long 64bitAlignedAddr)
{
uint64_t data;
uint64_t *flash_p;
uint16_t ecc;
Fapi_StatusType fapiSts;
int16_t rv;
rv = -1;
flash_p = (uint64 *) 64bitAlignedAddr;
memcpy(&data, flash_p, 4);
ecc = Fapi_calculateEcc(64bitAlignedAddr << 1, data);
SysCtl_disableWatchdog();
fapiSts = Fapi_issueProgrammingCommand((uint32_t *) 64bitAlignedAddr, NULL, 0, &ecc, 1, Fapi_EccOnly);
while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
SysCtl_enableWatchdog();
// si verfica l'esito
if (fapiSts == Fapi_Status_Success)
{
rv = 0;
}
ASSERT(fapiSts == Fapi_Status_Success);
return rv;
}
Thank you,
Carlo