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/F28M35H52C: Using Internal Flash as EEPROM

Part Number: F28M35H52C
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

I want to be able to save and retrieve a small amount of data in non-volatile memory - Flash I assume - internal to the CPU.  The data that would be stored would be stuff like serial number and calibration parameter values that would be updated once every blue moon so stuff like wear-leveling is unnecessary.

So far I haven't been able to find any examples of how to do this but I am pretty sure they must exist, can anyone point me to an example please?

Ted

  • Hi Ted,

    Sounds like you want to flash and looking for solutions to flash the device. Please have a look at

    processors.wiki.ti.com/.../FAQs
  • Sudharsanan,

    I think you misunderstand. I want to use a part of my flash memory (perhaps 1 sector) as non-volatile storage - like EEPROM - for a few infrequently updated variables that can be written, erased, and updated by the code I'm running on the device but still have these values retained during power cycles. I found this forum post e2e.ti.com/.../1941271 and that links to the sprab69.pdf document but it's not clear to me that this will work on the F28M35H52C device. If it will, then I'm looking for an example project.

    Thanks,

    Ted
  • Ted,

    Please check this thread: e2e.ti.com/.../2176846

    Sorry, we don't have an EEPROM driver/example for this device.
    You can use Flash API library (www.ti.com/.../spnu595) to develop one.
    Flash API has a wiki page as well: processors.wiki.ti.com/.../C2000_Flash_FAQ

    Thanks and regards,
    Vamsi
  • Vamsi,

    I've been looking at the Flash API document snpu595.pdf and can see that it would be pretty simple to write code to use those API commands to erase and program my data into flash but there's a couple of things that worry me.

    1. The documentation says... 

    The F021 Flash API library cannot be executed from the same bank as the active bank selected for the
    API commands to operate on. On single bank devices, the F021 Flash API must be executed from RAM.

    I think the F28M35H52C has 2 banks of flash, one for the M3 and one for the C28, is that right?

    2. If there's only one bank for the M3 and I want the M3 to program my "mini-EEPROM" area, is my only choice to execute the code from RAM or can I make the C28 program the M3 flash?  If I have to run code from RAM then how do I do this, is there documentation to explain how to make a specific part of my code run from RAM?

    Thanks,

    Ted

  • Ted,

    1) You are correct.  

    2) M3 Flash bank can not be programmed by executing the Flash API from C28x core.  M3 Flash API has to be executed from M3 RAM to program it's flash bank.  

    Please check the Flash API usage example provided in ControlSuite (ti\controlSUITE\device_support\f28m35x\vx\F28M35x_examples_Dual\flash_prog\m3).  In this example project, you will notice that the Flash API functions are executed from RAM.  Observe below from the example:

    (a) Linker command file used in this example, allocates F021_API_CortexM3_LE.lib to .TI.ramfunc section, which has a Flash load address and a RAM run address.  

    (b) Example's main function calls memcpy() to copy the contents of the above section from Flash to RAM before they get executed.

    Let me know if you have any questions.

    3) Also, I noticed that you are using an old SPNU595 document from ControlSuite.  Please use this http://www.ti.com/lit/pdf/spnu595 instead (mentioned in wiki referenced earlier).  I will file a ticket to reflect the latest guide in ControlSuite for this device.  

    Thanks and regards,
    Vamsi

  • Vamsi,

    Thanks I will try that out.

    Ted

  • Ted,

    I am closing this thread. You can open a new thread if you have more questions.

    Thanks and regards,
    Vamsi