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-Q1: EEPROM Emulation

Part Number: TMS320F28377D-Q1
Other Parts Discussed in Thread: TMS320F28377D

Hello,

a customer wants to do EEPROM Emulation on a TMS320F28377D Device.

There is an Application Note SPAb69a describing this scenario. The device above is not explicitly mentioned.

So the question is if the described EEPROM Emulation can be also used on the device, mentioned above?

Thanks and BR Ralf

  • Hi Ralf,

    Thank you for your question, our emulation expert will get back to you as soon as possible.

  • Here is what I use on 28379d and works fine

    /**
    * @file Flash.c
    * @author F
    * @version 1.0
    * @date 12 Novembre 2009
    * @brief Flash module.
    * @details Flash functions for writing in Data Flash.
    *
    */

    #include "include.h"
    #include "F021_F2837xD_C28x.h"

    StructDataFlash *DataFlashRam;

    const ulong FlashSector[16]=
    {
    0x080000, // A
    0x081000, // B
    0x082000, // C
    0x083000, // D
    0x084000, // E
    0x085000, // F
    0x086000, // G
    0x087000, // H
    };

    //#pragma CODE_SECTION(FlashWriteBuf, ".TI.ramfunc");
    uint FlashWriteBuf(uint *c)
    {
    //! Writes buffer in DataFlash.
    //!
    //! \param *c : buffer to be written.
    //!
    //! This function control values of Data Flash parameters.
    //!
    //! \return : 0 = Success.
    uchar i; /* Counter of words */
    uchar e; /* Error flag */
    Fapi_StatusType f;
    e = 1;
    /* Erase sector and Blank Check */
    EALLOW;
    f = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, (uint32 *)&DataFlash);
    /* Wait until FSM is done with erase sector operation */
    while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}
    /* Check for success */
    if (f != Fapi_Status_Success)
    e = 0;
    /* Write command */
    i = 0;
    do
    {
    f = Fapi_issueProgrammingCommand((ulong *)&DataFlash + (i >> 1), c + i, 8, 0, 0, Fapi_AutoEccGeneration);
    /* Wait until the Flash program operation is over */
    while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
    /* Check for success */
    if (f != Fapi_Status_Success)
    e = 0;
    i = i + 8;
    }
    while (i < sizeof(StructDataFlash));
    EDIS;
    return e;
    }

    uint FlashWrite(uint *a, uchar *s, uint n)
    {
    //! Replace old datas by new in Data Flash.
    //!
    //! \param *a : address of first word to write.
    //! \param *s : address of buffer to write (buffer of uchar).
    //! \param n : number of words to write (-1).
    //!
    //! This function control values of Data Flash parameters.
    //!
    //! \return : 0 = Success.
    uint c[sizeof(StructDataFlash)];
    uint i;
    /* Save old data in buffer */
    i = 0;
    do
    {
    c[i] = *(uint *)((ulong)&DataFlash + i);
    i ++;
    }
    while (i < sizeof(StructDataFlash));
    /* Replace data in buffer */
    i = 0;
    do
    {
    c[(ulong)a - (ulong)&DataFlash + i] = (*(uint *)(s + (2 * i) + 1) << 8) + *(uint *)(s + (2 * i));
    i ++;
    }
    while (i <= n);
    /* Start write command */
    i = FlashWriteBuf((uint *)&c);
    return i;
    }

    void FlashInit(void)
    {
    //! Initialize Data Flash parameters.
    //!
    //! \param None.
    //!
    //! This function initialize Data Flash.
    //!
    //! \return None.
    Fapi_StatusType f;
    //Flash_initModule(FLASH0CTRL_BASE, FLASH0ECC_BASE, DEVICE_FLASH_WAITSTATES);
    EALLOW;
    f = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, CPUCLK_FREQUENCY);
    /* Check for success */
    if (f != Fapi_Status_Success)
    RamRODef.Flash = 1;
    f = Fapi_setActiveFlashBank(Fapi_FlashBank0);
    /* Check for success */
    if (f != Fapi_Status_Success)
    RamRODef.Flash = 1;
    /* Control Data Flash Parameters */
    if (FlashCtrl() == 0)
    RamRODef.Data = 0;
    else
    RamRODef.Data = 1;
    EDIS;
    }

    uint FlashVer(void)
    {
    /* Return version of Flash library */
    Fapi_LibraryInfoType f;
    f = Fapi_getLibraryInfo(); /* Get Flash Api version */
    return f.u8ApiMajorVersion * 100 + f.u8ApiMinorVersion;
    }

  • Is this resolved? Can I close this thread?