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.

TMS570LS0432: Writing operation to a block in FEE

Part Number: TMS570LS0432
Other Parts Discussed in Thread: HALCOGEN, UNIFLASH,

Hello, TI Engineers

There are 2 functions for writing in FEE (TI_Fee_WriteAsync and TI_Fee_WriteSync). Which one could be used to write information to a block in FEE? I do not know how to select.

Xinyu

  • Hello Wang,

    There is slightly more information in the userguide on these two commands. It seems the Fee_WriteAsync requires to call the TI_Fee_MainFunction() periodically to complete the write while the Fee_WriteSync does not require these extra calls. This implies to me that once initiated, it stays until complete and other operations on the device will be on hold. The advantage of one over the other is that while an Async write is ongoing the device and perform other tasks as well where the sync takes up the primary CPU operating time to fully complete the task upon request (i.e., no background operation). The FEE userguide is included in the Halcogen install path under docs.
  • Hi,Davenport

    If I want to wipe data in FEE. I should use which function?TI_Fee_EraseImmediateBlock?this function would clear all in FEE?Or I could control what should be wiped?

    Thanks!

    Xinyu
  • Hello Xinyu,

    the TI_Fee_EraseImmediateBlock will erase the specified logical data block. It will not erase the entire FEE. Flash emulated EEPROM is not the same as regular EEPROM in that you specific blocks of data that contain your information within a sector of Flash. When a new data values is added, the old value is marked invalid and the new value is used when accessing. Once all the available space in a sector is taken, the sectors valid data is copied to a new block/sector and, once complete, the old block/sector is erased. This way there is always an old copy of data that can be restored if power is lost during operation and a write does not complete. More can be found by searching the web for Flash Emulated EEPROM to see what the principles of this type of use for flash are. The TI Fee driver provides the interfaces and behind the scenes mechanisms to support the emulation process.

    Also, this page has a pretty good detail description of Flash Emulated EEPROM and how it can be done. electronics.stackexchange.com/.../flash-eeprom-emulation
  • Hi, Davenport

    So if I want to erase the entire FEE, the old block/sector would be erased automatically?

    regards!

    Xinyu 

  • Hello Xinyu,

    Why would you want to erase the entire FEE? Is this to simply reset the FEE to a like new state or is it somehow part of your application to do this?

    If this is the case, it is probably best to simply use the F021 Flash API and erase the entire sector using a sector erase command rather than the FEE interface. Note that erasing the entire bank 7 sector(s) will erase even the initialized data that the FEE driver used to track write/erase cycles and good/invalid state of sectors/blocks etc. It will be like starting from scratch with a new memory space. You can also erase Bank7 via CCS or Uniflash erase commands on each programming of the device.
  • Hi, Davenport

    We hope we can erase the entire FEE once after no free blocks of FEE. Because we can not be sure that one block is enough for saving the information. So we want to erase the entire FEE.

    if your advice means to reset all entire FEE. I think it is good for us. If reset all entire FEE, what functions could be used? And is there any functions that could be used for erasing one bit data in FEE?

    And Could you watch the register of bank 7 in real-time? Could you tell me how to find bank 7 in the register list of CCS?

    Thanks!

    Regards!
    Xinyu
  • Hello Xinyu,

    the description of your use case seems a bit unusual to me and is not a typical Flash EEPROM Emulation method. Note that Bank 7 is divided into sectors with the number and size of those sectors dependent on which device you are using. Given you identified this as the TMS570LS0432, Bank 7 will have 2 sectors @ 16KB each. The FEE application software included in Halcogen, will not be able to effectively use the entire bank for your application since it relies on the ability to compress the data in one sector (removing invalidated values) by copying to the second sector. Once copied and valid data preserved, the old sector is deleted and new data written to the new sector. When the active sector fills again, the process repeats.

    If, you are simply wanting to store data in the data bank (bank 7), you can use the F021 Flash API directly. The F021 Flash API has commands to erase by sector or bank. The F021 API is also included with HalCoGen but can be downloaded individually too The user guide and link to directly download can be found at this link: www.ti.com/.../HERCULES-F021FLASHAPI
  • Hello, Davenport

    when I read the table about Flash Memory Banks and Sectors in TMS570LS0x32 16- and 32-Bit RISC Flash Microcontroller. I found there are 4 sectors for EEPROM. And one sector has 4 KB space. I thought there are something wrong. But I am not sure.

    Thanks and Regards!

    Xinyu
  • Hi Xinyu,

    You are correct. The TMS470LSx32 devices have 4x 4kB sectors in Bank 7 for a total of 16kB. This was a mistake in my post. Thank you for pointing that out to me.