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: Data backup inside FEE module

Part Number: TMS570LS3137


Hi,

I am designing NVM class for reliable persistent configuration management and I am confused a little bit about how does FEE actually work. Usually, when I implement NVM storage, I manually prepare dual-bank memory configuration and operate at one at a time, so when write is interrupted I have working second copy. Does FEE driver cover this functionality? For more clarification of my intents:

1. I have only one block of size 30720 inside FEE Block Configuration, two Virtual Sectors are used, first one uses Flash Sectors 0-1, second one 2-3

2. I want to be sure that when TI_Fee_WriteAsync fails in some way (e.g. power loss) after executing TI_Fee_Read after restart I'll get valid data saved before power loss

Regards,

Bartosz Nowicki

  • Hi Bartosz Nowicki,


    I started working on your issue and i will respond you soon.

    --

    Thanks,

    Jagadish.

  • Hi @Bartosz Nowicki

    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:

    2678.TI FEE User Guide.pdf

    --

    Thanks,
    Jagadish.

     

  • Hi Jagadish,

    thank you for your input, however I think you missed a point. I've read FEE User Guide, and I am aware that size of Virtual Sector needs to be larger than size of all data blocks within this sector. As I've mentioned in my first post, my virtual sectors consist of two flash sectors, so Virtual Sector 1 is 32K and Virtual Sector 2 is 32K. My data block is 30K, so I think this condition is met. All I want to know is if those Virtual Sectors provide data redundancy - is Virtual Sector 2 a copy of Virtual Sector 1 and is it updated only after Virtual Sector 1 is successfully updated?

    Greetings,

    Bartosz

  • Hi Bartosz,

    All I want to know is if those Virtual Sectors provide data redundancy - is Virtual Sector 2 a copy of Virtual Sector 1 and is it updated only after Virtual Sector 1 is successfully updated?

    No it won't provide any data redundancy, and VS2 is not the copy of VS1. It will operate like below

    When you call first time write function with the data block number(remember in your case we have only single block) and with data you want to write, it will write your data in VS1 and make your data block as valid. So later whenever you call read function with data block number it will give block data that is present in VS1.

    Again if you try to update the data by calling write function with new data and block number, obviously your data not fit into VS1(because VS1 of size 32KB is already occupied with 30KB of block and your new data block is 30KB), so it will write your data block in VS2 and make your data block as Valid in VS2 and at the same time it will make your data in VS1 as invalid and also it enables VS1 erase operation. Now later if you call read operation with block number then it will give block data present in VS2.

    Similarly again if you try to update the data, this time your new data again moved to VS1 and VS2 will get start erase. In this way the process will continue.

    --

    Thanks,

    Jagadish. 

  • Hi Jagadish,

    thanks for your answer, it dispelled my doubts. I'll try to shrink my data structure and then provide data redundancy using second EEPROM.

    Regards,

    Bartosz