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.

Problems when joining L138_am_poll and gpio projects

Other Parts Discussed in Thread: TMS320C6748, SYSBIOS, OMAPL138

Hi,

I'm working with my TMS320C6748 in a functional gpio project. Now I want to include the audio codec in my project (L138_am_poll), but I have some problems on it.

Theoretically, I just have to add the library "L138_LCDK_aic3106_init.h" and the "L138_LCDK_aic3106_init.c" to my project. And then update the compiler and linker included files.

But, what should I do with the cmd file of each project?

Thanks,

Miguel.

  • Linker command file typically contains Memory map of the device and mapping of sections of your application to the device memory. In addition it can configure stack or link object files so you will need to merge the two linker command files.

    Since this is linker command file for the same device I assume that the Memory sections defined in the linker command file will be the same or similar (origin will be the same but length of section may be different). If length is the same then you can leave it to the same value, if they are different set it to the higher value. The map file generated from individual projects should specify how much portion of the section is free to be used.

    For Application binary sections compare the two linker command files and if there is some section missing then add it to the command file for the combined project.

    Documention of syntax used in Linker command files is part of the compiler documentation under C:\ti\ccsv5\tools\compiler\c6000\cgt_7.x\docs

    If the above steps don`t work, please post the two linker commnad files here on the forums , along with the error you see. and we can help you merge it.

    Regards,

    Rahul

  • Hi Rahul,

    I've tried to join both cmd files but I couldn't make it. Could help me with this? These are the cmd files:

    gpio.cmd

    // ============================================================================
    // Linker Command File for Linking c674 DSP Programs
    //
    // These linker options are for command line linking only. For IDE linking,
    // you should set your linker options in Project Properties.
    //         -c                    Link Using C Conventions
    //        -stack     0x1000        Software Stack Size
    //        -heap    0x1000        Heap Area Size
    // ===========================================================================
    -stack 0x1000
    -heap 0x1000

    // ============================================================================
    //                         Specify the System Memory Map
    // ============================================================================
    MEMORY
    {
        L1P:    o = 0x11E00000        l = 0x00008000
        L1D:    o = 0x11F00000        l = 0x00008000
        L2:     o = 0x11800000        l = 0x00040000
        DDR2:   o = 0xC0000000        l = 0x08000000
    }

    // ============================================================================
    //                 Specify the Sections Allocation into Memory
    // ============================================================================
    SECTIONS
    {
        .cinit        >        DDR2               // Initialization Tables
        .pinit        >        DDR2               // Constructor Tables
        .init_array   >        DDR2               //
        .binit        >        DDR2               // Boot Tables
        .const        >        DDR2               // Constant Data
        .switch       >        DDR2               // Jump Tables
        .text         >        DDR2               // Executable Code
        .text:_c_int00: align=1024 > DDR2         // Entrypoint

        GROUP (NEARDP_DATA)                       // group near data
        {
           .neardata
           .rodata
           .bss                                   // note: removed fill = 0
        }             >        DDR2
        .far: fill = 0x0, load > DDR2             // Far Global & Static Variables
        .fardata      >        DDR2               // Far RW Data
        .stack        >        DDR2               // Software System Stack
        .sysmem       >        DDR2               // Dynamic Memory Allocation Area
        
        .cio          >        DDR2               // C I/O Buffer
        .vecs         >        DDR2               // Interrupt Vectors
    }

    linker_dsp.cmd  (audio codec)

    /* linker_dsp.cmd */

    -stack           0x00000800
    -heap            0x00010000

    MEMORY
    {
       dsp_l2_ram:      ORIGIN = 0x11800000  LENGTH = 0x00040000
       shared_ram:      ORIGIN = 0x80000000  LENGTH = 0x00020000
       external_ram:    ORIGIN = 0xC0000000  LENGTH = 0x08000000
    }

    SECTIONS
    {
       .text       > dsp_l2_ram
       .const      > dsp_l2_ram
       .bss        > dsp_l2_ram
       .far        > dsp_l2_ram
       .switch     > dsp_l2_ram
       .stack      > dsp_l2_ram
       .data       > dsp_l2_ram
       .cinit      > dsp_l2_ram
       .sysmem     > dsp_l2_ram
       .cio        > dsp_l2_ram
       .vecs       > dsp_l2_ram
       .EXT_RAM    > external_ram
    }

    I also have problems with the obj files, but first I think we should join the cmd files. All the errors I get on the building process are involved with L138_LCDK_aic3106init.obj

    Thanks a lot,

    Miguel.

  • Hi Miguel,

    Please find the combined linker.cmd file below:-

    Explanation:

    The second linker command file's section directives are into the L2 RAM.

    For both the projects you can combinedly use the DDR2 and add  .EXT_RAM  into SECTIONS.

    As the stack size for the first linker file is being greater as 0x10000 than the stack size given at the second file, you can choose the 0x10000 and not the 0x800.

    The heap size is same for both!.

    "Combined_gpio_dsp.cmd "

    // ============================================================================
    // Linker Command File for Linking c674 DSP Programs
    //
    // These linker options are for command line linking only. For IDE linking,
    // you should set your linker options in Project Properties.
    //         -c                    Link Using C Conventions
    //        -stack     0x1000        Software Stack Size
    //        -heap    0x1000        Heap Area Size
    // ===========================================================================
    -stack 0x1000
    -heap 0x1000

    // ============================================================================
    //                         Specify the System Memory Map
    // ============================================================================
    MEMORY
    {
        L1P:    o = 0x11E00000        l = 0x00008000
        L1D:    o = 0x11F00000        l = 0x00008000
        L2:     o = 0x11800000        l = 0x00040000
        DDR2:   o = 0xC0000000        l = 0x08000000
    }

    // ============================================================================
    //                 Specify the Sections Allocation into Memory
    // ============================================================================
    SECTIONS
    {
        .cinit        >        DDR2               // Initialization Tables
        .pinit        >        DDR2               // Constructor Tables
        .init_array   >        DDR2               //
        .binit        >        DDR2               // Boot Tables
        .const        >        DDR2               // Constant Data
        .switch       >        DDR2               // Jump Tables
        .text         >        DDR2               // Executable Code
        .text:_c_int00: align=1024 > DDR2         // Entrypoint

        GROUP (NEARDP_DATA)                       // group near data
        {
           .neardata
           .rodata
           .bss                                   // note: removed fill = 0
        }             >        DDR2

       .data      >        DDR2

        .far: fill = 0x0, load > DDR2             // Far Global & Static Variables
        .fardata      >        DDR2               // Far RW Data
        .stack        >        DDR2               // Software System Stack
        .sysmem       >        DDR2               // Dynamic Memory Allocation Area
       
        .cio          >        DDR2               // C I/O Buffer
        .vecs         >        DDR2               // Interrupt Vectors

        .EXT_RAM    >     DDR2 
    }

    Regards,

    Shankari

     

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

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------

  • Hi,

    Thanks a lot Shankari for helping me with the cmd file! But I still have a few errors on the building process:

    Description    Resource    Path    Location    Type
    unresolved symbol AIC3106_writeRegister, first referenced in ./L138_LCDK_aic3106_init.obj    gpio_c674x_c6748_lcdkC6748             C/C++ Problem

    Description    Resource    Path    Location    Type
    unresolved symbol EVMOMAPL138_lpscTransition, first referenced in ./L138_LCDK_aic3106_init.obj    gpio_c674x_c6748_lcdkC6748             C/C++ Problem

    Description    Resource    Path    Location    Type
    unresolved symbol EVMOMAPL138_pinmuxConfig, first referenced in ./L138_LCDK_aic3106_init.obj    gpio_c674x_c6748_lcdkC6748             C/C++ Problem

    Description    Resource    Path    Location    Type
    unresolved symbol GPIO_getInput, first referenced in ./L138_LCDK_aic3106_init.obj    gpio_c674x_c6748_lcdkC6748             C/C++ Problem

    Description    Resource    Path    Location    Type
    unresolved symbol GPIO_setDir, first referenced in ./L138_LCDK_aic3106_init.obj    gpio_c674x_c6748_lcdkC6748             C/C++ Problem

    Description    Resource    Path    Location    Type
    unresolved symbol USTIMER_init, first referenced in ./L138_LCDK_aic3106_init.obj    gpio_c674x_c6748_lcdkC6748             C/C++ Problem

    Description    Resource    Path    Location    Type
    unresolved symbol vectors, first referenced in ./L138_LCDK_aic3106_init.obj    gpio_c674x_c6748_lcdkC6748             C/C++ Problem

    Description    Resource    Path    Location    Type
    unresolved symbols remain    gpio_c674x_c6748_lcdkC6748             C/C++ Problem

    Do have any idea of why this is happening?

    Thanks,

    Miguel.

  • Hi Miguel,

    Is it possible to upload your project with all the source ?

     

    Regards,

    Shankari

  • Hi,

    Which destination export should I select for upload the project?

    Regards,

    Miguel.

  • Hi,

    This error seems linking error,

    What are your projects trying to combine?

    I have doubt on your project linking.

    Provide your exact libraries name in linking options (ex: drivers.lib, platform.lib)

    Share your screen shot of  linker options from CCS "properties"

  • Hi,

    This is the screen shot of my linker file search path:

    Regards,

    Miguel.

  • Hi,

    Attachment is not available,

    I think it is missed.

    Please check it and attach the same.

  • Sorry. Linker - file search path:

    Thanks,

    Miguel.

  • Hi,

    Try to give the exact location path of libraries than using "../../"

    I'm able to build & run without any issues the combinations of SYSBIOS code and starterware code by proper adding the include files and linking.

    Ex:

    Attach your project folder or send your project to my email ID (x0213399@ti.com)

    Also, Provide your installation location too.

  • The paths "../../" appeared when I opened the original gpio project example. These paths work fine when I build only the GPIO part of the project, if I add the audio codec then I have those errors.

    I have sent you an email with the info you asked me for. If you need anything else just tell me.


    Thanks,

    Miguel.

  • Hi,

    I got your files, Thanks.

    I have sent modified project and update your results here,

    I have given exact location path for libraries.

    We will check tomorrow.

  • Hi Miguel,

    I'm able to build your project which is combined gpio and audio projects.

    The following issues were identified in your project build.

    1) "evmomapl138_bsl.lib" libraries were compiled in "COFF" format, So you are getting linker error when you trying to build with combined GPIO & audio project with "ELF" format.

    2) We can't build "evmomapl138_bsl.lib" library in ELF format since we don't have source code of that instead we need to compile the our combined format in "COFF" format.

    3) We have to compile the "drivers.lib" and "platform.lib" libraries in COFF format also, since those libraries were compiled in ELF format already.

    I'm not sure about the functionality because "audio" project is from "EVM" board and "gpio" project is from "LCDK"

    I will send your modified project through email.

    LOG:


    **** Build of configuration Debug for project gpio_c674x_c6748_lcdkC6748 ****

    /opt/ti/ccsv5/utils/bin/gmake -k all
    Building file: /home/ti/Downloads/Exported/gpio_c674x_c6748_lcdkC6748/L138_LCDK_aic3106_init.c
    Invoking: C6000 Compiler
    "/opt/ti/ccsv5/tools/compiler/c6000_7.4.4/bin/cl6x" -mv6740 -g --define=c6748 --include_path="/opt/ti/C6748_StarterWare_1_20_04_01/include/" --include_path="/home/titus/OMAPL138_LPD_EVM_DOWNLOADS/evmomapl138_v1-1/bsl/inc" --include_path="/opt/ti/C6748_StarterWare_1_20_04_01/include/c674x/c6748" --include_path="/opt/ti/C6748_StarterWare_1_20_04_01/include/hw" --include_path="/opt/ti/ccsv5/tools/compiler/c6000_7.4.4/include" --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="L138_LCDK_aic3106_init.pp"  "/home/ti/Downloads/Exported/gpio_c674x_c6748_lcdkC6748/L138_LCDK_aic3106_init.c"
    Finished building: /home/ti/Downloads/Exported/gpio_c674x_c6748_lcdkC6748/L138_LCDK_aic3106_init.c
     
    Building file: /home/ti/Downloads/Exported/gpio_c674x_c6748_lcdkC6748/gpioCardDetect.c
    Invoking: C6000 Compiler
    "/opt/ti/ccsv5/tools/compiler/c6000_7.4.4/bin/cl6x" -mv6740 -g --define=c6748 --include_path="/opt/ti/C6748_StarterWare_1_20_04_01/include/" --include_path="/home/titus/OMAPL138_LPD_EVM_DOWNLOADS/evmomapl138_v1-1/bsl/inc" --include_path="/opt/ti/C6748_StarterWare_1_20_04_01/include/c674x/c6748" --include_path="/opt/ti/C6748_StarterWare_1_20_04_01/include/hw" --include_path="/opt/ti/ccsv5/tools/compiler/c6000_7.4.4/include" --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="gpioCardDetect.pp"  "/home/ti/Downloads/Exported/gpio_c674x_c6748_lcdkC6748/gpioCardDetect.c"
    Finished building: /home/ti/Downloads/Exported/gpio_c674x_c6748_lcdkC6748/gpioCardDetect.c
     
    Building file: /home/ti/Downloads/Exported/gpio_c674x_c6748_lcdkC6748/vectors_poll.asm
    Invoking: C6000 Compiler
    "/opt/ti/ccsv5/tools/compiler/c6000_7.4.4/bin/cl6x" -mv6740 -g --define=c6748 --include_path="/opt/ti/C6748_StarterWare_1_20_04_01/include/" --include_path="/home/titus/OMAPL138_LPD_EVM_DOWNLOADS/evmomapl138_v1-1/bsl/inc" --include_path="/opt/ti/C6748_StarterWare_1_20_04_01/include/c674x/c6748" --include_path="/opt/ti/C6748_StarterWare_1_20_04_01/include/hw" --include_path="/opt/ti/ccsv5/tools/compiler/c6000_7.4.4/include" --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="vectors_poll.pp"  "/home/ti/Downloads/Exported/gpio_c674x_c6748_lcdkC6748/vectors_poll.asm"
    Finished building: /home/ti/Downloads/Exported/gpio_c674x_c6748_lcdkC6748/vectors_poll.asm
     
    Building target: gpioLed.out
    Invoking: C6000 Linker
    "/opt/ti/ccsv5/tools/compiler/c6000_7.4.4/bin/cl6x" -mv6740 -g --define=c6748 --diag_warning=225 --abi=coffabi -z -m"gpio_c674x_c6748_lcdkC6748.map" --warn_sections -i"/opt/ti/ccsv5/tools/compiler/c6000_7.4.4/lib" -i"/opt/ti/C6748_StarterWare_1_20_04_01/build/c674x/cgt_ccs/c6748/lcdkC6748/platform/Debug" -i"/opt/ti/C6748_StarterWare_1_20_04_01/binary/c674x/cgt_ccs/c6748/system_config/Debug" -i"/opt/ti/C6748_StarterWare_1_20_04_01/build/c674x/cgt_ccs/c6748/drivers/Debug" -i"/home/titus/OMAPL138_LPD_EVM_DOWNLOADS/evmomapl138_v1-1/bsl/lib" -i"/opt/ti/ccsv5/tools/compiler/c6000_7.4.4/include" --reread_libs --xml_link_info="gpioLed_linkInfo.xml" --rom_model -o "gpioLed.out"  "./vectors_poll.obj" "./gpioCardDetect.obj" "./L138_LCDK_aic3106_init.obj" "../gpio.cmd" -levmomapl138_bsl.lib -lplatform.lib -lsystem_config.lib -ldrivers.lib -l"libc.a"
    <Linking>
    warning: library
       "/opt/ti/C6748_StarterWare_1_20_04_01/binary/c674x/cgt_ccs/c6748/system_conf
       ig/Debug/system_config.lib" contains ELF object files which are incompatible
       with the TI-COFF output file.  Ensure you are using the proper library.
    warning: library
       "/opt/ti/C6748_StarterWare_1_20_04_01/binary/c674x/cgt_ccs/c6748/system_conf
       ig/Debug/system_config.lib" contains ELF object files which are incompatible
       with the TI-COFF output file.  Ensure you are using the proper library.
    Finished building target: gpioLed.out
     

    **** Build Finished ****

    Note:

    I received the above shaded error for "drivers.lib" and "platform.lib" which is required to build "gpio" project but the above "system_config.lib" is not required for your project, that why we didn't receive any error.

  • How did you change the format of the libraries?

  • Hi,

    Sorry for the delayed response.

    Select your project and click "properties" option and choose "COFF" in "Output format" settings.

  • Ok! It worked for me! I just had to choose the COFF format!

  • Hi Miguel,

    Sounds good.

    Thanks for your update.

    Note:

    Titus said:

    I'm not sure about the functionality because "audio" project is from "EVM" board and "gpio" project is from "LCDK"

    As I said early, Please try to run the binary, If any issues, Debug your code through emulator.

  • How do I run the binary? It seems like the gpio project isn't working. But I don't get any error...

  • Hi,

    Do you have emulator with you?

    If yes, Debug your project through CCS (load option & click start button to run).

    If not, It is difficult to find out problem.

  • I have the XDS100v2 emulator connected to my board. Which steps do I have to follow for debugging throgh the emulator?

  • Hi Titus,

    I've discovered where the problem is. On the sentence from int main function:

      /* The Local PSC number for GPIO is 3. GPIO belongs to PSC1 module.*/
          PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON,
                   PSC_MDCTL_NEXT_ENABLE);

    The program gets into psc.c and it stays indefinitly on this while loop:

        if (timeout != 0)
        {
            timeout = 0xFFFFFF;
            status = flags & PSC_MDCTL_NEXT;
            do {
                timeout--;
            } while(timeout &&
                    (HWREG(baseAdd + PSC_MDSTAT(moduleId)) & PSC_MDSTAT_STATE) != status);
        }

    Each time I click on Step Into, the value of timeout decreases, but its initial value is very high. After that loop, I get into another loop on evmomapl138.c and I can't get out of it:

    while (CHKBIT(psc->MDSTAT[in_module], MASK_STATE) != in_next_state) {}

    For what is that timeout and why am I getting stuck in the second while loop? Do you have any idea of why this is happening?

    Thanks.

  • Following thread:

    http://e2e.ti.com/support/dsp/omap_applications_processors/f/42/t/347171.aspx