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.

TMS570LS1224: FEE specific questions

Part Number: TMS570LS1224


hello. Last time I asked about FEE and got an answer, I saw it working, but I have a few more questions.

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1256250/tms570ls1224-questions-about-the-fee-concept

Condition 1: Set 4 Virtual Sectors (VS) to 16 KB.
Condition 2: set to maximum capacity in multiples of 8 bytes per block

VS Header
(bytes)
Block
Header(bytes)
Block
Payload(bytes)
32 Block1 24 992
Block2 24 992
Block3 24 992
Block4 24 992
Block5 24 992
Block6 24 992
Block7 24 992
Block8 24 992
Block9 24 992
Block10 24 992
Block11 24 992
Block12 24 992
Block13 24 992
Block14 24 992
Block15 24 992
Block16 24 992
Used VS Length (bytes) 16288
Max VS Length (bytes) 16384

I captured the debugging screen as a video, but the size is large, so I upload the situation as a web link.

[ Debug result 1 ]

https://www.youtube.com/watch?v=9mtg-h9e4DM

Summary of results - Debug result 1: failed.

# test 1. write VS1 -> write VS2 (failed. Presumed to be a problem caused by not performing block invalidation)

# test 2. write VS1 -> invalidate VS1 -> write VS2 -> invalidate VS2 -> write VS3 -> invalidate VS3 -> write VS4 -> invalidate VS4

          -> write VS1 -> invalidate VS1 -> write VS2 -> invalidate VS2 -> write VS1(??) -> invalidate VS1(??) -> write VS2 -> invalidate VS2 

          -> write VS1(??) -> invalidate VS1(??) -> write VS2 -> invalidate VS2....

[ Debug result 2 ]

https://www.youtube.com/watch?v=dL3f87oDIH4

Summary of results - Debug result 2: succeed

# test 3. write VS1 -> invalidate VS1 -> invalidate VS1(re) -> write VS2 -> invalidate VS2 -> write VS3 -> invalidate VS3 -> write VS4 -> invalidate VS4 -> invalidate VS4(re)

          -> write VS1 -> invalidate VS1 -> invalidate VS1(re) -> write VS2 -> invalidate VS2 -> write VS3 -> invalidate VS3 -> write VS4 -> invalidate VS4 -> invalidate VS4(re)

          -> write VS1 -> invalidate VS1 -> invalidate VS1(re) -> write VS2 -> invalidate VS2 -> write VS3 -> invalidate VS3 -> write VS4 -> invalidate VS4 -> invalidate VS4(re)

If you explain it with a picture, the order will be like this.

For reference, I took a Memory browser dump capture in an Excel file.

[ excel file - Memory browser dump. ]

FEE Virtual Test (debugging).xlsx

 

Now I have 3 questions.


Q1. In the previous answer, you said that block invalidation is not necessary, but when you allocate 16 blocks with 992 bytes per block and set the total block capacity to approach the capacity of 1 VS, the problem occurs with the following VS as shown in the debug result 1. So, is it correct to invalidate the block when moving to the next VS?

Q2. As in debug result 1, if the block is invalidated after being written only once, VS1 -> VS2 -> VS3 -> VS4 -> VS1 -> VS2 -> VS1 -> VS2 is repeated, and VS3 and VS4 are written only once. .
As in debug result 2, invalidating twice in a row for VS1 and VS4 activations fixed the problem. Is this way right?

Q3. If we didn't set the capacity per block as in condition 2 above, but just set 8 bytes per block, we didn't need to do invalidate after write. In the end, should invalidation be done when there is VS transition, and should not be nullified when there is no VS transition? (If the VS total block capacity is 1/N or less than the capacity of 1 VS, the sector can be written N times without invalidating the block, and the previously written area is automatically invalidated.)

I would like to understand and solve the problem. I would appreciate it if you could answer the three questions.

The source code I tested is attached below.

