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.

CCS/TMS320F280049: Flash API verify Result is not correct

Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Dear,

In my project, The Application calls the Flash API functions to program flash, the Flash API guide Version 1.56.01.00 .  Calling the program function  Fapi_issueProgrammingCommand can return success,but the

following ,calling the verify function Fapi_doVerify ,it returns Fapi_Error_Fail. Details as follow,

u32Databuffer = (uint32*)u16Databuffer;

...

oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index,u16Databuffer, 8, 0, 0, Fapi_AutoEccGeneration);

while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);

if(oReturnCheck != Fapi_Status_Success)
{
     PROGRAM_FAIL;
}

// Read FMSTAT register contents to know the status of FSM after
// program command for any debug


oFlashStatus = Fapi_getFsmStatus();

// Verify the values programmed. The Program step itself does a verify
// as it goes. This verify is a 2nd verification that can be done.

oReturnCheck = Fapi_doVerify((uint32 *)u32Index,4, u32Databuffer, &oFlashStatusWord);

while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);

if(oReturnCheck != Fapi_Status_Success)
{
    VERIFY_FAIL;
}

where is the problem?

Thanks for your help.

  

  • Hi,

    What is the return value from the Fapi_getFsmStatus() after the program command?  Please look at the description of Fapi_getFsmStatus() in F28004x Flash API guide at http://www.ti.com/lit/ug/spnu628a/spnu628a.pdf

    Please search for below questions in Flash API wiki (http://processors.wiki.ti.com/index.php/C2000_Flash_FAQ#Flash_API_wikiand read through them for more details.

    11. Does Fapi_issueProgrammingCommand() function call return after completing the program operation?

    12. If the Fapi_issueProgrammingCommand() function does not wait for the program operation completion, how do we know whether the program operation succeeded or not?

    3. What are the common debug tips that we can consider when Flash API fails to erase or program?

    Thanks and regards,
    Vamsi

  • Thank you .

    I have checked the return value of the function Fapi_getFsmStatus(). The value is zero. AND the destination addresses are programmed correctly.After calling the function Fapi_doVerify((uint32 *)u32Index,4, u32Databuffer, &oFlashStatusWord),the third word of oFlashStatusWord,the value of compare data is not match the u32Index address'. How can it get the compare data?Just by reading the destination addresses,or some calculations? what is the reason of the incorrect result? It can erase and program correctly,Should I check the initialization of the Flash module again?
  • Hi,

    Please check two things.

    1. The data buffer that you use for program and verify should be aligned on 64-bit boundary (32-bit boundary is also fine).  

        In 28004x_flash_api_lnk.cmd (C2000Ware_1_00_06_00\device_support\f28004x\common\cmd), you will notice that the section "DataBufferSection" is aligned on 64-bit boundary.  It is used in flashapi_ex1_program_autoecc.c (C2000Ware_1_00_06_00\driverlib\f28004x\examples\flash).  Please check.

    2. Make sure you configured the Flash wait-states correctly as per the datasheet spec.

    Please note that I will not be able to check your reply until March 6th.

    Thanks and best regards,

    Vamsi

  • Thanks .

    I think your reply is the answer of the problem. In my application the databuffer is not aligned on 64 bits. I correct this ,the problem is disappear.
  • Hi,

    Glad that I am able to help solve the issue.
    I will make sure this info is captured in the Flash API guide as well.

    Thanks and regards,
    Vamsi