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.

28069 Piccolo table initialisation in flash

Dear Expert,

I am using the Piccolo 28069 controlstick in CCS6.1. with C2000 compiler version 6.4.6.

I started to modify the ContinuousADC example with the linker command file that programs the

code into the onboard flash (and then moves program code to RAM at execution time). This works as expected.

I also have a large constant table that I need to store in the Flash. The compiler guide tells that this can

be achieved by using the const keyword for the table. However, when I use it for my table, and check

the map file, the table still remains in RAM. I also added a .const section to point to the FLash area in

the linker command file, but no success. What could be the problem?

Second question: because the table is very large, it is not practical to manually write the table initialisation data

in the source code. What is the easiest way to do it? Is it by cut and paste the data from a separate file to the

linked file after the mapped address (by taking care that the optimizer does not remove the table).

Pasting the data to the source code could be done, but then the listing becomes very large, perhaps there is some kind of

"nolist" code?

Best regards,

Jouko

  • Jouko,

    Try looking at appnote SPRA958:

    http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=spra958l&docCategoryId=1&familyId=1414

    Jouko Viitanen said:

    Second question: because the table is very large, it is not practical to manually write the table initialisation data

    in the source code. What is the easiest way to do it? Is it by cut and paste the data from a separate file to the

    linked file after the mapped address (by taking care that the optimizer does not remove the table).

    Pasting the data to the source code could be done, but then the listing becomes very large, perhaps there is some kind of

    "nolist" code?

    It depends on what format your data file is in.  If it is comma delimited, I've done this type of thing before:

    const int x[] = {
                             #include "MyData.txt"
                           };

    Not sure what the issue is with the listing file.  You're talking about a .lst file?  Let it be large.  Does it matter?  The data has to go into the .asm file.  No way around that one.

    Regards,

    David

     

     

  • Thanks David, now it works (had a wrong version of the RTS library). Also the way to initialize the constant table that you proposed is very good, saves unnecessary text at the source listing!