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.

OMAPL138 experimenter, SYS/BIOS 6.31, and PSP 2.10 linking error

Other Parts Discussed in Thread: OMAPL138, SYSBIOS

Hello,

I am trying out a simple test code using SYS/BIOS and PSP. The code has a single task that toggles a GPIO pin. However, when I try to build the project, I get the following linking error

<Linking>

undefined                                                first referenced

symbol                                                     in file

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

_gpio0                                                    ./Main.obj

_ti_psp_gpio_Gpio_setPinDir__E  ./Main.obj


The Main.c has the following code segments

#include  "ti/psp/cslr/cslr_syscfg0_OMAPL138.h"
#include  "ti/psp/gpio/Gpio.h"
#include  "ti/psp/cslr/soc_OMAPL138.h"


extern Gpio_Handle gpio0;

----- Inside initialization -----

CSL_SyscfgRegsOvly sysCfgRegs = (CSL_SyscfgRegsOvly)CSL_SYSCFG_0_REGS;

Error_Block eb;

Gpio_PinCmdArg pinCmdArg;

sysCfgRegs->PINMUX12 &= PINMUX12_GPIO5_MASK;

sysCfgRegs->PINMUX12 |= PINMUX12_GPIO5_ENABLE;

Error_init(&eb);

pinCmdArg.pin = GPIO5_1_PIN;

pinCmdArg.value = Gpio_Direction_Output;

Gpio_setPinDir(gpio0, &pinCmdArg,&eb);

The project built fine untill I added the segment highlighted in yellow.

I checked all the file paths and could not find what I am missing.

Linker options: -z -m"SysBios_GPIO2.map" --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.2.2/lib" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.2.2/include" -i"C:/Program Files/Texas Instruments/ipc_1_22_03_23/packages" -i"C:/Program Files/Texas Instruments/bios_6_31_04_27/packages" -i"C:/Program Files/Texas Instruments/pspdrivers_02_10_01/packages" --reread_libs --rom_model

 The following are the versions of various components

CGT: 7.2.2

XDCTools: 3.20.8.88

SYS/BIOS: 6.31.4.27

PSP: 2.10.1

Target: tt.targets.C674

Platform: ti.platforms.expOMAPL138 (I have the old OMAPL138 experimenter from logicpd)

CCS: 4.2.3


Could anyone please guide me on what I could be doing wrong? I am also not sure about the various versions of the components used. For example, the documentation for PSP says it requires XDC 3.16, but it is no longer available as far as I can see.


Thank you for your help,


