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.

RM48L952: FEE Library

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN

Tool/software:

Hello,

I am working on FEE in order to store some data and calibration values in non-volatile memory.
The FEE Driver is enabled in HalCoGen version 04.07.01 in order to generate the driver, configuration and device specific files. The F021 Flash API library version 02.01.01 that is located in the HalCoGen install folder is also used in the project.
I have two questions regarding the FEE:

1) Is my setup correct or shall I add/replace some files?
I see in the online ressources that the  TMS470M Flash EEPROM Emulation Driver can be downloaded. But it seems not to be supported by my device, and to be an older version that the one generated by HalCoGen.
I couldn't find a version for my device in the online ressources so I assume that I shall keep the files generated by HalCoGen, and not replace them by a library/driver found elsewhere.

2) After reading the TI FEE User Guide, I understand that it is not possible to store data in the 4 flash sectors simultaneously: only 2 of them can be used, while the other 2 will be used when the first ones will be full.
Is my understanding correct ?

Thank you for your support,
Dany

  • Hi Dany,

    1) Is my setup correct or shall I add/replace some files?

    Your setup was correct.

    My suggestion is that, you can find FEE example for RM48 in HALCoGen itself. You can access it by the following steps:

    First go to the "Help Topics" section in the HALCoGen

    Here in "Examples" section you can find the example called "example_TI_Fee_Write_Read"

    In this example you can find step by step procedure along with the code for FEE example.

    Just follow these steps.

    2) After reading the TI FEE User Guide, I understand that it is not possible to store data in the 4 flash sectors simultaneously: only 2 of them can be used, while the other 2 will be used when the first ones will be full.
    Is my understanding correct ?

    Not exactly like that.

    Actually, what we should need to do is that we should need to combine the physical sectors into some virtual sectors (min of two). Now for example i created two virtual sectors VS1 and VS2, here i also assuming that i created VS1 by combining first two physical sectors and VS2 by other two physical sectors.

    Now initially the FEE driver sets the VS1 as active virtual sector, and it stores the all the data into the VS1 inters of the data blocks. Once this VS1 completely gets filled then FEE driver will copy the active data blocks(active data blocks means you can assume like latest data, i mean if you write a data block two times then old data will be marked as invalid and new data as active data block) of VS1 into the VS2 and also marks the VS1 as Erase sector, so that VS1 will get erase in the background and mean while the new data will now get moved to the VS2.

    Now if this VS2 also gets filled then FEE driver will again go back to the VS1, and it will move all active data blocks of VS2 into the VS1 and marks VS2 for erase. And this process will be continued.

    Note:

    Theoretically you can also configure more than two virtual sectors using FEE but i a saw a issue doing this in my recent testing. Please refer my last comment in the below thread:

    (+) TMS570LS1224: FEE specific questions - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    So, my suggestion would be better to use only 2 virtual sectors. That will be enough to store the data continuously without any issues.

    --
    Thanks & regards,
    Jagadish.

  • Hello Jadadish,

    thank you for your answer.
    Okay, if the setup is correct, that's a good start. Thanks for the example :)

    I have some more question regarding the FEE behavior: let's assume I would like to store some calibration parameters in a first VS, event logs in a second VS, and some various data in a third VS. If I understood correctly, that wouldn't be possible because it would require 3 active VS and 3 backup VS, meaning at least 6 physical sectors, while my device only has 4.
    So I would need to store all these data in the same VS for exemple, is that correct?

    Also, why is the FEE only erasable by sector? Is it made in order to write in all the memory cells before erasing, so that the lifetime of a sector is maximized ?

    Best regards,
    Dany

  • Hi Dany,

    let's assume I would like to store some calibration parameters in a first VS, event logs in a second VS, and some various data in a third VS. If I understood correctly, that wouldn't be possible because it would require 3 active VS and 3 backup VS, meaning at least 6 physical sectors, while my device only has 4.

    I think you are not understanding it well, i would suggest you refer TI fee user guide once again:

    Actually, we cannot dedicate each sector to one parameter. I mean it is never possible to access all the sectors at a time.

    The data should need to be store in the data blocks format.

    For example, in your case you should need to create 3 data blocks as below

    I am assuming your calibration data is 16 bytes, then you should need to create first data block as 16 bytes which can be used for calibration data and similarly two more data blocks need to create with respective sizes for event logs and some other data etc.

    Now whenever you want to write some data you should need to call the write function with respective block number as below.

    And similarly, for read function also you should need to call with respective block number.

    Actually, you no need to be bother about virtual sectors, actually virtual sectors handling will be taking care by FEE driver internally. The only thing is that you need to create two virtual sectors that's it.

    This is just FEE internal operation, sharing for your understanding of internal operation:

    Let's assume i created two FEE Virtual sectors and 3 data blocks.

    So, what FEE driver will do is that whenever you are trying to write in one data block then FEE will write the data block to the VS1. It will write all the data blocks into the VS1 only until it gets completely filled.

    And if any block called multiple times with new data, then FEE internally marks the latest block as valid and all previous data of the corresponding block as invalid. If you call the read function with block number, then FEE will give the latest valid data for the corresponding block.

    Once VS1 gets completely filled then FEE will copy all the latest valid data blocks in the VS1 into the VS2 and marks the VS1 for erase. Now if you write any new data to the blocks then they will continue to write into VS2 and this process will continue till VS2 gets filled. Once VS2 gets filled then FEE will copy all the valid data blocks in the VS2 to the VS1 and marks the VS2 for erase operation. This process continues.

    --
    Thanks & regards,
    Jagadish.