example_eeprom_new3 (2)_992bytes.zip

  • Hi,

    We started working on your issue and will try to provide an update ASAP.

    --

    Thanks & regards,
    Jagadish.

  • Hi,

    First of all, apologies for the delay in response.

    # test 1. write VS1 -> write VS2 (failed. Presumed to be a problem caused by not performing block invalidation)

    # test 2. write VS1 -> invalidate VS1 -> write VS2 -> invalidate VS2 -> write VS3 -> invalidate VS3 -> write VS4 -> invalidate VS4

              -> write VS1 -> invalidate VS1 -> write VS2 -> invalidate VS2 -> write VS1(??) -> invalidate VS1(??) -> write VS2 -> invalidate VS2 

              -> write VS1(??) -> invalidate VS1(??) -> write VS2 -> invalidate VS2....

    I even discussed with FEE designer, and it is true, i mean as i discussed earlier we no need to do invalidate the virtual sectors. The sector management will be done automatically by FEE driver itself. And at any given point of time only one active sector will be there.

    And i also don't understand how you are writing virtual sectors wise:

    extern Std_ReturnType TI_Fee_WriteAsync(uint16 BlockNumber, uint8* DataBufferPtr);

    extern Std_ReturnType TI_Fee_WriteSync(uint16 BlockNumber, uint8* DataBufferPtr);

    As you can see in above routines, the data will always be written in terms of block numbers. So, we have to give the block number and its data, so once we gave block number then FEE driver will automatically write the data of the corresponding data, if that block is already written with some old data, then driver will make it as invalid block. This process will continue till the active sector full, once the active sector full of data then FEE driver will automatically copy the active blocks data in the current sector to the new sector and marks the new sector as active sector and also makes the old sector as invalid and do the erase operation on old sector. This process will again continue.

    --

    Thanks & regards,
    Jagadish.

  • Thanks for your reply. But I don't understand.
    question is about Q2.
    Virtual sector transition order is not 1 -> 2 -> 3 -> 4 -> 1 -> 2 -> 3 -> 4, but 1 -> 2 -> 3 -> 4 -> 1 -> 2 -> 1 -> 2.
    The order is as follows: I would appreciate it if you could answer questions Q1~Q3 again.

  • Hi Eun Kyu,

    I did debug your code and i could see the behavior you mentioned, yes i too observed that after first iteration the VS3 and VS4 are not becoming active sectors for write operation.

    Give me some time to debug further and provide an udpate.

    --

    Thanks & regards,
    Jagadish.

  • Thank you for checking.

  • Hi Eun Kyu,

    I am out of office till this Monday, please expect some delay for further updates on this issue.

    --

    Thanks & regards,
    Jagadish.

  • Hi Eun Kyu,

    I am back from vacation, give me some time to discuss with internal team for providing further updates.

    --

    Thanks & Regards,
    Jagadish.

  • Hi Eun Kyu,

    Appreciated your patience, still i didn't get proper feedback from internal team. Give me some more time for to provide a proper update.

    --

    Thanks & regards,
    Jagadish.

  • Hi Eun Kyu,

    I will provide you an update by the end of this week. The problem is there is no active support team for FEE, so i will go through the code myself and will provide an update.

    --

    Thanks & regards,
    Jagadish.

  • Hi Eun Kyu,

    Sorry i didn't get a chance to look this issue in last week. This week i am free from other issues so i can spend time on this issue.

    --

    Thanks & regards,
    Jagadish.

  • Hi Eun Kyu,

    I understood the behavior why 3rd and 4th virtual sectors is not utilizing after first iteration. Here is the explanation

    Once the writing block size greater than the current virtual sector size then we are using the function "TI_FeeInternal_FindNextVirtualSector" to determine next free virtual sector.

    Here to find out the next virtual sector to write, they are following below priority order:

    Here first they will verify for Empty virtual sector, and if there is no empty virtual sector then they will verify for Invalid virtual sector and if there is no invalid virtual sectors then they will Erase Virtual sector. And the verification order in each of the case is from virtual sector 1 to the virtual sector 4.

    So, after device erased and programmed then all the virtual sectors will be in "Invalid virtual sectors" state right?

    1. So, in the first iteration, after crossing writing data in the VS1 then "TI_FeeInternal_FindNextVirtualSector" will return VS2 because all three virtual sectors are in invalid virtual sectors state only right so this function will give us VS2 as next virtual sector.

    2. And our data will be written into the VS2 now and all the valid data in the VS1 also will be copied into this VS2. And now VS1 will be marked as "Erase Virtual Sector".

    3. Now after crossing writing data in the VS2 then "TI_FeeInternal_FindNextVirtualSector" function will return VS3 and it won't return VS1 because VS1 state is "Erase Virtual Sector" and as per priority if there is no invalid sector then only, we will go for Erase Virtual Sectors, but we have invalid sectors VS3 and VS4 right so VS3 will get returned.

    4. And our data will be written into the VS3 now and all the valid data in the VS2 also will be copied into this VS3. And now VS2 will also be marked as "Erase Virtual Sector".

    5. Now after crossing writing data in VS3 then "TI_FeeInternal_FindNextVirtualSector" function will return VS4 and it won't return VS1 or VS2 because VS1 and VS2 state is "Erase Virtual Sector" and as per priority if there is no invalid sector then only, we will go for Erase Virtual Sectors. But we have invalid sector VS4 right, so VS4 will get returned.

    6.  And our data will be written into the VS4 now and all the valid data in the VS3 also will be copied into this VS4. And now VS3 will also be marked as "Erase Virtual Sector".

    7. Now after crossing writing data in VS4 then, as there are no invalid sectors and all other sectors except active VS4 will be in Erase virtual sector state only right, so as per order VS1 will be returned by "TI_FeeInternal_FindNextVirtualSector".

    8. And our data will be written into the VS1 now and all the valid data in the VS4 also will be copied into this VS1. And now VS4 will also be marked as "Erase Virtual Sector".

    9. Now after crossing writing data in VS1 then, as there are no invalid sectors and all other sectors except active VS1 will be in Erase virtual sector state only right, so as per order now VS2 will be returned by "TI_FeeInternal_FindNextVirtualSector"

    10. And our data will be written into the VS2 now and all the valid data in the VS1 also will be copied into this VS2. And now VS1 will also be marked as "Erase Virtual Sector".

    11. 7. Now after crossing writing data in VS2 then, as there are no invalid sectors and all other sectors except active VS2 will be in Erase virtual sector state only right, so as per order VS1 will be returned by "TI_FeeInternal_FindNextVirtualSector".

    And this process will be continued and only VS1 and VS2 will get used after the first iteration.

    --
    Thanks & regards,
    Jagadish.