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.

TMS570LS3137: REGARDING EEPROM ACCESS

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN, TMS570LC4357,

Hello .,

Iam working on the sample example of eeprom reading., my configuration as follows

1.No of virtual sectors is 2

2.No of blocks is 1

3.Block size is 8 bytes 

Iam trying to store only one integer value i.e., pressure value into the memory but its storing both pressure and temperature.,

please help to slove this,.

please and thank you 

note: the sample example and memory layout is in below image 

  • Hi Surya,

    You have to keep block size to 4 bytes if you want to store only one integer of data, declare two blocks to store temperature and pressure and dedicate block-1 for temperature and block-2 for pressure. You can call corresponding block to store the data of corresponding parameter.

    --

    Thanks & regards,
    Jagadish.

  • Thank you so much for your reply.,

  • Dear sir., 

    when Iam writing the pressure value again into the block its going to struck at that line ., Is we need to write some functions to overwrite the data in the block if the block is full.,or it will automatically overwrite the data?


    TI_Fee_WriteAsync(BlockNumber,&pressure_value);
    do
    {
    TI_Fee_MainFunction();
    delay();
    Status=TI_Fee_GetStatus(0);
    }
    while(Status!=IDLE);
    BlockNumber = 0x2;
    TI_Fee_WriteAsync(BlockNumber,&temp_value);
    do
    {
    TI_Fee_MainFunction();
    delay();
    Status=TI_Fee_GetStatus(0);
    }
    while(Status!=IDLE);
    pressure_value = 120;
    BlockNumber = 0x1U;
    TI_Fee_WriteAsync(BlockNumber,&pressure_value);      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Complier strucks here 


    do
    {
    TI_Fee_MainFunction();
    delay();
    Status=TI_Fee_GetStatus(0);
    }
    while(Status!=IDLE);

  • I don't understand the memory locations,the first 32 bytes is for virtual sector header and the next 24 bytes is for data block header,But In memory its showing data first next the data header ? what is the wrong in it,could you please explain it ?

  • HI Surya,

    Your data looks confusing, i am attaching my code here please go through it once and verify your configurations and code with my reference code.

    FEE_TEST_LC4357.zip

    I also added two reading functions in above code except that remaining everything matches your code,

    Using above code i got the below data into the flash bank-7

    In above data yellow indicates the virtual sector header, blue indicates the pressure sensor data i.e.block-1 and red indicates the temperature sensor data i.e.block-2.

    I am suspecting one thing actually you wrongly did the configuration first time right? did you erase the flash completely after modifying your configurations and code?

    If not, please make sure to erase entire flash for the first time after immediately performing a new configurations for FEE blocks or sectors in HALCoGen.

    Here is the option to erase entire flash

    Note: I created project on TMS570LC4357 not in TMS570LS3137.

    --

    Thanks & Regards,
    Jagadish. 

  • dear sir., 

    gone through your code and make necessary changes and I got the same data in memory as your sample and after that Iam trying to overwrite the data in the block value i.e., pressure value to other but why it is not overwriting the data in block number 1,why it is storing at another location as shown below ?

  • Hi Surya,

    pressure value to other but why it is not overwriting the data in block number 1,why it is storing at another location as shown below ?

    Don't get confused that is expected behavior only. It is not actual EEPROM right, it is flash emulated EEPROM. Here data won't get overwrite and here minimum erase size is sector only. So, here whenever you write some new data to a block it will again store in new memory locations instead of overwriting old one, but the written data will be marks as invalid and new data as valid, so whenever you again request to get some block of data then FEE driver will give you the latest valid data only.

    Please verify read function with block number to get a clarity on above behavior.

    And after certain number of writes the virtual sector will get completely fill right, at that instant all the previous valid data will get copied into the new virtual sector and old virtual sector will mark for erase operation.

    I hope this clarifies your doubts.

    --

    Thanks & regards,
    Jagadish.

  • thank you so much for your reply ., 

    I understand everything now