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.
Tool/software: TI C/C++ Compiler
Hello TI,
I have a question regarding the TI_Fee_Read - function :
Std_ReturnType TI_Fee_Read(
uint16 BlockNumber,
uint16 BlockOffset,
uint8* DataBufferPtr,
uint16 Length)
I am not able to read the data for a specific block number. For example I have configured 10 Fee blocks with different data sizes as it can be specified in ti_fee_cfg.h. After writing several times on different blocks by using the asynchronous write job and evaluating it on the Memory Browser, I wanted to readback all the dummy data I have written into the fee blocks.
But right now I am always reading the data content from the latest block which has been used to store data content. I mean the signature for the TI_Fee_Read is straight forward, but changing the "BlockNumber" after a read job doesn't cause anything. I am always getting the latest data which has been written into the FEE.
Hello,
Did you call TI_Fee_MainFunction regularly?
TI_Fee_Read and TI_Fee_WriteAsync reads and writes data asynchronously and TI_Fee_MainFunctino should be called at regular intervals to finish Read/Write asynchronous operation.
Hello Miro,
yes it is called regularly .The implemented code is based on the TI example.
oResult=TI_Fee_Read(1U,0U,&read_data[0U],10U);
do
{
TI_Fee_MainFunction();
delay();
Status=TI_Fee_GetStatus(0);
}
while(Status!=IDLE);
I would expect to read 10 bytes from the block number 1 in the fee, but I am getting always the latest data written in the fee, even if I perform the same steps with different block number (here block number 2)
oResult=TI_Fee_Read(2U,0U,&read_data[10U],10U);
do
{
TI_Fee_MainFunction();
delay();
Status=TI_Fee_GetStatus(0);
}
while(Status!=IDLE);
Hello,
Unfortunately I don't have the same MCU at my place but I made a test with TMS570LS1224 and everything works as expected. Is it possible to share your project so I can take a look at your settings and code?
Hello Miro,
I have created a new project from scratch and compared it against the project settings I had before. It looks like I have touched several parameter in the ti fee block configuration (e.g. data set as the TI Fee guide claims when you don't deal with Autosar which is the case, you can put it to zero, so I did that among with several other parameters ) which were not aligned with the template created by Halcogen.
Now everything is working as expected when I developed around the template.
I have another question according to this topic. When the application comes back to a point when it needs to re-write into a block which has been already programmed, is there any API I can use in order to abstract that issue or do I need to follow a specific and recommended sequence from TI , e.g:
1) Invalidate/erase
2) Write new data into block again
?
When I tried to perform a direct AsyncWrite job into a block number which has been already programmed, I can see on the Memeory browser that the expected data content was not written expect that the header status for the corresponding block was changed to "0xFFFF000000000000" - meaning invalid block.
Which procedure is recommended by TI to overcome this issue ?
Any updates on the following question
When the application comes back to a point when it needs to re-write into a block which has been already programmed, is there any API I can use in order to abstract that issue or do I need to follow a specific and recommended sequence from TI , e.g:
1) Invalidate/erase
2) Write new data into block again
?
When I tried to perform a direct AsyncWrite job into a block number which has been already programmed, I can see on the Memeory browser that the expected data content was not written expect that the header status for the corresponding block was changed to "0xFFFF000000000000" - meaning invalid block.
Which procedure is recommended by TI to overcome this issue ?
Hello,
TI_Fee_WriteSync and TI_Fee_WriteAsync writes a data block into FEE. When you update a block it doesn't necessarily erase the flash. It may make a 2nd copy of the block and then invalidate the old copy. It'll do this until it uses all the flash up within a virtual sector. When you fill a virtual sector, the FEE will copy only the latest (valid) blocks over to the new virtual sector, then it can erase the other one so it can be used again.
When you are "updating" data block FEE, driver will write it at a different physical address with the same block number .