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.

  • Resolved

TMS570LS1114: How to save my important data into the divided ROM space

Part Number: TMS570LS1114

Dear Experts:

How to save my important data into the divided ROM space  .Rather than copying my code, some variable data goes into my divided ROM area

1.I want to read and write FLASH , based on the F021 FLASH API, and I have posted my problems in the forums. But when I solve this problems, some problems appeared.

2.My purpose is dividing a small field which address is 0x000fe000 and length is0x00001000 to restore vital data ,instead of only copy flash code into the SRAM to run. For example:

uint32_t parameter=18;

3.I want to restore the address of parameter into the CAL_ROM in order to modify the valve of parameter. Lots of data like it will be put in the CAL_ROM instead of RAM.

4.I didn’t know what to do after I declare the function copyAPI2RAM().In fact , copyAPI2RAM() was written by assembly language, and I have replaced it in C code due to my poor levels to understand the assembly code.

  • In reply to Qiu chi:

  • In reply to Qiu chi:

  • In reply to Qiu chi:

  • In reply to Qiu chi:

  • In reply to Qiu chi:

    Hello Chi Qiu,

    So for my understanding on the problem statement, you want to allocate 4K (length of 0x1000)of space somewhere within flash for storage of calibration data. The location you have mentioned is a start address of 0x000fe000 and I am assuming the location that you identified is a matter of just placing it somewhere out of the way with a little room to grow if needed.

    Have you considered using Bank 7 for this purpose? Or do plan to use Bank7 for emulated EEPROM and storage of more dynamic data? Note that if you use bank 7 you can program it while executing from Bank0 without copying the API into RAM or you could use the FEE drivers included with Halcogen and manage it like an emulated EEPROM for future updates. If you choose the FEE driver option, there will be some overhead so you will need to allocate slightly more than the 4K area for your data, but if you use it strictly as additional data only flash for thr calibration information, you could skip the FEE driver and use the Flash API directly for more efficient use of the space.

    If you choose to keep the calibration data in Bank0 you must continue to copy the API and supporting code into RAM so that you can program the information into Bank0. This is due to the inability to execute and program from the same bank at the same time. Note that this has nothing to do with where the data will be stored in the end other than it is in the same bank as execution.

    Thanks and Regards,

    Chuck Davenport

  • In reply to Chuck Davenport:

    Dear Chuck Davenport:
    Thank you very much for your enthusiastic apply.
    As you understand it. I have to restore my calibration information into the CAL_ROM due to EEPROM is used in other function and the TMS570LS1114 only one BANK0.So I have no choice but to use the flash API.I know that I must copy the code from flash to RAM at first, besides, I need to load this data into the 4K room(CAL_ROM,original address is 0x000fe000,length 0x00001000).But I don’t know how to load this original calibration information, whether I ought to write a function to load this important data or I directly write data in the main.c using the FAPI function write this information account for having copy the flash code .
    In fact, I know I must copy this code from flash to ram to run ,but next to apply this operate FAPI function I have any trouble. I try to root the code from QJ Wang, but I am not familiar with the Assembly language and build my project appearing many problems.

    Thanks and Regards,
    Qiuchi
  • In reply to Qiu chi:

    Whether I could operate like this:
    #pragma CODE_SECTIONS (main,".system");//Impression code in the ram
  • In reply to Qiu chi:

    Hello Qiuchi,

    There are many posts on this topic. Here are a few for your reference:
    e2e.ti.com/.../541952
    e2e.ti.com/.../62954
    e2e.ti.com/.../254376

    Please have a look at these and see if these address your questions.

    Thanks and Regards,

    Chuck Davenport

  • In reply to Chuck Davenport:

    Hello Chuck Davenport:

            Now ,by second way,I have successed to copy the code from flash to ram.But  I could't write data to my CAL_ROM

    Thanks and Regards,

            Qiuchi

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.