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.

CCS/TMS570LC4357: FLASH Driver by F021

Part Number: TMS570LC4357
Other Parts Discussed in Thread: TMDX570LC43HDK, HALCOGEN

Tool/software: Code Composer Studio

Hello sir

we implement a internal flash driver by the F021 library(F021_API_CortexR4_BE_L2FMC_V3D16.lib) in the TMDX570LC43HDK board.

it can operate the EEPROM of Flash which is named BANK7. we can read data from it and we can write data into the EEPROM.But when I erase it , it didn't have any change for the data in the EEPROM.

so, I try the same program for BANK1 of FLASH, it didn't show any error, but it can't erase the BANK1 and it can't write data into the BANK1.

I don't know why, can you help me check my program? I upload it as attachment.

6685.flash_handle.c

8765.Fapi_UserDefinedFunctions.c

  • Hello,

    1. Bank7: if you use Bank7 as a emulated EEPROM, I strongly recommend you use TI FEE driver. FEE driver is generated through HALCoGen. It has the ability to erase and write individual bytes many times, and retain the data over long period even when the system is powered down.

    2. I checked your code. When you erase a sector, what is the argument of "num" used in Flash_EraseSector() call? Num is index number of the sector list rather than the sector number defined in datasheet.

    WaiteWang said:
    I try the same program for BANK1 of FLASH, it didn't show any error

    WaiteWang said:
    but it can't erase the BANK1 and it can't write data into the BANK1.

    You said it doesn't show any error, but you also said that you can not erase bank1 and write data to bank 1. Can you please give me more details?

  • hello 

    1. can you give me a demo for how to get the TI FEE driver ? I didn't find how to generated by HALCoGen.

    2.  you can see that I define a struct array according to the chip datasheet, it can get the sector number by the index num.  I find that it can works for EEPROM only two times.

    for example my test:

    I can erase the EEPROM in the first time , and write the data into it successfully.

    I can't erase the EEPROM in the second time , becuase I find the data in EEPROM is not change. but if I write new data into EEPROM, it can success.

    the third time, I can't erase the EEPROM and I can't write data into the EEPROM.

    3. I never can write data into the flash bank1 and erase the flash bank1.

  • Hello,

    Please follow the HALCoGen Help->Help Topics--example_FEE_.. to generate FEE driver:

  • Hello

    Can you give me a demo for operate the FLASH BANK0 and BANK1?

    I find that, if the simulator erase  the flash firstly, my program can erase the flash successfully and it can write data into it.

    if the simulator didn't operate the FLASH, my program can't erase and write data into the flash successsfully.

  • Hello,

    You can use the exampled used in CAN bootloader.

    https://git.ti.com/hercules_examples