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.

TMS320F28022: Upgraded from CCSv6 to v8, rts2800.ml doubled in size

Part Number: TMS320F28022

Win7 32bit, CCS v8.2.0, F28022.

I just upgraded from CCS v6 to CCS v8, and find the rts2800 library no longer fits in the FLASH area I had previously allocated.

I am working on a quite large project and I'd like to trim that back down.

I guess I can point the CCS v8 to the old CCS v6 lib, but I am going to assume there may be some bug fixes and I hesitate to do that.

How would I "micro manipulate" the library to... 1) include only the library functions I need, and 2) compare the differences from the old to the new?

I seem to remember something about the compiler only including the library functions I use. If true, the functions have gotten a lot bigger. How can I verify this?

The old version is in C:\ti\ccsv6\tools\compiler\ti-cgt-c2000_6.4.6\lib

The new version is in C:\ti\ccsv8\tools\compiler\ti-cgt-c2000_18.1.3.LTS\lib

I see a "src" folder under each. I assume this is the source code for the respective libraries.

How do I go about rebuilding the libraries?

Thanks, Mark.

  • Cool,

    Try to see if you can modify the linker command file to allocate more memory.

    Regards,
    Ozino
  • Ozino:

    Thanks for the reply, I have changed the memory allocation and it does work, but I am beginning to run out of FLASH space. The question was, How do I get a smaller RTL.

    Thanks, Mark.

  • Mark,

    There is a small memory model available, rts2800.lib, but it is not recommended to use. Here is a wiki page with more details: processors.wiki.ti.com/.../C28x_Code_Generation_Tips_and_Tricks

    Regards,
    Ozino
  • Thank you Ozino for that link. I will look into the small memory model.

    I believe I was using the large memory model in CCS6. Now in CCS8 that has grown a lot.

    In a pinch, I may go back to CCS6 version of the RTS.

    To be true, I was working on other aspects of my program and never really tested the older (CCS6) version. Maybe it had bugs.

    It seems a 2x size increase is a bit excessive to clean up some bugs.

    It may also be the compiler (or is it the linker) is including the entire RTS when only portions are needed and the older version linked more efficiently.

    Right now, there are other priorities so this will have to go on the back burner for a time.

    Thanks, Mark.

  • Mark,

    I'm mistaken in my previous reply. In the small model everything is accessed with 16-bit pointers.  Since our data resides in memory much higher than this C2000 no longer supports small model. 

    I'm going to forward this post to our compiler team. I believe there is a way to get the linker to not include any functions that are not actually used. I'm not sure of the method. In the meantime, can you look at the memory map to see what functions are being included. 

    Thanks,

    Ozino

  • Cool Javelin said:
    How would I "micro manipulate" the library to... 1) include only the library functions I need

    The linker already does that.

    Cool Javelin said:
    2) compare the differences from the old to the new?

    The source code of the RTS library is different between compiler versions 6.4.6 and 18.1.3.LTS. The following description ignores some of the finer detail, but it is correct on the main points.  The RTS source divides into two pieces.  One piece is the core functions required by the C standard.  This includes functions like memcpy, strcpy, malloc, and so on.  The other piece is the functions required by C++.  This would be header files like <string>, <vector>, and so on.  The core functions for C are mostly the same between the two versions.  The functions required by C++ are quite different.  Version 6.4.6 uses an implementation from Dinkumware.  Version 18.1.3.LTS uses an open source implementation called the STL (Standard Template Library).  While I cannot specifically say how this affects your situation, it seems likely this difference is part of the cause for the increase in memory used by the RTS.

    Cool Javelin said:
    I seem to remember something about the compiler only including the library functions I use. If true, the functions have gotten a lot bigger.

    That is probably part of the reason.  Another likely reason ... Because of the organization of the RTS source code, you are linking in functions that are not needed, but it is not easy to see that in an automated way.  I can't think of a quick way to explain this right now.  I'd rather find an example in your program, and then explain that.

    Cool Javelin said:
    How can I verify this?

    We don't have a well defined way to do it.  Instead, please submit a few files, and then I'll analyze them.  I'd appreciate if you would submit, for the build with each compiler version, the call graph and the linker map file.  Put them in a zip file, then attach that zip file to your next post.

    To build the call graph, please use the utility call_graph from the cg_xml package.  Please use the option --func_info, so the call graph is annotated with the file name and size for each function.

    Cool Javelin said:
    I see a "src" folder under each. I assume this is the source code for the respective libraries.

    Correct.

    Cool Javelin said:
    How do I go about rebuilding the libraries?

    I'm not sure how that would be helpful.  But, you can rebuild the libraries with the utility mklib.

    Thanks and regards,

    -George

  • as Tywin Lannister: says, "I'm sure I knew that when I was a boy."

    Thanks, Ozino for reminding me. and saving be a bunch of headaches.

  • Thanks George, tips like these are helpful, I read them in minute detail.

    I am creating all in C, not C++, but there may be some differences.

    Unfortunately, I have stepped back to V6 from V8.

    I installed V8 to try to fix the "Updating View Contributions"  but it has not been fixed in the new version yet. (see  e2e.ti.com/.../748642 ).

    I found some other bugs in V8, like in the Build Step, under pre-build, if I had a very long command, sometimes it would stop listing the command in the window, but the command would get executed just the same. There were some other minor things I can't put my finger on right now.

    I started spending too much time battling the computer and not enough actually doing work.

    I do want to go back to V8, there are some things I like better about it, but I will have to wait for a newer version.

    Sigh, So, I guess this issue will have to be put on hold for a while. I do appreciate your insight, and there are some good tips I will review like "call graph" you mention, I think I like the idea of knowing more about how my code is getting created.

    Thanks, Mark.