This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280049C: Stuck at oFlashStatus = Fapi_getFsmStatus(); but programmed data look correct

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hi champs,

I am asking this for our customer.

The user refers to 

C:\ti\c2000\C2000Ware_5_04_00_00\driverlib\f28004x\examples\flash\flashapi_ex1_program_autoecc.c

The user specifically refers to this part in their application codes.

PS. The user confirms the u32Index is 128-bit aligned on flash 0x90000 and Buffer is also 128-bit aligned on RAM in the user's code.

void Example_CallFlashAPI(void)

{

...

oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index, Buffer+i, 8,
0, 0, Fapi_AutoEccGeneration);

// Wait until the Flash program operation is over
while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);

if(oReturnCheck != Fapi_Status_Success)
{
// Check Flash API documentation for possible errors
Example_Error(oReturnCheck);
}

// Read FMSTAT register contents to know the status of FSM after
// program command to see if there are any program operation related errors
oFlashStatus = Fapi_getFsmStatus();

...

}

The user runs all flash API on RAM/bank0 and erase/program bank1 in this case to do live firmware update with reset.

When the issue happened, the user found their code was always stuck at "oFlashStatus = Fapi_getFsmStatus();".

After looking into its assembly codes, the user founds it was stuck at ESTOP when it was stuck at "oFlashStatus = Fapi_getFsmStatus();".

After looking into CCS watch window, the user founds flash errors below when it was stuck at the ESTOP.

FMSTAT.PGV = 1

FMSTAT.CSTAT = 1

However, after looking into the memory browser, the 128-bit data were correctly programmed on the flash location 0x90000 as expected.

Therefore, the user is confused.

The data programmed look good, but there are errors in PGV and CSTAT, which cause the code to stuck at ESTOP in "oFlashStatus = Fapi_getFsmStatus();".

By commenting out "oFlashStatus = Fapi_getFsmStatus();", the user found the code could work.

Questions:

1. Why are there errors in PGV and CSTAT even though the data are correctly programmed?

2. How do you suggest the user debug in this case?

3. The flash API related codes was originally running well on F28003x. Then, the user migrated the codes from F28003x onto F28004x by changing the flash API library/related driverlib. Is there any major difference here between F28003x and F28004x?