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.

TMS570LC4357: F021 FAPI read functionality

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi,

I am writing a code and I am trying to read the contents of some Flash memory regions. Before trying anything I am searching for information and I have found information for programming and erasing flash memory regions but for reading operations, the information is scarcer.

On one hand I have found Flash API functions like Fapi_doMarginRead() and Fapi_doMarginReadByByte() which seems what I should use. Previous to that it is stated that Fapi_initializeFlashBanks() should be called. And that is more or less everyting because no FSM is shown for the reading operation in the reference guide or at least I haven't found it (though I guess I should use something similiar to the erase/programming FSM).

On the other hand, the TI_FEE source code already has some read operations like TI_Fee_ReadSync and TI_Fee_Read which just do some checkings, and the TI_Fee_MainFunction() which is the one efectively making the read operation without using the FAPI functions:

So basically my doubts are in the line of which option to use:

  1. Copy FEE code and use it for other banks
  2. Use the FAPI library in which case I don't know exactly which program flow I should follow.

Thanks in advance and kind regards.


 

  • Hi Guillermo,

    If your requirement is to just write some data to the flash and read the data from flash then FAPI's are good for your requirements.

    Here is an example for FAPI usage:
    4544.FAPI_TEST_LC4357.zip

    1882.FAPI_TEST_LC43.zip

    Or else if your requirement is to emulate EEPROM functionality in flash memory then please use FEE code.

    You can find FEE example HALCoGen itself.

    open help topics:

    And there in examples section you can find FEE example with step by step procedure:

    Or you can also refer my FEE example.

    3058.FEE_TEST_LC4357.zip

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    First thanks you for your answers. I am afraid they don't respond to my doubt so I'll try responding to you in line.

    If your requirement is to just write some data to the flash and read the data from flash then FAPI's are good for your requirements.

    As I mentioned right now I am only worried about reading.(writing will come in the future).

    Here is an example for FAPI usage:
    4544.FAPI_TEST_LC4357.zip

    1882.FAPI_TEST_LC43.zip

    Both examples are for writing so not what I was asking for. Also the examples write in the Flash Bank 7 which as I understood from the datasheet is reseved for Emulated EEPROM functionality but those examples use Fapi instead of FEE. Is there an explanation for that?

    Or else if your requirement is to emulate EEPROM functionality in flash memory then please use FEE code.

    My requirement is to read Flash from Banks different than Bank 7 and I would like to do it in a reliable and most efficient way.

    I would like to remark again that I am not finding a reading FSM when using Fapi.

    Thanks again and kind regards.

  • Hi,

    Both examples are for writing so not what I was asking for. Also the examples write in the Flash Bank 7 which as I understood from the datasheet is reseved for Emulated EEPROM functionality but those examples use Fapi instead of FEE. Is there an explanation for that?

    FAPI routines can be used to write data to the any bank of the flash, its not just only Bank-7 but using these routines we can write to bank-0 and bank-1 as well.

    Here is an example to write Flash Bank-1:
    7506.FAI_TEST_RM57.zip

    It is on RM57 but the same process will be applicable for LC4357 devices.

    My requirement is to read Flash from Banks different than Bank 7 and I would like to do it in a reliable and most efficient way.

    Actually, i didn't use the read functions in the application i provided but you can refer FAPI user guide to learn different read functions available and you can use them.

    2845.SPNU501G.pdf

    --

    Thanks & regards,
    Jagadish.

  • Hi,

    Actually, i didn't use the read functions in the application i provided but you can refer FAPI user guide to learn different read functions available and you can use them.

    2845.SPNU501G.pdf

    Exactly, that is one of the reason of my questions in the first post:

    On one hand I have found Flash API functions like Fapi_doMarginRead() and Fapi_doMarginReadByByte() which seems what I should use. Previous to that it is stated that Fapi_initializeFlashBanks() should be called. And that is more or less everyting because no FSM is shown for the reading operation in the reference guide or at least I haven't found it (though I guess I should use something similiar to the erase/programming FSM).

    To try again to make myself clearer, if for example I wanted to make writing operations following strictly and only the API documentation I don't think I would reach an equivalent code as the one proposed in the examples or the FSMs for writing proposed in the SPNA148 "Advanced F021 Flash API Erase/Program Usage". So, as I want to do simple read operations I am asking for documentation on the appropriate coding flux there should be followed to make those read operations.

    Thanks again and kind regards.

  • Hi,

    So, as I want to do simple read operations I am asking for documentation on the appropriate coding flux there should be followed to make those read operations.

    Unfortunately, there is no other document for to explain read operations other than the FAPI user guide i already given.

    But i can provide you one sample code for simple read operation, here it is:

    Fapi_StatusType status = Fapi_doMarginRead( (uint32_t *)addr, (uint32_t *)buffer, size, Fapi_NormalRead);
    
    if (status == Fapi_Status_Success) {
    
    /*Read operation success, so please perform necessary operation on read data which is present int the buffer*/
    
    }
    else
    {
    
    /*Read operation got failed, this condition should not occur check the arguments to the function properly*/
    
    }

    --

    Thanks & regards,
    Jagadish.