Joe

  • I believe the PSP component includes a GPIO sample application.  Are you able to build and run it?

  • Hi David,

    Thank you for your response.

    Yes, I was able to build and run the sample code. In fact, I tried the sample code first before attempting to write my own. However, the sample code uses

    DSP/BIOS: 5.41.10.36

    PSP: 1.30.0.06

    CGT: 6.1.9

    There was a small issue when I ran the code - the code uses GPIO4 pin 0 as an interrupt input that generates an interrupt when an SD card is inserted. Once interrupted, the corresponding task terminates. But when I ran the code, it kept on printing to the log "waiting for user to insert MMCSD card" in an infinite loop inside the task. Inserting the SD card did not generate the interrupt and terminate the task. I believe this was probably due to the fact that the code was for an OMAPL138 EVM and I was running it on a OMAPL138 experimenter (I could be wrong with this assumption). I then decided to create a project for SYS/BIOS 6.31.4.27 using project templates with two tasks. I deleted one of the task, and moved the other task init to cfg file. Successfully built and ran the code. Then I started adding code (mainly copying from the sample gpio project) for initializing GPIO and that is when I started getting linking errors.

    Am I using incorrect PSP or BIOS for my OMAPL138 experimenter?

    Thank you for your help,

    Joe

  • Hi joe,

     

    Looks like there is a lot of confusion here.. lets sort out one by one.

     

    Joseph CJ said:

    Linker options: -z -m"SysBios_GPIO2.map" --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.2.2/lib" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.2.2/include" -i"C:/Program Files/Texas Instruments/ipc_1_22_03_23/packages" -i"C:/Program Files/Texas Instruments/bios_6_31_04_27/packages" -i"C:/Program Files/Texas Instruments/pspdrivers_02_10_01/packages" --reread_libs --rom_model

    However, the sample code uses

    DSP/BIOS: 5.41.10.36

    PSP: 1.30.0.06

    CGT: 6.1.9

    - Seems like the CCSv4 linker optios are pointing to bios_6_31_04_27 and pspdrivers_02_10_01but you are using the sample code of PSP: 1.30.0.06. Can you please clarify this?.

    1. Please decide if you want to use DSP BIOS 5 or SYS BIOS 6?. PSP 1.30.00.06 supports only BIOS5 and PSP 02.10.01 supports only BIOS6.

    2. Upon deciding, please refer the Userguide placed in:(pspdrivers_01_30_00_06\docs\OMAPL138) or (\pspdrivers_02_10_01\docs\OMAPL138) and install all the tools as mentioned and set environment variables accordingly. Else you are prone to get such linking erros.

    3. The sample code should also run on the OMAPL138 experimenter board. I suggest you to run the binaries that are readily available in the PSP package(that comes with the PSP itself!) and check its working. Then, you can proceed in making changes with your sample code. 

    Thanks & regards,

    Raghavendra

  • Hi Raghavendra,

    Thank you for your reply and sorry for the confusion. I will try to clarify further

    ------------------------------sample PSP code that I was able to build and run uses --------------------------------------------

    DSP/BIOS: 5.41.10.36

    PSP: 1.30.0.06

    CGT: 6.1.9

    Linker options for this was for the above components, which I dont have a copy of at the moment.

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

    -----------------------------After getting sample code working, I decided to write mine using----------------------------------

    CGT: 7.2.2

    XDCTools: 3.20.8.88

    SYS/BIOS: 6.31.4.27 (I want to use SYS/BIOS)

    PSP: 2.10.1

    Target: tt.targets.C674

    Platform: ti.platforms.expOMAPL138 (I have the old OMAPL138 experimenter from logicpd)

    CCS: 4.2.3

    Linker options: -z -m"SysBios_GPIO2.map" --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.2.2/lib" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.2.2/include" -i"C:/Program Files/Texas Instruments/ipc_1_22_03_23/packages" -i"C:/Program Files/Texas Instruments/bios_6_31_04_27/packages" -i"C:/Program Files/Texas Instruments/pspdrivers_02_10_01/packages" --reread_libs --rom_model

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

    To write my code, I first created a simple app with a single task. Compiled and ran it. Then I added code to set the pinmux to use GPIO5 (pin 1). Successfully built and ran the code. Then I added code to set the direction of the GPIO5 (pin1) using

    Gpio_setPinDir(gpio0, &pinCmdArg,&eb);

    This is when I started getting the following linking error

    <Linking>

    undefined                                                    first referenced

    symbol                                                        in file

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

    _gpio0                                                       ./Main.obj

    _ti_psp_gpio_Gpio_setPinDir__E      ./Main.obj

     

    As far as I can see, I have added all the required paths in the linker options. Could you please guide me on what could be missing?

    I also looked through the documentation. It asks for XDCT 3.16, which is no longer available. Therefore, I used XDCT 3.20. Other than that, I have everything else setup as per the documentation.

    Thanks

    Joe

     

  • Hi Joe,

     

    Where are you creating the GPIO handle(gpio0)?.  Have you taken care of the .cfg file? If you refer the PSP_02_10_01 release, check the gpioSample.cfg file (placed in: pspdrivers_02_10_01\packages\ti\psp\examples\evmOMAPL138\gpio\config)

    Are you doing the following in the .cfg file?.. of your application project?.

    ======================================================================================= 

    var Gpio        = xdc.useModule ("ti.psp.gpio.Gpio");

    var gpioParams = new Gpio.Params();
    gpioParams.instNum = 0;
    /*
    Set the bank parameters . Need to set the availability status for GPIO bank/pin.
    By default all Pins/Banks shall be not available for use. The application marks
    the pins and banks available for use and also HWI number assigned for it, if any
    */
    gpioParams.BankParams[4].inUse = Gpio.InUse_No;
    gpioParams.BankParams[4].hwiNum  = 8;
    gpioParams.BankParams[4].PinConfInfo[0].inUse = Gpio.InUse_No;

    Program.global.gpio0 = Gpio.create(gpioParams);

    ======================================================================================= 

    It would be more helpful if you attach the .cfg file of your application..

    You are doing a CCS build or a xdc command line build?. If you refer the Userguide, the system requirements mentions about tools to be installed. Looks like you are using the higher versions. If you still face any compiler/related errors, I request you to try with

    IPC version - ipc_1_20_00_23

    Code Generation Tools 6.1.12 for building DSP objects

     

    Code Generation Tools 4.6.1 for building ARM objects

     

    Thanks & regards,

    Raghavendra

  • Hi Raghavendra,

    Thank you for all your help, I made some progress :)

    After tinkering for a day, and with your suggestions, I was able to successfully build and run the sample code for SYS/BIOS (I originally tried only the DSP/BIOS sample code). This time, everything worked, including the interrupt generated by inserting the SD card. I did get few errors along the way (For example, if I select ‘whole_program’ as Build-profile, I get access denied error for linker.cmd. So I changed it to ‘debug’).

    I ended up using the following to make this work (I am using CCS build)
    CGT: 6.1.19
    BIOS: 6.21.03.21
    IPC: 1.20.00.23
    PSP: 2.10.01
    XDCT: 3.16.5.41

    I also modified the sample code and was able to toggle another GPIO pin.

    Now I am trying to move the working code segments from the “sample project” to my “test project”. I also changed the versions of all the components to the above. However, I am getting the following error while linking.

    "../Main.c", line 41: error: declaration is incompatible with "const ti_psp_gpio_Gpio_Handle gpio0" (declared at line 17 of "C:/Program Files/Texas

    Instruments/pspdrivers_02_10_01/packages/ti/psp/examples/evmOMAPL138

    /SysBiosGpio2/Debug/configPkg/package/cfg/SysBiosGpio2_x674.h")

    ========== Main.c =================
    ;
    ;
    line 41: extern Gpio_Handle  gpio0;

    ;
    #define GPIO_BANK_0                 0u
    #define GPIO0_0_PIN                 1u
    ;
    ;
    Error_Block   eb;
    Gpio_PinCmdArg     pinCmdArg;
    Error_init(&eb);
     
    pinCmdArg.pin   = GPIO0_0_PIN;
    pinCmdArg.value = Gpio_Direction_Output;
    Gpio_setPinDir(gpio0, &pinCmdArg,&eb);
    ===============================

    ===========SysBiosGpio2.cfg=========
    var Gpio        = xdc.useModule ("ti.psp.gpio.Gpio");
    ......

    var gpioParams = new Gpio.Params();
    gpioParams.instNum = 0;
    gpioParams.BankParams[0].inUse = Gpio.InUse_No;
    gpioParams.BankParams[0].hwiNum  = 8;
    gpioParams.BankParams[0].PinConfInfo[0].inUse = Gpio.InUse_No;
    Program.global.gpio0 = Gpio.create(gpioParams);

    ====================================

    Do you know what could be wrong? I checked all the compiler / linker options, and they are same for both the “sample project” and my “test project”.


    Thanks,

    Joe

    6574.SysBiosGpio2.cfg.txt

  • Hi,

    I finally got my test project working. I ended up creating a new project from scratch with the versions of components that worked for the sample project (Originally, I tried to change versions of the components of the test project I made, but ran into issues).

    However, after all this, I might go back to DSP/BIOS 5.x and PSP 1.30 (or not use PSP at all and just code in the register level) as we may have to use the code with OMAPL137, which is not supported by PSP 2.10.

    Once again, thank you Raghavendra and David for all the guidance.

    Joe