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.

Link Error with CLK_gethtime().

Other Parts Discussed in Thread: CCSTUDIO, SYSBIOS

Hi,

I am migrating DSP/BIOS 5  project to SYS/BIOS 6 and I encountered this error (below) but i don't know which library to link with at this time. To my understanding the CLK_*() module APIs are supported in SYS/BIOS 6, so I should link it with SYS/BIOS 6 library. Can some one point to me which library file i should link with?

Thanks,

Zhao

-l"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\lib\whole_program_debug\ti.sysbios.a674" -l"C:\CCStudio_v3.2\c64plus\dsplib_v210\dsplib64plus.lib" -l"libc.a"

<Linking>

 

undefined first referenced

symbol in file

--------- ----------------

_CLK_countspms ./Gsm_src/GsmMain.obj

_CLK_gethtime ./Gsm_src/GsmMain.obj

 

error: unresolved symbols remain

error: errors encountered during linking; "GSM.out" not built

 

  • Zhao,

    Which version of SYS/BIOS are you upgrading to? Are you following the instructions of the BIOS legacy app note? (e.g. C:\Program Files\Texas Instruments\bios_6_21_03_21\docs\Bios_Legacy_App_Note.pdf)?

    Zhao Li said:
    -l"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\lib\whole_program_debug\ti.sysbios.a674" -l"C:\CCStudio_v3.2\c64plus\dsplib_v210\dsplib64plus.lib"

    I'm curious how these libraries are coming into your project.  Did you manually add "-l" for these libs in your project in order to link them? (You should not need to link in any BIOS libraries manually)

    Can you please attach your *.cfg file?

    Steve

  • Hi Steve,

    I am upgrading to SYS/BIOS 6.31.04.27. I have read the BIOS legacy app note and i think i understand that some of the APIs dropped but it won't affect CLK_*().

    I should not link with any BIOS libraries. I did not find any such BIOS 5 libraries in my CCS V3.2 project. But why the SYS/BIOS 6 project complains about CLK_*() modules?

    Please find attached the cfg file. Please let me know what i did wrong with the cfg.

    Thanks,

    Zhao

    2308.Gsm.cfg.txt

  • Hi Zhao,

    I'm just curious, where did you get this *.cfg file from? It's just that it looks very similar to one of the existing SYS/BIOS 6 examples.

    Typically I would expect that your older, BIOS 5.x application had a *.tcf file, and you would have used the conversion tool to convert it to a SYS/BIOS 6 *.cfg file (as described in the app note).  Did you do that?

    If not, please follow the steps in the app note to convert your original BIOS 5 application's configuration (*.tcf) file to a SYS/BIOS 6 configuration (*.cfg) file.

    Thanks,

    Steve

  • Hi Steve,

    The reason i did not convert .tcf to .cfg is that i don't need the Rxtask(), Txtask() tasks and SYSLink components in my DSP/BIOS 5 application. All I wanted for the SYS/BIOS 6 project is the algorithm itself and the input data file which i can load thru the "load memory". But i do want to use the CLK_*() modules to measure the execution time of my algorithm.

    So I used a modified  "Hello World" .cfg file for the new SYS/BIOS 6 project. Is there any way around to make the CLK_*() functions work for my new project?

    BTW, does System_printf() support  "%f" format for printing floating point numbers to the console? I tried it but it prints "f" instead of the floating point number to the console.

    Thanks,

    Zhao

  • Zhao,

    Ok, that makes sense.  The cfg file requires some special code for legacy support that you would have seen by going through the conversion steps.  Can you try adding the following to the *top* of your *.cfg file?

    xdc.loadPackage(‘ti.bios.tconf’)

    Then try to build again?

    System_printf does not support %f by default in order to reduce footprint from code size.  You can enable it by adding the following to the *.cfg file:

    System.extendedFormats = "%$F"

    For more info, please refer to the XDC tools documentation (start menu -> Texas Instruments -> XDCtools x.y.z -> XDCtools documentation.  Then go to "API reference (cdoc) -> xdc -> runtime -> System")

    Steve

  • Hi Steve,

    Thanks for your reply. I tried to put the following at the top of my .cfg file. But the problem remained(below). Do you have any other suggestions or I did something wrong?

    xdc.loadPackage('ti.bios.tconf');

    <Linking>

     

    undefined first referenced

    symbol in file

    --------- ----------------

    _CLK_countspms ./Gsm_src/GsmMain.obj

    _CLK_gethtime ./Gsm_src/GsmMain.obj

     

    error: unresolved symbols remain

    error: errors encountered during linking; "GSM.out" not built

     

    >> Compilation failure

    gmake: *** [GSM.out] Error 1

    gmake: Target `all' not remade because of errors.

     

    **** Build Finished ****

     

    Regards,

    Zhao

  • Zhao --

    CLK_gethtime() is an inline function that is defined in the clk.h file.

    Are you including <clk.h> in your .c file(s) that are calling these APIs?

    Any file that uses these APIs needs to have the following line.  In general, you should have #include <mod.h> for every module that you use.

     

    #include <clk.h>

     

    Thanks,

    -Karl-

  • Hi Karl,

    Thanks for your reply. I did have clk.h included as below. Let me know if this is ok.

    Regards,

    Zhao

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    #include

     

     

    #include

     

     

    #include

     

     

    #include

     

     

    #include

     

     

    #include

     

     

     

    #include

     

     

    #include

     

     

    "DspDataDef.h"
    "DspMsgDef.h"
    <clk.h>
    <std.h>
    <ti/sysbios/knl/Clock.h>
    <ti/sysbios/BIOS.h>
    <xdc/runtime/System.h>
    <xdc/std.h>

     

  • Hi Karl,

    A simplified main program is attached to show the include files. My last reply had format problem.

    Regards,

    Zhao

    5148.GsmMain.c.txt

     

  • Zhao,

    I think the formatting of the code you pasted in the previous post got screwed up.  Can you try re-posting?  Or maybe attach a .txt file that has the code you were trying to post?

    Thanks,

    Steve

  • Hi Steve,

    I just did. And the .cfg file is again attached here for your reference.

    Regards,

    Zhao

    1768.Gsm.cfg.txt

     

  • What is the include path (-I) for your compile when you compile this .c file?   Is it possible that  you are pointing to the BIOS5.x include directory?


    You should point to <bios6installdir>/packages/ti/bios/include.      Add a #warn statement or syntax error to that clk.h file to make sure you are picking up the right one.

    -Karl-

  • Hi Karl,

    I think you are right. I was putting the std.h and clk.h from somewhere else (non SYS/BIOS 6) in my local include directroy and the linker would not recognize the CLK modules.

    I made a simplified GSM project with the include path pointing to the SYS/BIOS 6 include directory and now i can link CLK modules into the simplified project without any problem.

    BUT, when i tried to change my include path for the full GSM project, the cl6x would not pick up the include path of the SYS/BIOS 6 for some reason, it only picks up the other two includes.

    So here is what i have for include path:

    "C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\bios\include"
    "${CG_TOOL_ROOT}/include"
    "${workspace_loc:/${ProjName}/Gsm_inc}"

    And here is what the cl6x output is: it only picks up last two paths,

    C:\CCStudio_v5.1\ccsv5\utils\gmake\gmake -k all

    'Building file: ../Gsm_src/GsmMain.c'

    'Invoking: C6000 Compiler'

    "C:/CCStudio_v5.1/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6740 -g --include_path="C:/CCStudio_v5.1/ccsv5/tools/compiler/c6000/include" --include_path="C:\tmp_C6A8168\GSM\Gsm_inc" --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Gsm_src/GsmMain.pp" --obj_directory="Gsm_src" --cmd_file="./configPkg/compiler.opt" "../Gsm_src/GsmMain.c"

    'Finished building: ../Gsm_src/GsmMain.c'

     

    I had to physically copy the std.h and clk.h from the SYS/BIOS 6 include directory to my local include directory in order to make it work. Have you ever encountered this problem before? This is strange because my simplified project can pick up the include path while the full project cannot.

    Thanks,

    Zhao

     

  • Hi Karl and Steve,

    The following printf format config does not work, any reasons?

    System.extendedFormats = "%$F";

     

    Here is my System_printf() and outputs:

    System_printf(

     

    "GSM BCCH done. BER=%5.2f percent. \n", 0.78125*result->bcch_ber

    );

     

    GSM BCCH done. BER= f percent.

     

    Thanks,

    Zhao

     

  • Zhao,

    Sorry, I told you the incorrect code for your config file.  It should have been this:

    System.extendedFormats = "%f";

    Please give that a try.

    Steve

  • Hi Steve,

    I used %5.2f in the System_printf() like this System_printf("GSM BCCH done. BER=%5.2f percent. \n", 0.78125*result->bcch_ber);

    and the result is this BER=00.0000 percent. Is this right? It looks to me as if i used %7.4f in the Sytem_printf format?

    Also how do I know what clock speed I am running the C674x DSP at? In my .cfg properties for ti.sysbios.BIOS the cpuFreq hi is 0 and lo is 800000000, does this mean the DSP cpu is configured to run at 800MHz? I tried to change the lo to 1500000000 since i want to run the DSP cpu at max of C6A8168 of 1.5GHz, but the .cfg does not allow me to change it, it reverts back to 800MHz every time i changed it. Can you please tell me how to configure the DSP cpu speed to 1.5GHz?

    Thanks,

    Zhao

  • Zhao,

    The clock speed is set in the platform file.  If you want to change it, you should use the RTSC platform wizard to do that.  Please see here:

    http://rtsc.eclipse.org/docs-tip/Demo_of_the_RTSC_Platform_Wizard_in_CCSv4

    Are you still having issues with printing floating point values?

    Steve

  • Hi Steve,

    Thanks for the reply. I am still having issue with the System_printf() format for floating-point. It prints in %7.4f format when i give format of %5.2f.

    I have looked at your link and am able to configure the cpu speed now. Thanks. On a related issue, how do i edit/view(Tools->RTSC Tools->Platform->Edit/View) the default platform package for evmC6A8168? I changed the Platform Package Repository directory to where the package is located (C:\CCStudio_v5.1\ccsv5\xdctools_3_20_08_88\packages\ti\platforms\evmC6A8168), but the dialog window would not show the package. The Package Name field is empty when click on it. Is there a way to check/view the default evmC6A8168 package?

    Zhao

     

  • Zhao,

    I am seeing the following on DM648 (same as you are):

        System_printf("%5.2f\n", 0.78125 * 0);
        System_printf("%7.2f\n", 0.78125 * 0);

    outputs:

    00.0000
    00.0000

    I then compared this to a gcc compiled program in Linux:

        printf("%5.2f\n", 0.78125 * 0);
        printf("%7.2f\n", 0.78125 * 0);

    outputs:

    2501 % a.out
     0.00
       0.00
    2502 %

    (first print pre-pends the result with 1 space for a total of 5 characters.  second print pre-pends 3 spaces for a total of 7 characters ...)

    I'll ask an XDCtools expert more on this difference.

    Steve

  • It looks like a bug in System_printf. I'll do some more testing and I'll post here the link to a bug when I file it.

  • Hi Steve,

    Thanks for your reply. What about my second question regarding the default evmC6A8168 package? I want to check the clock rate used in the default evmC6A8168 board package. Is there a way to view the default memory allocation and cpu clock rate?

    Regards,

    Zhao

  • Zhao,

    The trick is that you need to specify the path to your XDCtools repository, not the path to the evmC6A8168 package.  For example, I entered this on my machine:

    C:\Program Files\Texas Instruments\xdctools_3_22_03_36_eng\packages

    This should cause the drop down lists to populate and you should see your hardware in that list.

    Steve