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.

RTOS/TMDSSK3358: Undefined reference to GPIO_init

Part Number: TMDSSK3358

Tool/software: TI-RTOS

Hi

I'm using TI-RTOS for the first time and I'm learning the basics with the TMDSSK3358 board (Sitara AM3558).

http://www.ti.com/tool/TMDSSK3358

I tried the "Hello World" example in Code Composer Studio and this works. The second step was to blink an LED. For this, I wanted to add the GPIO driver. The project configuration:

As far as I understand, the GPIO drivers should be in the am335x PDK, included in the TI Software SDK. This is included, also in the compiler path:

Including the GPIO header also works:

#include <xdc/std.h>

#include <xdc/runtime/System.h>

#include <ti/sysbios/BIOS.h>

#include <ti/sysbios/knl/Task.h>

#include <ti/drv/gpio/GPIO.h>

Now, I tried to call GPIO functions like GPIO_init(). This gives an "Undefined reference to GPIO_init" error:

Any idea why? Are there libraries missing? The GPIO_init is defined in the GPIO.h file, but is marked as external. So probably there is a missing link or something.

Thanks for the help!

Sebastian

EDIT: Copy/Paste images seem not to work...

  • The RTOS team have been notified. They will respond here.
  • Sebastian,

    The Processor SDK RTOS release already provides a GPIO LED blink example that is TI-RTOS based on the AM335x SK. Its located at
    C:\ti\pdk_am335x_1_0_8\packages\MyExampleProjects\GPIO_LedBlink_skAM335x_armTestProject

    Please see this example for some guidance on how to build you example.
    Here is a video on how to generate the MyExampleProjects folder in the PDK.
    training.ti.com/processor-sdk-device-drivers-setup-test

    Hope this helps.

    Lali

    PS: I don't think copy/paste of images works on e2e.
    You have to insert images by clicking on the "Insert Code, Attach Files and more..." link below.
  • Hi

    Thanks for the answer.

    I already tried this example and it works, or it almost works The LED is not blinking, but is switched on. There seems to be a problem with the callback function, but I haven't examined it any further.

    But the point is: In this example, functions like GPIO_toggle() are called and the compiler accept it. I don't see the difference between this example project and my own project. The blinky task with GPIO was just an example to test how to load drivers. The same problem occurs when I load the UART-header:

    #include <ti/drv/uart/UART.h>

    Calling the UART_init() brings up the error "Undefined reference to UART_init". I have to make a fundamental mistake loading drivers into my project, but I don't see which one.

    Sebastian

  • Hi 

    Did you find a solution for your problem.

    Rafal

  • Hi Rafal

    No, I don't. There seems to be a problem with paths and libraries.

    I had a similar problem with a TivaC demo board. The paths that are set automatically when you activate an option under "products" are not working, so you have to set manually the directories and the linker libraries. My guess is that there is a linker problem with a library, but I don't know which libraries I have to add.

  • I solve the problem by adding from the ti/drv/gpio folder this files GPIO_soc.c and GPIO_bbbAM335x_board.c also u need to add to your app.cfg file 

    /* Load the gpio package */
    var GpioPackage = xdc.loadPackage('ti.drv.gpio');
    GpioPackage.Settings.enableProfiling = true;

    To run the Board_init(); I had to add a UART_soc.c 

    Rafal