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.

Code Composer : Including INFO memory when creating flash image TI-TXT .txt file

Other Parts Discussed in Thread: MSP430F2012

Good day,

I'm using Code Composer (V5) and when I create flash image TI-TXT .txt file it only includes the MAIN memory, and does not include the INFO memory as well.

I can't seem to find where or how  to set the memory locations that would be included.

(I have tried using  projects with MSP430F2012 and MSPG2955).

Thanks in advance.

Michael

  • Why do you expect INFO memory to be included in your binary? How did you declare this in your program?
  • Hello Michael

    info memory is primarly used to store information at runtime and contains calibration data from TI. As long you don't declare something to be located explicitly there at compile-time, TI-txt-file won't contain any INFO-contents.

    cheers, Matthias

  • The main code makes use of INFO memory to store data and also read data from INFO.

    I have the following;

    #pragma DATA_SECTION(myINFO,".infoD")
    unsigned int myINFO[32];
    unsigned int Dummy;

    void main( void )
    {
    Dummy=myINFO[0];
    .....

    "myINFO" only gets data written to it after the system is running.

    I use the data in INFO (that was previously obtained) when programming new systems, hence the requirement for the data in the INFO section to included in the TI_txt,txt file.

    If I look at the MAP file, then infoD is marked as used (64bytes), but not included in the image txt file.

    I think what is happening is that since INFOD is "unwritten" (0xFF's) CCS knows that there is no need to include it.

    Is there a way to achieve this in CCS?
    Or will have use something like "MSP439Flasher".

    Thanks.
  • Hi Matthias,

    Thanks, but see my reply to Leo.
  • Matthias Siegenthaler said:
    info memory is primarly used to store information at runtime

    INFO Flash segments can be used for Code, Constant Data or to store Data at Run-time. Adding INFO memory to Code-segment can be very useful for these tiny MCU’s.

    Matthias Siegenthaler said:
    and contains calibration data from TI

    Only INFO-A can contain TI-info data, but not on all devices, see specific Data Sheet.

  • If ‘myINFO’ is not used in your program you should add the pragma ‘retain’ to be sure it will not be optimized away.

    If you want to include it in your binary and initialized as ‘0’ add the keyword ‘const’ to your variable declaration.
  • Hi Leo for forcing me to think about this in more detail.

    My original method can never work.

    The solution would involve more manual intervention.

    From the "master unit", already programmed and has relevant data in INFO section, debug and "Save Memory", select INFO memory range.
    Save as TI-TXT.txt format. Copy and append this into the "MAIN" txt file.
    Was hoping to avoid this manual method.

    Thank you.
  • Sorry but I can’t exactly follow what you mean here.
    What do you want to accomplishing?
  • Hi Leo,
    My Requirements are:

    What I have is an Industrial Controller using an MSP430, during the system installation there are many parameters that have to be entered to get the system working properly. These parameters are stored in INFO flash.

    The parameters in INFO flash for each Industrial Controller will be similar but not the same.

    In the factory I have a "Master" test system which is well optimised, the data for the optimisation is stored in INFO flash.
    Now during production of the Industrial Controller at some stage I program the MSP430 with the MAIN code, and of course INFO will be blank. (0xFF's)
    This means that the Industrial Controller has no setup data loaded into it. This can be done in the field but is time consuming.
    So I want to take (copy) the INFO data from my Master and load it into each new system at the same time that I program the MAIN code.

    But I have since realised that this cant be done automatically from the files produced by CCS.

    So I will have to do it in steps;

    Using CCS, debug the Master, halt and save the Masters INFO memory as a TI txt file. Now I have a copy in TI txt format of INFO flash that I need.

    Then append this "txt" file to the TI txt file that contains my MAIN code.
    Use this new TI txt file to program each of the new production Industrial Controllers.

    Hope this makes sense.

    Thank you.
    Michael
  • Ok, now I think I understand.

    But when you have the ‘default’ data for INFO you can place this in your  ‘Main’ code with: “unsigned int myINFO = {1, 2, 3, … 9};” you could also place this in a separate C-source file, and don’t have to cut/paste the output file.

  • Hi Leo.

    Yes, using an external C file is a good idea.
    I think I will be using that method, then it eliminates the "human factor".

    Thanks very much !

    Michael
  • Additional you can create two ‘Build Configurations’, one with the defaults to initialize (setup) and a second without the default to create a software update binary. In the last you can exclude the source file and/or use a ‘Predefined Symbol’ which you can use in your software to in/ex-clude code lines.

    Worse is that you can’t store in the ‘Build Configuration’ the option to erase Main or Info memory, you have to do this –and not to forget- all the time manually. Name the build configuration with this instruction.
  • That is an interesting way to do it as well.

    Thanks
  • "when I create flash image TI-TXT .txt file it only includes the MAIN memory, and does not include the INFO memory"

    In the code snippet you posted, you declared myInfo to be in info memory. However, you do not initialize it. As a result, the linker will generate references to this location (if used in the program), but it does not generate any binary output for it.
    Since you moved it from the uninitialized data segment, it doesn't get initialized to zero (at runtime, which wouldn't work on flash memory anyway), since you didn't declare it constant and assign it any init value, it has no init value that should be stored in the TI-txt file.
    You just declared that (and where) it is. Not what it contains. And only content is stored in the TI-txt file and written to flash.

    If you want it to get initialized at flashing time with a certain init value, you must declare it constant and explicitly assign the value, even if it is zero.
    You can even include external data as init value:
    #pragma DATA_SECTION(myINFO, ".infoD")
    const unsigned int myInfo[32] = {
    #include "data.csv"
    };

    data.csv contains the init values in CSV format. I use this to import calculated data columns from Excel into my projects. But any other source is possible too. Only ensure that the last line does not end with a comma.

    However, if you already have the data in TI-txt format (extracted form the calibrated target), you can compiler the code as you did (without initalization values) and then concat the compiler output and the extracted file before flashing.
    However, ensure the program you use for flashing is configured to erase main and info memory, or you'll get a flash write error.

**Attention** This is a public forum