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.

CCS/CC1310: Integrating a custom static library in a CCS project

Part Number: CC1310


Tool/software: Code Composer Studio

I want to hide all the functions that we use for a specific driver so I started with one file using the GCC tool to generate the .a file and then put the  (.a) file in the linker include options in CCS to be linked with the whole project. 

I succeeded in generating the .a file using the GCC tool, but have an issue in building the project in CCS as it gives me errors as if I did not add the file to the linker path settings.

you will find screenshots of:

1. how I imported the .a file to CCS project

2. the linker errors 

3. the content of the .a file using nm command in GCC compiler and the screenshot shows that the symbols exist in the .a file

  • Hello,

    There appears to be some path truncation issue. Can you provide ALL the build output in the build console? You can copy & paste to a text file and then attach the text file to this thread.

    Thanks

    ki

  • **** Build of configuration Debug for project L74. RF_SubGHz_Crypto_Dynamic_Key ****
    
    "C:\\ti\\ccs1010\\ccs\\utils\\bin\\gmake" -k -j 4 all -O 
     
    Building target: "L74. RF_SubGHz_Crypto_Dynamic_Key/../../../RF_SubGHz_Crypto_Dynamic_Key.out"
    Invoking: ARM Linker
    "C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_18.12.6.LTS/bin/armcl" -mv7M3 --code_state=16 -me --define=ccs --define=DeviceFamily_CC13X0 -g --c89 --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi -z -m"L74. RF_SubGHz_Crypto_Dynamic_Key.map" --heap_size=0 --stack_size=256 -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_18.12.6.LTS/lib" -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_18.12.6.LTS/include" -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_18.12.6.LTS/lib" -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_18.12.6.LTS/lib" -i"C:/Other stuff/Work/Simplex/New File Structure/17. SL-CC1310/01. LaunchPad/10. ti/source" -i"C:/Other stuff/Work/Simplex/New File Structure/17. SL-CC1310/01. LaunchPad" -i"C:/Other stuff/Work/Simplex/New File Structure/17. SL-CC1310/01. LaunchPad/10. ti/Kernal" -i"C:/Other stuff/Work/Simplex/New File Structure/17. SL-CC1310/01. LaunchPad/10. ti/Kernal/nortos" -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_18.12.6.LTS/include" -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_18.12.6.LTS/include" -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_18.12.6.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="L74. RF_SubGHz_Crypto_Dynamic_Key_linkInfo.xml" --rom_model -o "L74. RF_SubGHz_Crypto_Dynamic_Key/../../../RF_SubGHz_Crypto_Dynamic_Key.out" "./RF_SubGHz_Crypto_Dynamic_Key.obj" "./01. General Functions/CC1310_Pars_Vars_Funcs.obj" "./01. General Functions/CPUInterrupt_Funcs .obj" "./01. General Functions/CPUTimers_Funcs.obj" "./01. General Functions/ISRs_Funcs.obj" "./01. General Functions/RF_SubGHz_Funcs.obj" "./01. General Functions/System_Funcs.obj" "./03. Functions/Ack_Funcs.obj" "./03. Functions/EQEP_Funcs.obj" "./03. Functions/EthernetLookUpTable_Funcs.obj" "./03. Functions/General_Funcs.obj" "./03. Functions/Integration_Funcs.obj" "./03. Functions/SWCRC_Funcs.obj" "./03. Functions/Signals_Funcs.obj" "./03. Functions/Storage_Funcs.obj" "./03. Functions/StructureArrayTransform_Funcs.obj" "./05. General Functions_TI/CC1310_LAUNCHXL.obj" "./05. General Functions_TI/CC1310_LAUNCHXL_fxns.obj" "./05. General Functions_TI/RFQueue.obj" "./05. General Functions_TI/ccfg.obj" "./05. General Functions_TI/smartrf_settings.obj" "./05. General Functions_TI/smartrf_settings_predefined.obj"  -llibc.a -llibc.a -l"C:/Other stuff/Work/Simplex/New File Structure/17. SL-CC1310/01. LaunchPad/02. Common Linker Files/01. Linker Files/CC1310_LAUNCHXL_NoRTOS.cmd" -l"ti/display/lib/display.aem3" -l"ti/grlib/lib/ccs/m3/grlib.a" -l"third_party/spiffs/lib/ccs/m3/spiffs_cc26xx.a" -l"ti/drivers/rf/lib/rf_multiMode_cc13x0.aem3" -l"ti/drivers/lib/drivers_cc13x0.aem3" -l"lib/nortos_cc13x0.aem3" -l"ti/devices/cc13x0/driverlib/bin/ccs/driverlib.lib" -lCrypto_Funcs.a 
    <Linking>
     
     undefined                first referenced                           
      symbol                      in file                                
     ---------                ----------------                           
     Create_Public_Key_Packet ./01. General Functions/RF_SubGHz_Funcs.obj
     Crypto_Config            ./01. General Functions/RF_SubGHz_Funcs.obj
     Crypto_Init              ./01. General Functions/RF_SubGHz_Funcs.obj
     Crypto_LevX              ./01. General Functions/RF_SubGHz_Funcs.obj
     Decrypt_Msg              ./01. General Functions/RF_SubGHz_Funcs.obj
     Encrypt_Msg              ./01. General Functions/RF_SubGHz_Funcs.obj
     Initialize_Keys          ./01. General Functions/RF_SubGHz_Funcs.obj
     
    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "L74. RF_SubGHz_Crypto_Dynamic_Key/../../../RF_SubGHz_Crypto_Dynamic_Key.out" not built
     
    >> Compilation failure
    makefile:177: recipe for target 'L74. RF_SubGHz_Crypto_Dynamic_Key/../../../RF_SubGHz_Crypto_Dynamic_Key.out' failed
    gmake[1]: *** [L74. RF_SubGHz_Crypto_Dynamic_Key/../../../RF_SubGHz_Crypto_Dynamic_Key.out] Error 1
    gmake: *** [all] Error 2
    makefile:173: recipe for target 'all' failed
    
    **** Build Finished ****
    

  • Thanks, this helps a lot.

    I don't see anything wrong with the linker options (though all the spaces and non-alphanumeric characters give me a a bit of a pause...). Can you provide your Crypto_Funcs.a library file?

  • You can find the new screenshots, build logs, and file below:

    TI.rar

  • Thanks.

    A compiler expert analyzed the library you provided and we are confused. The format is an Intel 80386 COFF file. This is not a format we are familiar with. You mentioned GCC was used to build this file. What version of GCC? And for what target?

  • gcc -c -I "C:\Other stuff\Work\Simplex\New File Structure\17. SL-CC1310\01. LaunchPad\01. Common Header Files\01. Header Files" -I "C:\Other stuff\Work\Simplex\New File Structure\17. SL-CC1310\01. LaunchPad\01. Common Header Files\05. Header Files_TI" -I "C:\Other stuff\Work\Simplex\New File Structure\17. SL-CC1310\01. LaunchPad\10. ti\source" -I "C:\Other stuff\Work\Simplex\New File Structure\17. SL-CC1310\01. LaunchPad\10. ti\Kernal\nortos" -I "C:\Other stuff\Work\Simplex\New File Structure\01. NEHW\01. Header Files" -D "DeviceFamily_CC13X0" -D "__TI_COMPILER_VERSION__" Crypto_Funcs.c
    
    ar -rc Crypto_Funcs.a Crypto_Funcs.o
    
    ar -t Crypto_Funcs.a
    
    nm Crypto_Funcs.a

  • This library is not built for the correct target. Please rebuild it for the correct target. You may want to built it with a CCS project.

    Thanks

    ki 

  • Can you tell me how can I do so? Generating libraries using CCS lib project generates one lib file for the whole project and I want to generate lib file for each file in the project

  • nada wael said:
    want to generate lib file for each file in the project

    A library file is typically a collection of object files. There is no point in creating a library for each individual source file. Simply reference the generated object file directly when building you main application.

  • It is required to generate a lib file for each source file. So, how can I do so?

  • nada wael said:
    It is required to generate a lib file for each source file

    I don't understand why you need a lib with a single object file instead of directly using that object file?