Dear C2000 experts,
We are facing a strange problem using F021 Flash API. The device is F28375s.
We are trying to erase and then program some sectors of the flash bank 1. Most of the time (about 3 out of 4), the procedure completes successfully.
In the remaining cases, apparently in a completely random way, the CPU stops during the check "Fapi_checkFsmForReady() != Fapi_Status_FsmReady".
Sometimes it also stops in random locations, for example in the secure ROM addresses.
Also, it seems the problem appears only during the erase phase. The programming works ok.
The steps we make for the erase are the following:
- Check if the bank we want to erase has been activated
- If not, we claim the PUMP semaphore, call Fapi_initializeAPI and then Fapi_setActiveFlashBank
- call Fapi_issueAsyncCommandWithAddress
- wait until the command complete by checking "Fapi_checkFsmForReady() != Fapi_Status_FsmReady" (This seems the problematic step)
- read the erase result by calling Fapi_getFsmStatus
Here what we have checked so far:
- All the used function are loaded in RAM, also the wrapping functions
- After copying the functions on RAM and before calling the erase function, we check if the RAM has been corrupted in some way
- We don't use the restricted memory areas as per the errata advisory "Memory: Prefetching Beyond Valid Memory"
Have you any suggestions?
Please let me know if you need some further information.