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.

TMS570LS1227: TI FEE Driver Usage

Part Number: TMS570LS1227

Hi,

This is regarding the use of the EEPROM Flash Bank to store configuration and other data. Based on my understanding, the TI FEE driver writes data sequentially into memory. Would it be possible to use the driver for FEE operations if the requirement is to partition the memory into sections to store different types of data?

For e.g. the first 32 bytes store system information, the next 256 bytes store configuration data, the next 1 KB stores some other data, etc. If my configuration data is 32 bytes in length, the first configuration should be stored at address 0x20. If the configuration is modified, it should be stored at the next address 0x40, and so on. When the end of the section (Address 0x120) is reached, the first record (at 0x20) should be erased and written with the new configuration. This should apply for all the partitions created in the FEE even when write calls to other sections occur between configuration writes. If this is possible, can you please elaborate on how it can be achieved?

Thanks and Regards,

Vimal

  • Hi Vimal,

    The emulated EEPROM is divided into two or more Virtual Sectors. Each Virtual Sector is partitioned into several Data Blocks. A Virtual Sector can contain one or more contiguous physical flash sectors. A minimum of 2 Virtual Sectors are required to support the TI FEE Driver.

    The size of a virtual sector MUST be larger than the size of all the Data Blocks. 

    When programming 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 is marked as ready for erase and the new one is marked as Active Virtual Sector. Any new data is now written into the new Active Virtual Sector and the Virtual Sector which is marked as ready for erase will be erased in background. 

    You can put all your system config info to one block for example block #1, config data is another block for example block #2. When you read/write block#2 to flash, you don't need to give the address which is assigned by the driver. When you write configure data (block #2) to the flash, the driver will check if block#2 is a valid block in flash, if it doesn't exist, the block #2 will be written to flash. Next time when you update the block #2, the driver checks if the new configuration data is different from the block #2 data in flash. If different, the new block #2 will be programmed to flash and marked as active block, and previous block #2 is marked as invalid block. If same, the write operation will be ignored. 

    Please check the FEE driver user guide:

    4478.TI FEE User Guide.pdf

  • Hi QJ Wang,

    Thanks for your response.

    Consider a scenario where the configuration data is rarely updated but snapshots of system data are frequently stored. Since the addresses are assigned by the driver, won't this result in my configuration data getting overwritten when the memory is full?

    Thanks and Regards,

    Vimal

  • Hi Vimal,

    When the virtual sector is full, all the valid data blocks including the configuration data will be copied to next virtual sector. The address of the block for configuration data is changed, but the configuration data is not changed. 

  • Hi QJ Wang,

    This would mean that the latest configuration data (being the valid block) would be preserved. But the older configurations (marked as invalid) would be erased. Would it be possible for me to retain more than one configuration block in such a scenario?

    Also, can more than one snapshot of the frequently stored system data be accessed (even if the block is marked invalid)? Or will I be able to read only the valid (latest) block? Since the FEE is being used for data logging, we need to be able to retrieve multiple records of the same type.

    Thanks and Regards,

    Vimal

  • Would it be possible for me to retain more than one configuration block in such a scenario?

    Yes, you can store the same config data to 2 or more different data blocks. But you don't have to.

    can more than one snapshot of the frequently stored system data be accessed (even if the block is marked invalid)? Or will I be able to read only the valid (latest) block?

    When you read the block, only the data in the valid block will be returned. The data in the invalid block is out of date, is different more or less from the data in the valid block.