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.

F021 API clarification



I'm working on the bootloader and parameter storage portions of our software, which is targeted to the TMS570LS1227PGE, and I've run into some problems with the documentation on the F021 API. Specifically, Fapi_clearStatus is an asynchronous command, which implies I need to poll/wait for interrupt for completion; however, the BUSY bit in FMSTAT (read by FAPI_CHECK_FSM_READY_BUSY) is defined in the TMS570 reference manual SPNU515B as reflecting the status of a program, erase, or suspend operation. The code examples I found in the Advanced F021 Erase/Program Support document appear to suggest that Fapi_clearStatus in fact completes immediately or within a very small number of clock cycles, since they proceed directly from issuing Clear Status via registers to performing other operations without checking the FSM's status, so the command is effectively synchronous. Is this correct?

The usage of Fapi_eraseSector is also a bit confusing. It's done with Fapi_issueAsyncCommandWithAddress(), which takes a uint32_t *, suggesting it should be a pointer to a memory location. From examining the advanced usage manual again, it looks like it should be called once with the base address of the sector to be erased, which will erase both the data and ECC regions for that sector; is that correct?

Finally, when issuing a programming command using Fapi_AutoGeneration, does a buffer for the ECC bytes to be generated need to be passed, or is that pointer left as NULL and the API writes the ECC directly into FWPWRITE_ECC?

  • Doug Brunner said:
    The code examples I found in the Advanced F021 Erase/Program Support document appear to suggest that Fapi_clearStatus in fact completes immediately or within a very small number of clock cycles, since they proceed directly from issuing Clear Status via registers to performing other operations without checking the FSM's status, so the command is effectively synchronous. Is this correct?

    Doug,

    I am pretty sure that some of the FEE issues listed on  http://processors.wiki.ti.com/index.php/HALCoGen?keyMatch=halcogen&tisearch=Search-EN

    for example SDOCM00122496 through SDOCM00122533 were related to expecting that the FSM status would be successful without checking it.

    So I wouldn't recommend skipping any check of the FSM status.   

    Doug Brunner said:
    The usage of Fapi_eraseSector is also a bit confusing. It's done with Fapi_issueAsyncCommandWithAddress(), which takes a uint32_t *, suggesting it should be a pointer to a memory location. From examining the advanced usage manual again, it looks like it should be called once with the base address of the sector to be erased, which will erase both the data and ECC regions for that sector; is that correct?

    I think it can be an address within the sector but the base address of the sector is a good practice.

    Doug Brunner said:
    Finally, when issuing a programming command using Fapi_AutoGeneration, does a buffer for the ECC bytes to be generated need to be passed, or is that pointer left as NULL and the API writes the ECC directly into FWPWRITE_ECC?

    Need to get the author of the code to answer this one.   The doc is very unclear.

  • Doug,

    pu8EccBuffer can be NULL, if Fapi_AutoEccGeneration mode is selected.  F021 API calculates ECC and writes it on to FWPWRITE_ECC.

  • Since the BUSY bit is described as reflecting only whether a program/erase/suspend operation is ongoing, should I poll the FMSTAT bits that Clear Status is meant to reset to determine when Clear Status has completed?

    Are there any guarantees on how long Clear Status may take to complete?