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.

TMS320F28377D: Question about flash operation

Genius 3095 points
Part Number: TMS320F28377D

Dear team:

1, Does flash-api fuction must run in RAM? If it is not run in RAM, is there any hidden danger?

2, If I call a function B (which do not operate flash) in Function A (which operate flash), Does Function B need to run in RAM?

void  FunctionA()

{

   (flash Erase);

   (flash Read);

   FunctionB();

   (flash write);

}

void  FunctionB()

{

 (No flash operation in it)

}

Best reagrds

  • Hi,

    1. Yes, Flash API functions must be run from RAM.

    2. Function B can run from Flash as long as the Flash operation is not active at that time.  See below copied the note that I added in Flash API guide:

    Flash API execution is interruptible; however, there should not be any read or fetch access from the Flash bank/OTP when an erase or program operation is in progress. Therefore, the Flash API functions, the user application functions that call the Flash API functions, and any ISRs (Interrupt service routines,) must be executed from RAM. For example, the entire code snippet shown below should be executed from RAM and not just the Flash API functions. The reason for this is because the Fapi_issueAsyncCommandWithAddress() function issues the erase command to the FSM, but it does not wait until the erase operation is over. As long as the FSM is busy with the current operation, there should not be a Flash access.

    //

    // Erase a Sector

    //

    oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,(uint32*)0x0080000);

    //

    // Wait until the erase operation is over

    //

    while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}

     

    In above code, as long as Function B is called after the Flash operation is over (including waiting for Fapi_status_FsmReady), it should be fine.  Above example shows erase operation. However, what I mentioned is applicable to all Flash operations.

    Please let me know if you have any questions on this.

    Thanks and regards,
    Vamsi

  • Hi Vamsi:

    Thank you for your reply.

    One more question, Is there any way to move some code in one section to another specified space?For example, To move TGC_Main.obj (.ebss) in .ebss from H3~H4 to L1~L3.

    .ebss is a space specified by TCF tool, and TGC_Main.c contains a large number of global variables, If every global variable can not be implemented by specifying space through "#pragma DATA_SECTION", what is the way to move it as a whole?

    Best regards

  • Hi,

    Please open a new post for your last question, so that appropriate expert can be assigned to help you.

    Thanks and regards,

    Vamsi