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.

Timeout Values in F021 Flash API

Hi All!

We are using TMS570LS3137ZWT controller. 

In the F021 Flash API I found the following status return value  (documentation: spnu501c.pdf):

Fapi_Error_StateMachineTimeout, /* State machine polling never returned ready and timed out */
But I found not information about the size of the timeout value.

My qestition is now: how large is the timeout value set and can it be changed via configuration?

Thanks,
Felix

  • Felix,

    That is a legacy error code from our F035 devices and no function within the F021 API will return this code.

  • Hi John!

    Thanks for the fast reply!

    What is the general strategy then to avoid blocking flash functions.

    Do I have to implement a timeout supervision by myself?

    Or is it guaranteed by design, that this situation (waiting for a Flash Job) can happen?

    Best Regards,

    Felix

  • Felix,

    The F021 Flash API by design for program and erase operations are non-blocking calls initiating Flash State Machine operations in a purely asynchronous method.  The program and erase functions will initiate the command on the Flash State Machine and then return control to the user.  It is then up to the user to decide method and frequency to check and see if the operation completed and/or generated a FSM error.

  • Hello John,

    I want to up this topic because I have one question exactly about FSM busy timeouts.

    Application should wait after program and erase operations till FSM busy flag is set taking into account flows in SPNU501.

    It is clear and waiting time is also undestandable ("Flash Program and Erase Timings" in MCU datasheet).

    But waiting till FSM busy is also necessary (again taking into account flows from API manual) after call of Fapi_enableMainBankSectors/Fapi_enableEepromBankSectors.

    And here is not clear how long we should wait. I mean maximum value in clocks or seconds.

    Could you please provide some information how long we should wait?

    P.S. in accordance with out coding standard a can't use:

    while(FLASH_CONTROL_REGISTER->FmStat.FMSTAT_BITS.Busy == Fapi_Status_FsmBusy);

    It can leads to endless loop and not allowed. So I should define some adequate timeout.