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.

TMS320F28377D: Minimum Watchdog Timer for Flash API V1.54 Erase Function

Part Number: TMS320F28377D

Hi all,

Does anybody what's the minimum watchdog timeout you can have for the erase function (Fapi_issueAsyncCommandWithAddress) to successfully complete (specifically V1.54). My Fapi_serviceWatchdogTimer function properly resets the counter, but I'm having the reset trip every time the erase function is called. Has anybody had a similar issue? A search of the forums showed that some people have, but it's been with different issues.

Note: I've narrowed it down to the asynchronous call - it's not while I wait on the FSM or do a blank check. I looked at the Advanced Program/Erase document (SPNA148) to rewrite an optimized erase function, but I'd prefer to tackle the problem without it if possible.

Any help would be greatly appreciated! Thanks!

  • I've been doing some more searching, and I think I stumbled upon what could be a potential issue. I'm using TI-RTOS and semaphores for my various tasks, including ISR to post those semaphores. The pointer variable for the semaphore for the event that arms the watchdog is located in Flash (not the semaphore itself, just an auto-generated pointer to it from RTOS). Could this be causing an issue when erasing the sector, forcing my watchdog arming routine to never occur?
  • Mike,

    Yes, any Flash access during an active erase or program operation is not allowed and will be stalled until the current operation is over.    

    As mentioned in the Flash API reference guide for F2837xD (www.ti.com/lit/pdf/spnu629), Fapi_serviceWatchdogTimer() function is called by the API only during the Read Functions (refer to functions in Table 3 of this document).  Please read the section 3.6 User Definable Functions in the reference guide for more details.  Note that SPNA148 is not applicable for C2000 devices.

    TMS320F2837xD datamanual (http://www.ti.com/lit/ds/symlink/tms320f28377d.pdf) provides the sector erase time in Table 5-20. Flash Parameters.   

    Thanks and regards,
    Vamsi    

  • Hi Vamsi,

    Thank you for the information! Is the erase operation interruptible like the rest of the API functions? I have a 2kHz trigger to arm the watchdog, and a task that runs after the CLA completes to service it. It seems like the servicing isn't occurring during the erase operation - is this typical or should the other tasks continue to run?
  • Mike,

    Erase functions is interruptible.  However, there should not be any reads or fetches from Flash until the erase operation is over.  Please see below info copied from SPNU629.

    Flash API execution is interruptible; however, there should not be any read or fetch access from the Flash bank/OTP when an erase or program operation is in progress. Therefore, the Flash API functions, the user application functions that call the Flash API functions, and any ISRs (Interrupt service routines,) must be executed from RAM. For example, the entire code snippet shown below should be executed from RAM and not just the Flash API functions. The reason for this is because the

    Fapi_issueAsyncCommandWithAddress() function issues the erase command to the FSM, but it does not wait until the erase operation is over. As long as the FSM is busy with the current operation, there should not be a Flash access.

    //

    // Erase a Sector

    //

    oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,(uint32*)0x0080000);

    //

    // Wait until the erase operation is over

    //

    while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}

    Thanks and regards,
    Vamsi