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.

Ti FEE

Other Parts Discussed in Thread: HALCOGEN

Hi,

I am using example code example_TI_Fee_Write_Read.c in hecules board TMS570LC43XX which is available in Halcogen v04.04.00. I am unable to find flash memory location in which writing is happening and also  Read_Ptr is empty after the below function execution.

TI_Fee_Read(BlockNumber,BlockOffset,Read_Ptr,Length)

please help me to understand the program better.

Thanks

Apoorva

  • Hi Apoorva,

    FEE bank starts from address 0xF0200000. This information is provided in TRM and Data sheet. Also, please use HALCoGen v04.05.02 released yesterday.
  • Hi Vishwanath Reddy ,

    Thanks for your reply. I found that detail in device specific file Device_TMS570LC43.c . But I am not understanding why the Read_Ptr buffer is empty after function TI_Fee_Read(BlockNumber,BlockOffset,Read_Ptr,Length) . Please explain.

    Thanks,
    Apoorva
  • Hi Apoorva,

    Can you do step by step API execution and see what is happening? Is data getting written at 0xF0200000 after TI_Fee_Init and TI_Fee_WriteAsync API's are called?

    What is the API TI_Fee_Read returning? E_OK or E_NOT_OK?

  • Hi Vishwanath Reddy,

    I have executed API TI_FEE_Init and TI_Fee_WriteAsync step by step  and I noticed nothing has been written at address 0xF0200000. But when I closed the current debug session and opened a new one I noticed 8 bytes of data has been written at address  pointed by TI_Fee_GlobalVariables[u8EEPIndex].Fee_oWriteAddress of previous debug session. I am able to see this because I am not erasing entire flash during debug.

     

    The TI_Fee_Read returns E_OK.

    I am attaching code here.7558.Fee_problem.zip

     

    Thanks,

    Apoorva

  • Hi Apoorva,

    From the code you sent, I see that you are still using old code. Please update to latest version of FEE driver from HALCoGen 04.05.02. This has bugfixes.

    In HL_sys_startup.c , please comment _cacheEnable_(). This is required because default MPU settings are not correct from HALCoGen. Use latest version of HALCoGen v04.05.02 and check if FEE works as expected.
  • Hi Vishwanath Reddy,

    Thanks for the reply. I have used HALCoGen v04.05.02 now it is working. But only 8 bytes of data is writing into flash. Why it is so?
    Where will I get detailed explaination about _cacheEnable_().

    Thanks,
    Apoorva
  • Hi Apoorva,

    In HALCoGen v04.05.02, you need  not comment _cacheEnable_(). Default settings works for FEE. _cacheEnable_() function enables cache. You can find lot of documentation on cache on internet.

    You need to change the block size in ti_fee_cfg.c file if you need to write more than 8  bytes. 

  • Hi Vishwanath Reddy,

    Thank you for your help. Code is working properly as required.

    Thanks,
    Apoorva
  • Hi Vishwanath Reddy,

    Can I use API TI_FeeInternal_WriteDataF021() to write data into bank 0 or bank 1. Please give available write,read and erase API's for Bank0 and Bank1.

    Thanks,
    Apoorva
  • Hi Apoorva,

    For writing data to bank 0/1, you need to use F021 API's. Please look in to F021 documents, normally available at C:\ti\Hercules\F021 Flash API\02.01.01.

  • Hi  Vishwanath,

    I have gone through the document SPNU501G.

    1. What all I need to initialize in HALCoGen 04.05.02. in order to use BANK0/1.

    2.  I have used following code to erase sector

    f021_Address = (uint32 *) 0x00040000;

    Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,f021_Address);

    but after erase also there is some default data in the flash. what API I should use to erase sector properly?

    3.  For write I am using

        uint8_t Data[]={0,1,2,3,4,5,6,7};

        Fapi_issueProgrammingCommand(f021_Address,Data,8,0,0,Fapi_DataOnly);

        is it correct? I am not able to see the data in flash.

       Maximum how many bytes can be writtten to flash at a time.

    I am attaching my code here,

    4118.flash_WR.zip

    Thanks,

    Apoorva

  • Hi Vishwanath,

    Writing to bank 1 was successful. but I have few problems in my code please reply as soon as poossible

    1.I have used

    Fapi_doBlankCheck( f021_Address, 2, &f021_State );

    but it is not making flash erased region all F's.

    2.I tried programming and erasing Bank0. the control doesn't come out of below two functions.

    Fapi_issueProgrammingCommand(f021_Address,Data,32,0,0,Fapi_DataOnly);

    Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,f021_Address)

     

    Please help me to resolve these two problems. I am attaching my code here

    2248.flash_WR.zip

     

    thanks,

    Apoorva

     

  • Hi Apoorva,

    My answers below:

    Fapi_doBlankCheck API does not make erased region all F's. It only provides information if region has all F's or not. Only erase API will make all bit's as F's. Please keep in mind below:

    The erased flash on the LC4357 does not read all 0xFFFFFFFF because the ECC is always enabled. The ECC equation includes a number of address bits and at some addresses the combination of all '1's in the flash and ECC plus the address bits is viewed as a correctable error. The corrected value is what you see in CCS and it's not 0xFFFFFFFF. This is weird looking but it's the way the part is designed so just ignore it.

    2) I have run your code and it's coming to while(1).
  • Hi Vishwanath,

    I tried writing to bank0 but It was unsuccessful and it hangs at Fapi_issueProgrammingCommand() function .I am not able to find out what is going wrong in my code.

    I also tried writing to  bank 7 but because of these ECC corrected values there are some corrupted data values in between.

    Please find the screen shot below

    Please provide HALCoGEN settings and example code write and erase data into Bank0.

    Thanks,

    Apoorva