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.

Building and using an library which itself uses RTSC

Dear All,

I've been trying to build a library which itself uses RTSC and failing miserably.

This is with CCS 5.0.3 and MCSDK 2.0.1.12.

I created a new CCS project as a "Static Library" (rather than as an "Executable").

The library uses the RTSC (and/or SYS/BIOS) Assert, Log, LoggerSys, Semaphore, SysStd and System components. So, I had to create an RTSC config file - at which point CCS converts the CCS project into an RTSC one.

All goes well in the compiling and linking of the library. And all goes well if I link the library into a program that does NOT use any further RTSC and/or SYS/BIOS components.

The problem starts when I try and link the library against a program that DOES use RTSC and/or SYS/BIOS components - say BIOS, HeapBufMP, MessageQ, etc.

The linker fails to resolve any RTSC symbols from the program. It can resolve all the RTSC symbols from the static library.

Looking at the program's RTSC project settings, I have specified the name of the library in the upper-box in the "C6000 Linker -> File Search Path" and the name of the library's directory in the lower-box.

If I remove the library's directory (say "${MYLIB_ROOT}/Debug") from the lower-box and make the upper-box refer to the explicit library filename (say "${MYLIB_ROOT}/Debug/foo.lib"), everything works fine.

It's as if the linker is picking up the linker.cmd (or whatever) for the program from "${MYLIB_ROOT}/Debug/configPkg" rather than from the Debug/configPkg for the program's own directory.

What stupid thing am I doing ?

Is there a document somewhere detailing how to build and install libraries that use RTSC and/or SYS/BIOS ?

Is what I am trying to do even possible ? Or sensible ?

Can this be done from within an RTSC project, or should I resort to using explicit out-of-CCS makefiles and hand-built linker files ?

If I build the static library and then install it somewhere where there are only libs in that directory (and no Debug or Release sub-directories), will that work ? How do you do this from within the RTSC project settings (specify an install directory, that is) ?

Thanks for any hints,

Graham

 

  • Graham,
    the library you are building must be a part of a RTSC package, if you are planning to link with that library in another RTSC project. I don't think you can build a RTSC package in CCS. I think I saw users managing to build dependent RTSC projects in CCS, where a library from one project is used in another RTSC project, but it looked hard to get it right. I can see that you are adding a config script to your library project and you even run a link step there, which is never needed when you are building a static library.

    There is the thread where I was helping someone with a similar problem, but I am not sure if you can see it because it's on an internal message board: https://e2e.ti.com/support/embedded/int-embedded_software/f/123/p/119518/430377.aspx.
    Anyway, the solution was to completely remove the directory Debug/configPkg after you built your library.

    However, the straightforward way is to run XDCtools on the command line, and create all necessary files for a RTSC package. It takes some time to learn to work outside of CCS, but if you will be creating more RTSC packages in the future, it could be worth the effort. Take a look at lessons 4, 5 and 6 from RTSC Packaging Primer for a starter. They cover a case where you have a source code that is delivered as a package but it's not a part of any RTSC module. Once you have built a RTSC package that contains a library, you use that library in another RTSC project by loading the package with the library.

     

  • Sasha,

    Thanks for the info. You confirm my suspicions (i.e. do stuff outside CCS). Being a linux developer, I've always used file-based build systems and have a natural suspicion of "do it all" IDE solutions. However, I had big hopes for an Eclipse+CSS state-of-the-art IDE. Seems that it is nearly there but not quite.

    I'll put aside a Friday afternoon to have a play through those lessons.

    Regards,

    Graham.