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.

TMS320F28P650DK: EEPROM emulation

Part Number: TMS320F28P650DK
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hello,

I have question on the eeprom emulation library [www.ti.com/.../sprade8a.pdf

1. For eg: if we have a set of variables to write to eeprom - Var1-VarN, is it possible to retrieve Var2 by specifying the address of Var2?
    Eeprom_Read() function reads the last backed up data.


2. Our use case requires us to back up a set of values into eeprom, readback and restore them upon boot.

3. Additionally it must be possible to read or update an existing eeprom entry out of order. Based on above example, after writing Var1-N we would like to update Var5 along for eg.

Are the above requirements feasible with the eeprom emulation library?

Thanks

Jay

  • Hello,

    I have looped in the expert from the team, and they should get back to you with a response in the next 1-2 days.

    Best Regards,

    Delaney

  • Hi Jay,

    1. No, the EEPROM_Read function will read the entire most recent page of data. To read a specific variable, call this function and then index into the read buffer to retrieve the value.

    2. This can be done. The values are stored in flash and will persist through a power cycle.

    3. This is possible, but the whole data page must be passed to the EEPROM_Write() function. To update a specific value, you would read the most recent page into a buffer with EEPROM_Read(), update the needed variables, then write the buffer to flash with EEPROM_Write().

    Best,

    Alex

  • Hi Alex,

    Are there any training materials or eg code for eeprom with above features?
    Let me describe our use case and some questions I have.

    1. We need to be able to write data to eeprom and each entry corresponds to an independent variable. The total number of variables could span multiple eeprom pages.

    2. upon every boot up, we should be able to retrieve all the entries in the eeprom and back them up to ram variables to be used by the application.

    3. We require the ability to modify particular eeprom entries.

    a. for eg: lets say we have 50 eeprom entries and first 20 are in page 0 and second 30 and are in page 1. We should be able to modify entry 18 and entry 40. the above requires us to :

    • read page 0 to modify entry 18 and write it back.

    • read page 1 to modify entry 40 and write it back.

    Thanks

    Jay

  • Jay,

    The application note and example are the only materials on EEPROM emulation for this device.

    Each page in this example is an instance of a full EEPROM unit. The pages and banks are used to index the flash and track the current/most recent EEPROM unit/data, i.e. you can't split data between two EEPROM pages.

    Reading and writing multiple variables is possible with this example, but you will have to use EEPROM_Read (or give the address directly) and EEPROM_Write.

    Best,

    Alex

  • Hello Alex,

    Jumping in here if I may please - as I've communicated offline with the customer:

    They are happy to explain their requirements again in an attempt to find resolution on this inquiry.

    Here goes:

    "We could not yet clearly understand the APIs provided by the EEPROM emulation software. Hence we may have mis-understood the capabilities.

     

    • Here are our key requirements:
    • We would have an arbitrary number of eeprom variables [of different sizes].
      • If we should limit the number of entries, we would like to know and we could possibly work with that.
    • Out of order read and update access once the initial set of eeprom variables are written
      • For eg: if we have 100 eeprom variables, we should be able to read entry number 20 and amend entry number 80
      • I am not sure what are the limitations in this regard due to the underlying eeprom page structure
    • Ability to append to the eeprom variable list.
      • As in above eg: if we have 100 eeprom variables, we should be able to add 10 more new variables to the eeprom.

     

    Which are the APIs we should use to achieve the above?

    Since flash is underlying storage, entire sector should be erased and updated to update even a single entry. We can accommodate that. Furthermore, we would add brownout detection capability to avoid data loss.

     

    Is the EEPROM emulation intended as an eeprom replacement or not? I believe what we have outlined above is the typical usage for an eeprom.

     

    If there are existing examples for above use case, we could start with those.

    "

    Your comments and input are welcomed very much!

    TY,
    CY

  • While we await additional input, I did find the example project after all (it is meant to simulate HW EEPROM as best as it can):

     The F28P65 demo located in:

    C:\ti\c2000\C2000Ware_5_02_00_00\driverlib\f28p65x\examples\c28x\flash

    Best Regards,

    Chris

  • Hello,

    We would have an arbitrary number of eeprom variables [of different sizes].
    • If we should limit the number of entries, we would like to know and we could possibly work with that

    The number of variables/total size of the data being stored must be known beforehand. The EEPROM size is set using the DATA_SIZE macro in EEPROM_Config.h.

    This EEPROM implementation assumes that all variables are the same size.

    If variable sizes are desired, you would need to keep track of how the data is structured within a page/the size of each variable. EEPROM_Read() reads all data in a page into a data buffer/array - from there you could extract variables of different sizes with e.g. typecasted pointers.

    Out of order read and update access once the initial set of eeprom variables are written
    • For eg: if we have 100 eeprom variables, we should be able to read entry number 20 and amend entry number 80
    • I am not sure what are the limitations in this regard due to the underlying eeprom page structure

    The EEPROM_Read() API will read all of the most recent EEPROM data into a data buffer/array. From there, to access a specific variable, you would index your array similar to: int x = data_buffer[19].

    To update the EEPROM variables, modify them in the data buffer, then call EEPROM_Write().

    All EEPROM data is read/written each time when calling these functions as each EEPROM page is blank/in an erased state initially.

    Ability to append to the eeprom variable list.
    • As in above eg: if we have 100 eeprom variables, we should be able to add 10 more new variables to the eeprom.

    The EEPROM size is set using the #define DATA_SIZE macro in EEPROM_Config.h. Thus, it is immutable and should always be set to the maximum expected size of the EEPROM. Allocating more space at runtime is not supported.

    Best,

    Alex

  • Hi Alex,

    Much obliged here, very much!

    I've sent all of this feedback to the customer and await their feedback.

    honestly, we should be able to close this out shortly.

    Thank you again,

    Chris

  • Alex,

    Actually, one last clarification if I may please:

    The EEPROM_Read() API will read all of the most recent EEPROM data into a data buffer/array. From there, to access a specific variable, you would index your array similar to: int x = data_buffer[19].

    Based on above description, there is only a single active eeprom page possible with the emulation software? I believe that is the case, since there is no provision to read older pages with an API such EEPROM_Read(page_num).

     If that is the case, how large can this single eeprom page be?  Is there an upper limit to the value that can be set in EEPROM_Config.h.?

    THX,
    Chris

  • Hi Chris,

    there is only a single active eeprom page possible with the emulation software?

    Yes, this is correct. One way to think of it would be that each page is one "iteration" of the EEPROM data.

    how large can this single eeprom page be?  Is there an upper limit to the value that can be set in EEPROM_Config.h.?

    The maximum size would be however many sectors have been allocated for emulation - (bank status bits + page status bits). It also cannot be larger than a flash bank.

    Best,

    Alex

  • Alex and All,

    RESOLVED!  Thank you kindly.

    -Chris