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: TI_Fee_Init always erase bank memory

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN

Hi, to all. I had a problem using Fee driver. I use F021_API_CortexR4_BE_V3D16.lib , CCS Version: 10.1.1.00004,  HALCoGen: 04.07.01 - Released 11.December.2018, 

Halcogen config

when main start i call TI_Fee_Init 

/* Initialize FEE. This will create Virtual sectors, initialize global variables etc.*/
TI_Fee_Init();
do
{
TI_Fee_MainFunction();
delay();
Status=TI_Fee_GetStatus(0 );
}
while(Status!= IDLE);

and the other functions are, this to writte

do
{
BlockNumber=0x1;
TI_Fee_WriteAsync(BlockNumber, &SpecialRamBlock_H[0]);

do
{
TI_Fee_MainFunction();
delay();
Status=TI_Fee_GetStatus(0 );
}
while(Status!= IDLE);
// guardo los bloques en memoria
Status= TI_Fee_GetJobResult(0);
}
while(Status != JOB_OK);

 and this to read

BlockNumber = 1;
BlockOffset = 0;
Length = 0x1FFF;
Read_Ptr = (unsigned char*)&SpecialRamBlock_H;
oResult=TI_Fee_Read(BlockNumber,BlockOffset,Read_Ptr,Length);
do
{
TI_Fee_MainFunction();
delay();
Status=TI_Fee_GetStatus(0);
}
while(Status!=IDLE);

I writte array of 8191 bytes. and i read it ok. But when i reset the uC in CCS. Memory remains OK.

This goes erased always when I call Ti_Fee_Init(). And I need that information stored in uC.

I don't understand why this happens. It is supposed that left memory untouched, because it has data written.   

Any suggestion I am lost. Read all and try many things nothings works.

Thanks in advance

 

   

  • This goes erased always when I call Ti_Fee_Init().

    Did you write block data to FEE after calling TI_Fee_Init()? 

  • Hi QJ, I send data to uC by Rs232 and write block data. After that, I reset uC from CCS. And data still remains in bank7. When I reach Ti_Fee_Init it delete it.

  • This is a picture of memory before i go inside TI_Fee_Init()

    I ejecute code and got this

  • From the virtual sector status (0x000000000000FFFF, first 8 bytes) and the erase status of the Virtual Sector (0x000000000000FFFF, 3rd 8 bytes), this virtual sector is "Ready for Erase" which means that this Virtual Sector’s Data Block Structure has been correctly replicated to a new Virtual Sector and is now ready to be erased and initialized for re-use.

    Please check if the block #1 has been copied to next virtual sector. 

    In your configuration, each VS is 16 KBytes and block size is 8Kbyes. Each sector can hold only one block (8KB payload + 24 bytes header) plus sector header (32 bytes). Whenever you initiate a block write operation, the new block will be programmed to next active virtual sector and the existing valid block will be copied to the new active virtual sector. It is not usual to use such big block for FEE. Can you use decrease the size of the data blocks? and increase the size of virtual sectors (to 2 virtual sectors, each has 32 KB)?

  • OK, in this project I need to store in memory 2 tables of 8Kwords (16bits). So I receive by serial comm, 16kb of data. That I store in High and Low bytes. That is why i use 4 sections of 8kb. 

    If I understand what you told me, I could use 1 VS of 32768 bytes from this 24bytes for header and 32bytes sector header, so in payload I got 32712 bytes for use. And write them in one time. But what i don't understand it is who change the information of erase of virtual sector.    

  • Hi Juan,

    I think the FEE doesn't work for your use case. There are 2 blocks of 16KB data payload. 

    1. Virtual sector header size is 32 bytes. 

    2. Program 1st block: 16KB + 24 bytes header

    3. program 2nd block: 16KB + 24 bytes. Since VS#1 doesn't have enough space (32KB-16KB -24bytes-32bytes), the 2nd block is programmed to VS#2, then copy the block 1 (programmed in VS#1) to VS#2, but VS#2 doesn't have enough space for 1st block,...

    The FEE driver updates the VS header.

  • HI QJ, I think that now I understand this. We talk here. And we think that if we only use 16000 bytes we left 384 bytes for headers. So, in that case could work. We will try and told you.

  • HI QJ, I try with 2 blocks of 16000 bytes. And works fine. Init and writte function was the same. I change a little read function.

                 BlockNumber = 2;
                 BlockOffset = 0;
                 // I change here
                 Length = 16000;//0x1FFF;
                 Read_Ptr = (unsigned char*)&ucFEE_ARRAY_CURVA;
                 oResult=TI_Fee_Read(BlockNumber,BlockOffset,Read_Ptr,Length);
                 do
                 {
                     TI_Fee_MainFunction();
                     delay();
                     Status=TI_Fee_GetStatus(0);
                 }
                while(Status!=IDLE);
     

    And configuration in HAL change in this way

    What I don´t know, I need to erase block before writte if it had information. I writte without erase and works, but maybe it need it.

    Thanks 

    PD: Well yesterday all works fine. Today I writte 2 times and got erased by Init. I had added before writte, the erase function. It doesn´t work.