TMS570LS0714: TMS570LS07 problem in erase data from eeprom using fee driver erase function

Part Number: TMS570LS0714

hi 

I am using fee driver with  TMS570LS07  and I realy need help to know how i can erse all the block or the adress i want in eeprom 

I tried the code below but it does not work so please can any one help me 

my code is here 

#include "ti_fee.h"

#include "sys_common.h"
#include "system.h"

uint16 u16JobResult,Status;
Std_ReturnType oResult=E_OK;
unsigned char read_data[100]={0};

uint8 SpecialRamBlock[100]={30,31,32,33};

unsigned char pattern;
uint16 u16writecounter;

unsigned int  FeeVirtualSectorNumber;
unsigned char VsState, u8EEPIndex;
unsigned char u8VirtualSector;
uint8 Test_Recovery;
uint8 Test_Cancel;

uint8 *adress_of_block;
void delay(void)
{
    unsigned int dummycnt=0x0000FFU;
    do
    {
        dummycnt--;
    }
    while(dummycnt>0);
}

void main(void)
{
/* USER CODE BEGIN (3) */
    unsigned int BlockNumber;
    unsigned int BlockOffset, Length;
    unsigned char *Read_Ptr=read_data;

    unsigned int loop;

    /* Initialize RAM array.*/
    //for(loop=0;loop<100;loop++)SpecialRamBlock[loop] = loop;

    /* Initialize FEE. This will create Virtual sectors, initialize global variables etc.*/
    TI_Fee_Init();
    do
    {
        TI_Fee_MainFunction();
        delay();
        Status=TI_Fee_GetStatus(0);
    }
    while(Status!= IDLE);

    TI_Fee_EraseImmediateBlock((uint16_t)0xF02001D8);
    do
    {
        TI_Fee_MainFunction();
        delay();
        Status=TI_Fee_GetStatus(0);
    }
    while(Status!=IDLE);
    /* Write the block into EEP Asynchronously. Block size is configured in ti_fee_cfg.c file. Default Block size is
       8 bytes */
    BlockNumber=0x1;
    TI_Fee_WriteAsync(BlockNumber, &SpecialRamBlock[0]);
    do
    {
        TI_Fee_MainFunction();
        delay();
        Status=TI_Fee_GetStatus(0);
    }
    while(Status!=IDLE);


//    //here block number is our start block to write then our buffer will fill the blocks which after him untill
//    //our buffer write all its data
   BlockNumber=0x1;
    /* Write the block into EEP Synchronously. Write will not happen since data is same. */
//    TI_Fee_WriteSync(BlockNumber, &SpecialRamBlock[0]);

      BlockOffset = 2;
      Length = 0xFFFF;
      oResult=TI_Fee_Read(0x1,BlockOffset,Read_Ptr,Length);
      do
      {
          TI_Fee_MainFunction();
          delay();
          Status=TI_Fee_GetStatus(0);
      }
     while(Status!=IDLE);

    /* Invalidate a written block  */
//    TI_Fee_InvalidateBlock(BlockNumber);
//    do
//    {
//        TI_Fee_MainFunction();
//        delay();
//        Status=TI_Fee_GetStatus(0);
//    }
//    while(Status!=IDLE);

    /* Format bank 7 */
    //TI_Fee_Format(0xA5A5A5A5U);

    while(1);
/* USER CODE END */
}

i tried to delete all of that data but i could not i just need to know how to erase full memory or data of an address

  • Hi,

    TI_Fee_EraseImmediateBlock() is used to erase one data block, the argument of the function should be the data block number.

    The virtual sector will be erased when the sector is full.

    When you write data to EEPROM, the data is written to the first empty location in the Active Virtual Sector. If there is insufficient space in the current Virtual Sector to update the data, it switches over to the next Virtual Sector and copies all the valid data from the other Data Blocks in the current Virtual Sector to the new one. After copying all the valid data, the current Virtual Sector will be erased.

  • so for example if I write uint8 data to the first sector I have to fill the 4kb then I can erase??

    there is no other way is not there?  

  • TI_Fee_Format(0xA5A5A5A5U); I used this function to erase and the eeprom is erased fine now my question is it safe to sue this function every time to erase

  • TI_Fee_Format() will erase all the Virtual Sectors rather than the current active sector. Calling this function will result in loss of data. This function should be called only if you want to reconfigure the Data Blocks/Virtual Sectors or detect a serious error condition.