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 including GPIO_write into TI_RTOS SimpleLink application

Other Parts Discussed in Thread: CC3200, SYSBIOS, CC3200SDK

Dear community members,


I am currently working on an application for my CC3200_LaunchPad, which allows me to run two tasks independently from each other. The first task should collect data from a sensor while the other task transfers the Data via WLAN to a notebook. Now, I wanted to include a GPIO connection to allow the tasks to write on the LED pins. But unfortunately, since about one week I am getting a lot of Errors without any success.

I did everything, as discribed in here : http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/2_14_01_20/exports/tirtos_full_2_14_01_20/docs/doxygen/html/index.htm

Enclosed, please find my source code :

//Standard_header
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

//XDCtools_header
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>

//BIOS_header
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Clock.h>

//Board_header
#include "Board.h"
#include "ti/drivers/gpio/GPIOCC3200.h"

//Simplelink_header
#include "osi.h"
#include "common.h"
#include "simplelink.h"

//Global Variables
int icount;

//Task1 to collect Data
void Data(void)
{
        while(icount < 4){

                GPIO_toggle(Board_LED0);
        }
        icount++;
}

//Task2 for Data Transfer
void Transfer(UArg arg0, UArg arg1)
{
        if (icount == 4){

                GPIO_write(Board_LED1, 1);
                icount = 0;
        }
}

//Mainfunction
int main(void)
{
    Task_Params task0Params, task1Params;
    Task_Handle task0, task1;
    Error_Block eb;

/**** Initialisations ****/
    //Board
    Board_initGeneral();
    Board_initGPIO();
    Error_init(&eb);
    //LED
    GPIO_write(Board_LED0, 0);
    GPIO_write(Board_LED1, 0);
    //Task_Transfer
    Task_Params_init(&task0Params);
    task0Params.priority = 5;
    task0Params.stackSize = 512;
    //Task_Data
    Task_Params_init(&task1Params);
    task1Params.priority = 15;
    task1Params.stackSize = 512;

/**** Creation of Task_Threads ****/
    task0 = Task_create((Task_FuncPtr)Transfer, &task0Params, &eb);
    if (task0 == NULL) {
        System_abort("Transfer create failed");
    }
    task1 = Task_create((Task_FuncPtr)Data, &task1Params, &eb);
    if (task1 == NULL) {
        System_abort("Data create failed");
    }

    //BIOS_Start
    BIOS_start();

    return (0);
}

In addition, I have copied "CC3200_LAUNCHXL.h" and "CC3200_LAUNCHXL.c" into my project folder, because otherwise the application couldn´t find Board_initGPIO(); !!!


Thank you very much in advance !

