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?