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 application without runtime library support on CCS6:no memory is allocated to functions



Hi,

I am trying to build application without runtime library support. I have disabled the runtime library support feature in CCS6 using --disable_auto_rts option.

I am able to build successfully but no memory is allocated to any of the functions. 

If I include runtime library then memory is getting allocated to functions.

Please let me know how I can build application without using runtime library.

Thanks,

Abhi

  • Abhimanyu Kumar said:
    I am able to build successfully but no memory is allocated to any of the functions. 

    I am not sure what you mean here.  I suggest you attach the linker map file from this build to your next post.

    Thanks and regards,

    -George

  • Please find attachment of linker file, map file and hex file3157.Files.zip.

    Thanks and regards,

    Abhimanyu

  • Thank you.  But I still cannot explain what happened.  Please attach your project to your next post.  In CCS, right-click on the project name and choose Export.  In the next dialog expand the General selection and choose Archive File.  Click Next.  I think creating a .zip file is straightforward from that point.

    If, for some reason, you are unable to send in your project, then please show the contents of the Console view (not the Problems view) after a complete build from scratch.  Create the text file with the icon in the upper right bar of the Console view titled Copy Build Log.

    Thanks and regards,

    -George

  • Please find attachment of build log.

    5850.BUILD_LOG.TXT

    Could you please provide a sample project which does not include RTS and any initialization code(c_init). 

    My requirement is that a single chip will have two application.

    One application will be having all initialization call,RTS library and other functionality, this will be called after every reset.

    Second application will have user defined functions which will be referenced by first application.In second library i don't need any RTS support as well as initialization code.

    So could you please provide any sample project which does not uses RTS and initialization code and getting build. 

    I am using ARM compiler 5.2.6 of CCS6.

    Thanks,

    Abhi

  • Abhimanyu Kumar said:
    So could you please provide any sample project which does not uses RTS and initialization code and getting build. 

    It makes more sense for this second project to be a library project.  At a conceptual level, a library is a collection of related object files.  Other projects can call functions or use data defined by the library.  This post describes how to create a library project in CCS.  This wiki article describes how to make the association between the main project and the library project.

    Thanks and regards,

    -George

  • Hi,

    Thanks for your suggestion, Yes I can create library static or RTS, but our requirement is to have to separate output(*.hex/*.out)  files, library creation won't be a helpful in our case. So, our requirement is project configuration where I can build without runtime library/Intialization code. Please let me know how we can build application without RTS and initialization code.

    I tried using batch files but this also yield same result i.e. output file with no memory allocated to functions.

    Thanks & Regards,

    Abhimanyu Kumar

  • I am unable to reproduce a build where the .text section (and many others) is empty.  Please send in the project where this occurs.  This is the only way I know to figure out what is happening.

    Thanks and regards,

    -George

  • I won't be able to share the project. It would be helpful if you let me know how i can remove below symbols from getting build.
    ffffffff __binit__
    ffffffff __c_args__
    UNDEFED _c_int00
    ffffffff binit

    Above symbols are coming automatically and present in MAP file. We don't need these in our build.

    Thanks & Regards,
    Abhimanyu Kumar
  • Hello Abhimanyu,

    It looks like you want to compile the files without linking.  However,  the make files are created to generate a separate out file for each c/cpp file. Therefore, if you have more than one c/cpp file, you will get more than one out file.

    Stephen

  • Hello Abhimanyu,

    I believe this is more of a CCS issue than a compiler issue. I am curious about this issue to, because there have been times I would have liked to change the build steps.

    I think you will have to create a C++ project instead of a CCS project. You might be able to use the make files generated by CCS in the CCS project as a basis for the C++ project.

    Stephen
  • Hello Abhimanyu,

    Please see e2e.ti.com/.../1804280

    Stephen
  • In addition to the last post, you will need to set Runtime support library to "None".
  • I have already selected that option.

    Please find attachment of a sample project.driverlib.zip

    In this project init file and runtime is not included, one function pointer table 'ROM_APITable' is defined due to which decompress function is getting called and as runtime library is not present so getting link time error.

    I don't  need this decompress function and function pointer table is must in my actual project. let me know how to build this project.

    Thanks & Regards

    Abhimanyu

  • I have attached a sample project in my previous project.
    Please let me know how to build it.
  • I don't have access to CCS today.

    You need to create an entry point that has the name _c_int00.  The map file (.map) shows that it is currently undefined.

    Also, the the .ccsproject file shows (see below) that the rts is "libc.a".  I would think that it would be set to "" if you selected none.

    <?xml version="1.0" encoding="UTF-8" ?>
    <?ccsproject version="1.0"?>
    <projectOptions>
    	<deviceVariant value="com.ti.ccstudio.deviceModel.TMS470.GenericCortexM3Device"/>
    	<deviceFamily value="TMS470"/>
    	<deviceEndianness value="be32"/>
    	<codegenToolVersion value="5.0.1"/>
    	<isElfFormat value="true"/>
    	<connection value=""/>
    	<rts value="libc.a"/>
    	<templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate,"/>
    	<isTargetManual value="false"/>
    </projectOptions>

  • I have requirement to create two application that will be downloaded on same chip. One will have c_init (say app1)and other will not have(say app2).

    app1 will call API's of app2 when ever required. In app2 there shall not be any initialization and run time library. 

    The sample project which I have shared is for app2.

    Thanks & Regards

    Abhimanyu

  • Hello Abhimanyu,

    Have you already set up the linker command file for app2 so that each of the api functions are located at specific addresses?  You will need to specify the address for each function since app1 has to know where each function is located.

    Is the app2 in C or C++?

    If C, I would do the following for the app2 linker command script:

    1. Remove .cinit, .pinit, .stack and .esysmem

    2. Create an empty function and set that function as the the application entry point.   I am not sure about the arm compiler settings, but for the C2000, the application entry point setting is located in the property dialog box at CCS Build->C2000 Linker->Advanced Options->Symbol Management.

    Stephen

  • It seems <rts value="libc.a"/> is correct even though rts is set to none.

  • Abhimanyu Kumar said:
    app1 will call API's of app2 when ever required. In app2 there shall not be any initialization and run time library. 

    The sample project which I have shared is for app2

    From a look at the code of app2, it appears that the ROM_APITable contains pointers to the app2 functions.

    In that case, think you need to use the RETAIN Pragma on ROM_APITable to tell the linker it must preserve the ROM_APITable, which should then also link in the functions pointed to by ROM_APITable.

    i.e. try:

    #pragma DATA_SECTION(ROM_APITable, ".romapitable")
    #pragma RETAIN(ROM_APITable)
    UI *ROM_APITable[] =
    {
       (UI *)ROM_API1Table,
       (UI *)ROM_API2Table,
       (UI *)ROM_API3Table
    };
    

  • By doing what I said, I was able to generate an object file that doesn't contain an RTS. I was also able to verify it by examing the .hex file.
  • I have built the file as suggested by you with ARM compiler 5.2.6 and still getting the below error:-

    <Linking>
    warning #10062-D: entry-point symbol "_c_int00" undefined

    undefined first referenced
    symbol in file
    --------- ----------------
    __TI_decompress_none

    error #10234-D: unresolved symbols remain
    warning #10202-D: no suitable entry-point found; setting to 0
    error #10010: errors encountered during linking; "test.out" not built

    I am wondering why compiler is calling __TI_decompress_none automatically even if it is no where called in application, i think it is due to function pointer table, but this is must required.

    I want to disable __TI_decompress_none or any type of automatic library function call,I think there would be a way.
    I tried building using batch files but got same error.
    I suppose that compression of function pointer table is happening and it is default feature of linker, it should be configurable.

    Please help me in resolving this error.

    Thanks & Regards,
    Abhimanyu
  • Abhimanyu Kumar said:
    I am wondering why compiler is calling __TI_decompress_none automatically even if it is no where called in application, i think it is due to function pointer table, but this is must required.

    __TI_decompress_none was being called to initialize the ROM_APITable array.

    Since the ROM_APITable array isn't changed by the program, you can const qualify the ROM_APITable by changing to:

    #pragma DATA_SECTION(ROM_APITable, ".romapitable")
    UI *const ROM_APITable[] =
    {
       (UI *)ROM_API1Table,
       (UI *)ROM_API2Table,
       (UI *)ROM_API3Table
    };
    

    With this change the __TI_decompress_none is no longer called and the program links without error:

    Building target: test.out
    Invoking: ARM Linker
    "/opt/ti/ti_ccs6_1_1/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" -mv6M0 --code_state=16 --abi=eabi -me -O4 --opt_for_speed=1 --fp_mode=relaxed -g --optimize_with_debug=on --display_error_number --diag_warning=225 --auto_inline=0 --gen_opt_info=2 --single_inline -k --asm_listing -z -m"test.map" --heap_size=0 --stack_size=256 -i"/opt/ti/ti_ccs6_1_1/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/lib" -i"/opt/ti/ti_ccs6_1_1/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --disable_auto_rts --warn_sections --display_error_number --xml_link_info="test.xml" --rom_model --unused_section_elimination=off --zero_init=on -o "test.out" "./source/chip/test_dac.obj" "../test.cmd"  
    <Linking>
    warning #10062-D: entry-point symbol "_c_int00" undefined
    warning #10202-D: no suitable entry-point found; setting to 0
    Finished building target: test.out
     
    Create flash image: Intel-HEX
    "/opt/ti/ti_ccs6_1_1/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armhex" -i "test.out" -o "test.hex" -order LS -romwidth 32
    Translating to Intel format...
       "test.out" .romapitable ==> .romapitable
       "test.out" .text ==> .text
       "test.out" .const ==> .const
     
    
    **** Build Finished ****
    

  • I have earlier checked this option, it is also giving same error.

    As per your log I think rts library is getting included as library path is mentioned during link time even if --disable_auto_rts option is selected.
    /opt/ti/ti_ccs6_1_1/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/lib.