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.

TMS320F28384D: eeprom emulation flash migration from f28375s to f28384d

Part Number: TMS320F28384D
Other Parts Discussed in Thread: C2000WARE, TMS320F28375S

Dear Mr. Vamsi,

               We have updated custom board version replace with TMS320F28384D and succeed example program , loaded  data in CPU1-flash memory sector6 (0x98000)  using example  flash program from driver lib. C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2838x\examples\c28x\flash (it stored data successfully using flash api).

But in f28375s(eeprom emulation ) we developed to stored data in 0x82000 and 0x84000 location. while READ and Write data in 0x82000 and 0x84000 location in f28384d it shows errors while loading program ?

Our Flash related  previous query.

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/988539/tms320f28375s-eeprom-read-process/3655289?tisearch=e2e-sitesearch&keymatch=%252525252520user%25252525253A441251#3655289

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/977652/tms320f28375s-flash-sector--erase-operation/3615375?tisearch=e2e-sitesearch&keymatch=%25252525252525252520user%2525252525252525253A441251#3615375

Our custom board  version1.0 ,  we have used tms320f28375s and stored,erased data successfully .

our current requirement we have replaced  f28384d and ported EEPROM.c  and EEPROM.h  for flash but it is not store data.

we have ported from 75s to 84d and attached files here for your reference ..kindly confirm the changes in eeprom files for f28384d to read wirte data in flash.

Following changes in functions:

f28375s-working code

void EEPROM_ProgramSingleByte1(Uint16 data[], Uint16 a, Uint16 write_address)
{
    int ref;
    for( ref=0;ref<255;ref++)
    Write_Buffer1[ref]=0;
    Uint16 i=0;
    Uint16 sec=0;
    uint32  u32Index=0;
    EALLOW;
    PUMPREQUEST = 0x5A5A0002;
    SeizeFlashPump_Bank0();
    Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;
    for(i=0;i<a;i++)
    Write_Buffer1[i] = data[i];                 // Prepare data to be programmed
    Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;// Set Length for programming

    for(sec=0,u32Index=write_address; (u32Index < (write_address+a)) &&
    (oReturnCheck == Fapi_Status_Success);sec+=8,u32Index+=8)
    {
    oReturnCheck=Fapi_issueProgrammingCommand((uint32 *)(u32Index), Write_Buffer1+sec,
                                                    8,
                                                    0,
                                                    0,
                                                    Fapi_DataOnly);
    }
    ReleaseFlashPump();
    EDIS;
}

f28384d- not working


void EEPROM_ProgramSingleByte1(uint16 data[], uint16 a, uint16 write_address)
{
    int ref;
    for( ref=0;ref<255;ref++)
    Write_Buffer1[ref]=0;
    uint16 i=0;
    uint16 sec=0;
    uint32  u32Index=0;
    EALLOW;
    PUMPREQUEST = 0x5A5A0002;
    Flash_claimPumpSemaphore(FLASH_CPU1_WRAPPER);
    Flash_enableECC( FLASH0ECC_BASE);
    for(i=0;i<a;i++)
    Write_Buffer1[i] = data[i];                 // Prepare data to be programmed
  //  Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;// Set Length for programming
    Flash_enableECC( FLASH0ECC_BASE);
    for(sec=0,u32Index=write_address; (u32Index < (write_address+a)) &&
    (oReturnCheck == Fapi_Status_Success);sec+=8,u32Index+=8)
    {
    oReturnCheck=Fapi_issueProgrammingCommand((uint32 *)(u32Index), Write_Buffer1+sec,
                                                    8,
                                                    0,
                                                    0,
                                                    Fapi_DataOnly);
    }
    Flash_releasePumpSemaphore();
    EDIS;
}

Difference between two project file is

(f28375s-it is dual headers file ,the function have both bit field and driverlib)

    PUMPREQUEST = 0x5A5A0002;
    SeizeFlashPump_Bank0();

    Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;

     ReleaseFlashPump();

(f28384d- we ported the same function using driverlib, kindly guide us for our problem.

    PUMPREQUEST = 0x5A5A0002;
    Flash_claimPumpSemaphore(FLASH_CPU1_WRAPPER);
    Flash_enableECC( FLASH0ECC_BASE);

    Flash_releasePumpSemaphore();

We used same flash example "2838x_flash_api_lnk.cmd file"

Thanks & Regards,

Shriram J

  • Hi Shriram,

    Did you replace the F2837xS flash API with that of F2838x flash API?

    Do you see this issue on C28x cores of F2838x? Or on the CM side of the F2838x?

    What errors did you get from the flash API when you said it is not able to program?  Please provide more details.

    Thanks and regards,
    Vamsi

  • Dear Mr.Vamsi,

    Did you replace the F2837xS flash API with that of F2838x flash API?

          Yes, In example project (C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2838x\examples\c28x\flash\ "flashapi_ex1_programming").we included EEPROM Emulation file EEPROM.c and EEPROM.h for f28384d.

    but for f28375s project  flash we have used dual headers(bit field and driverlib).

    we ported from (f28375s-emmulation to f28384d using driver lib function.. please find below example code

    (f28375s-it is dual headers file ,the function have both bit field and driverlib)

        PUMPREQUEST = 0x5A5A0002;
        SeizeFlashPump_Bank0();

        Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;

         ReleaseFlashPump();

    (f28384d- we ported the same function using driverlib.

        PUMPREQUEST = 0x5A5A0002;
        Flash_claimPumpSemaphore(FLASH_CPU1_WRAPPER);
        Flash_enableECC( FLASH0ECC_BASE);

        Flash_releasePumpSemaphore();



         Do you see this issue on C28x cores of F2838x?

         we are facing issue with c28x core cpu1,

    we are able to write data using driverlib example program(C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2838x\examples\c28x\flash) in C28x cores.

     but epprom emulation eeprom .c and eeporm.h, we are not able to read write to do same in C28x cores.


    Or on the CM side of the F2838x?
    we are not using CM core at present.

    What errors did you get from the flash API when you said it is not able to program?  Please provide more details

        project file build sucessful no erros, only one warnings #70-D integer conversion resulted in truncation        

        kindly check the EEPROM.c and EEPROM.h file which ported form f28375s to f28384d(previously attached)

    we are working on single and multiple byte store and retrieve from f28384d flash memory using flashapi_ex1_programming example project file... kindly guide us steps single byte read write function using eeprom.c file which we uploaded earlier..

  • Shriram,

    I would suggest you to debug the ported SW and come up with any specific questions that you may have.  

    I may not be able to review the entire code/project.

    Please debug with step execution and get an idea on what is working/not-working.  We can help analyze based on that.

    Thanks and regards,

    Vamsi

  • Dear Mr.Vamshi,

    Thanks for your support , our problem is resolved , we found datatype mishandle,while debugging and now we are able to read and write from 84D flash....

    Our Advance Christmas and New Year Wishes to TI members..

    Rgds

    ShriRam