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.

How to write and read back a data from the internal flash memory?

Other Parts Discussed in Thread: TMS320F28027, CONTROLSUITE

Hi!

We are developing a data logger using TMS320F28027. We need to copy the Energy Per day into the internal flash memory and again want to refer after the Control Supply Recovery.

can anybody guide me for writing the last energy reading into the flash and use it again for calculations of cumulative power calculations?

Awaiting for the reply.

Thanks in advance!

Regards,

Richa

  • Richa,

    You can use the flash APIs to write to the flash. These can be found in ControlSuite:

    C:\TI\controlSUITE\libs\utilities\flash_api\2802x\v201a

    The minimum erase quantity in the flash is an entire sector. If you are only writing once a day, you could erase the entire sector each day and not exceed the flash write/erase cycles over the life of your product (F2802x flash is spec'd for a minimum of 20K w/e cycles, so if you erased once per day that would be 55 years). If you need to write more than that, you can consider filling up the entire sector with your data before you erase it. On power-up, you could search through the sector for the first erased word you find (e.g., 0xFFFF), maybe several in a row to make sure the 0xFFFF is not naturally occurring in your data. Then, back up your pointer to the last data entry you made in the sector. See the picture?

    Regards,
    David