Christopher

  • Christopher,

    Are you able to successfully run the gpiointerrupt example that ships with TI-RTOS?

    I would suggest that you import, build, and run that example. This example uses GPIO_write() to light an LED.

    Once you get that part working, you could make a copy of the example, modifying it to do what you want. Once that's working, trying merging that work into your main app and get it working like that.

    Cheers,

    Steve
  • Hey Steve,

    thanks a lot for your quick response !!

    No I am not able to run that example. It gets me the same two Errors, compared to my own application :

    "C:/ti/tirtos_simplelink_2_14_03_28/packages/ti/drivers/gpio/GPIOCC3200.h", line 172: error #20: identifier "GPIO_PinConfig" is undefined
    "C:/ti/tirtos_simplelink_2_14_03_28/packages/ti/drivers/gpio/GPIOCC3200.h", line 175: error #20: identifier "GPIO_CallbackFxn" is undefined

    I have had such Errors in my previous project, as well. Normaly, as the error comes while compiling, that works out by correcting some libraries. But this time, I double checked everything and it is supposed to be fine.

    Cheers,
    Chris
  • Chris,

    I tried importing the same gpio interrupt example (from the same version of TI-RTOS) and I was able to build successfully.

    Can you please post the full build output you are seeing when you build that example?

    Also, if you can zip up and attach the entire example to this thread, it would be helpful, too.

    Lastly, which version of CCS are you using?

    Steve
  • 0410.Workspace_WDT.rar

    Steve,

    Sorry, for my answer coming so late. There you go :

    /******************************************************/
    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
    'Building file: ../Wireless_Data_Transfer.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_31_01_33_core/xs" --xdcpath="C:/ti/tirtos_simplelink_2_14_03_28/packages;C:/ti/tirtos_simplelink_2_14_03_28/products/bios_6_42_03_35/packages;C:/ti/tirtos_simplelink_2_14_03_28/products/uia_2_00_02_39/packages;C:/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M4 -p ti.platforms.simplelink:CC3200 -r release -c "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6" "../Wireless_Data_Transfer.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring Wireless_Data_Transfer.xem4 from package/cfg/Wireless_Data_Transfer_pem4.cfg ...
    generating custom ti.sysbios library makefile ...
    Starting build of library sources ...
    making C:/ti/Workspace_aktuell/Wireless_Data_Transfer/src/sysbios/sysbios.aem4 ...
    gmake[1]: Entering directory `C:/ti/Workspace_aktuell/Wireless_Data_Transfer/src/sysbios'
    gmake[1]: Nothing to be done for `all'.
    gmake[1]: Leaving directory `C:/ti/Workspace_aktuell/Wireless_Data_Transfer/src/sysbios'
    Build of libraries done.
    clem4 package/cfg/Wireless_Data_Transfer_pem4.c ...
    'Finished building: ../Wireless_Data_Transfer.cfg'
    ' '
    'Building file: ../CC3200_LAUNCHXL.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" -mv7M4 --code_state=16 --abi=eabi -me --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/oslib" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/simplelink" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/simplelink/source" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/simplelink/include" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/example/common" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/packages/ti/drivers" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/products/CC3200_driverlib_1.1.0" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/products/CC3200_driverlib_1.1.0/inc" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/products/CC3200_driverlib_1.1.0/driverlib" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/tirtos_simplelink_2_14_03_28_examples" -g --define=ccs --define=cc3200 --define=CCWARE --define=USE_TIRTOS --define=SL_PLATFORM_MULTI_THREADED --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="CC3200_LAUNCHXL.pp" --cmd_file="configPkg/compiler.opt" "../CC3200_LAUNCHXL.c"
    "C:/ti/tirtos_simplelink_2_14_03_28/packages/ti/drivers/gpio/GPIOCC3200.h", line 172: error #20: identifier "GPIO_PinConfig" is undefined
    "C:/ti/tirtos_simplelink_2_14_03_28/packages/ti/drivers/gpio/GPIOCC3200.h", line 175: error #20: identifier "GPIO_CallbackFxn" is undefined
    2 errors detected in the compilation of "../CC3200_LAUNCHXL.c".

    >> Compilation failure
    gmake: *** [CC3200_LAUNCHXL.obj] Error 1
    'Building file: ../Main.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" -mv7M4 --code_state=16 --abi=eabi -me --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/oslib" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/simplelink" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/simplelink/source" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/simplelink/include" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/example/common" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/packages/ti/drivers" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/products/CC3200_driverlib_1.1.0" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/products/CC3200_driverlib_1.1.0/inc" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/products/CC3200_driverlib_1.1.0/driverlib" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/tirtos_simplelink_2_14_03_28_examples" -g --define=ccs --define=cc3200 --define=CCWARE --define=USE_TIRTOS --define=SL_PLATFORM_MULTI_THREADED --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="Main.pp" --cmd_file="configPkg/compiler.opt" "../Main.c"
    'Finished building: ../Main.c'
    ' '
    'Building file: ../pin_mux_config.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" -mv7M4 --code_state=16 --abi=eabi -me --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/oslib" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/simplelink" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/simplelink/source" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/simplelink/include" --include_path="C:/ti/CC3200SDK_1.0.0/cc3200-sdk/example/common" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/packages/ti/drivers" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/products/CC3200_driverlib_1.1.0" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/products/CC3200_driverlib_1.1.0/inc" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/products/CC3200_driverlib_1.1.0/driverlib" --include_path="C:/ti/tirtos_simplelink_2_14_03_28/tirtos_simplelink_2_14_03_28_examples" -g --define=ccs --define=cc3200 --define=CCWARE --define=USE_TIRTOS --define=SL_PLATFORM_MULTI_THREADED --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="pin_mux_config.pp" --cmd_file="configPkg/compiler.opt" "../pin_mux_config.c"
    'Finished building: ../pin_mux_config.c'
    ' '
    gmake: Target `all' not remade because of errors.
    /******************************************************/

    I am currently using the CCS version 6.1.1.00022 . Thank you for your effort !

    Cheers,
    Chris

  • Hi Chris,

    I noticed that you're referencing two different versions of TI-RTOS.  Are you upgrading to a newer TI-RTOS?  (You mentioned version 2.14.01.20, and I see in your build log version tirtos_simplelink_2_14_03_28).


    When you tried building the GPIO interrupt example, did you import and build AFTER installing tirtos_simplelink_2_14_03_28?

    Christopher Hupfer said:
    "C:/ti/tirtos_simplelink_2_14_03_28/packages/ti/drivers/gpio/GPIOCC3200.h", line 172: error #20: identifier "GPIO_PinConfig" is undefined
    "C:/ti/tirtos_simplelink_2_14_03_28/packages/ti/drivers/gpio/GPIOCC3200.h", line 175: error #20: identifier "GPIO_CallbackFxn" is undefined

    I think this may be due to the header file you are including.  You're directly including "GPIOCC3200.h".  You should change your Main.c file to include the generic one (which will include the proper one for you):

    #include <ti/drivers/GPIO.h>

    Also, I see in your config file (*.cfg) that you have:

    var GPIO = xdc.useModule('ti.drivers.GPIO');

    This should be replaced with the following in the latest TI-RTOS:

    var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
    TIRTOS.useGPIO = true;

    Steve

    P.S. If you are still stuck, I recommend that we first try to get the GPIO interrupt example working.  So, if the above doesn't help you, please do these steps:


    1. create a new workspace

    2. ensure that TI-RTOS version tirtos_simplelink_2_14_03_28 is selected in your CCS settings (Window -> Preferences -> Code Composer Studio -> RTSC)

    3. View -> Resource Explorer

    4. search for project "gpiointerrupt_CC3200_LAUNCHXL_TI_CC3200"\

    5. import and build

    6. Zip up and attach entire project (even if it builds/doesn't build), similar to what you did before.  Thanks ...

  • Hey Steve,

    Thank you very much !!! Your suggestions fixed the issue.

    The problem was within the configuration file. As you mentioned, I had to insert "TIRTOS.useGPIO = true;".
    Another problem was that the PinMux file referred to Header files which were not compatible with TIRTOS.

    Cheers,
    Chris