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.

TMS570LS1227: F021 Flash API v2.01.01: Call to Fapi_issueProgrammingCommand() when FSM is busy

Part Number: TMS570LS1227

Hi,

I would be interested to know what happens when I call Fapi_issueProgrammingCommand() when the Flash State Machine (FSM) is busy.

  1. The Reference Guide SPNU501G recommends that FMSTAT is interrogated for FSM busy prior to Fapi_issueProgrammingCommand() call.
  2. SPNU501G also describes: "Reading a Flash memory location from the bank that an program command is currently being performed will stall the CPU until the program command finishes and the FMSTAT register indicates the FSM is not busy."
  3. Fapi_issueProgrammingCommand() does not return a busy status, only success and three failures related to buffer size.

If I make a call to Fapi_issueProgrammingCommand() when the FSM is busy, will the CPU be stalled, or will Fapi_issueProgrammingCommand() return with something other than success?

Regards, Tony.

  • Hello Tony,

    The flash API should not be called when the FSM is busy. If you call Fapi_issueProgrammingCommand() when the FSM is busy, it will generate an abort.
  • Hi QJ,
    Thanks for the answer. Would this be a DATA ABORT, causing a processor exception interrupt?
    It doesn't sound very friendly or robust to just abort. Wouldn't it be better if the FAPI returned a busy indication instead?
    Regards, Tony.
  • Hello Tony,

    The correct sequence is to check the FSM status after calling sectors enable API and flash erase/program APIs. It is prefetch abort I just did a quick test using the following code, and got a prefetch abort (exception interrupt).

  • Hi QJ,

    Thanks again for your elaboration. We will check FSM busy status before calling Fapi_issueProgrammingCommand().

    I would suggest that an improvement to Fapi_issueProgrammingCommand() would be for it to check FSM busy status and return busy status accordingly, rather than prefetch abort.

    Regards, Tony.