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/CC2650MODA: The GPIO driver for CC2650EM doesn't seem to work. Even the default PWM example with latest RTOS doesn't do anything other than glowing the LED.

Part Number: CC2650MODA
Other Parts Discussed in Thread: SYSBIOS, CC2650

Tool/software: TI-RTOS

I am running the CC2650MODA in standalone mode and using the CC2650EM examples since both of them have the 5XD pin compatibility. Using the PIN drivers i am able to blink the LED however when i run the default PWM example code(which uses the GPIO driver which itself seems to be an easier abstraction layer over the PIN driver?), it doesn't actually do anything. Just to test if the GPIO driver is working i modified the PWM code to blink an LED using GPIO_toggle(IOID_9); however the LED doesn't blink at all(it just glows). Following is the changed part of the PWM code -

void blink(){
    GPIO_toggle(IOID_9);
    Task_sleep(500000/Clock_tickPeriod);
    GPIO_toggle(IOID_9);
    Task_sleep(500000/Clock_tickPeriod);
}
Void pwmLEDFxn(){
    /* Loop forever incrementing the PWM duty */
    while (1) {
        blink();
        Task_sleep(1000);
    }
}

I also included the #include <ti/sysbios/knl/Clock.h> header, however the project builds and even runs properly , no errors whatsoever , it just doesn't perform what its supposed to.

Any idea what is happening?

I referred to this issue which seems to the same, but they eventually end up using PIN driver. I would like to work with the abstraction that GPIO drivers provide. Please help with any tips.

I also couldn't find the GPIO driver's documentation in the RTOS documentation which does have documentation for the PIN driver though. The only way to know what GPIO Driver's functions do is to read the GPIO.h file. Is the driver still under development?

  • Hi Shantam,

    The GPIO driver takes the index of the IO defined int he GPIO configuration table (found in the board file, CC2650_LAUNCHXL.c/h). You may not use it as you do, specifying the actual IO ID number (in th ePIN driver you do it like this).

    You should be able to use the GPIO driver documentation that is available in the other SDKs (should be valid in most cases):

    dev.ti.com/.../_g_p_i_o_8h.html
  • Hi ,

    So i opened up the CC2650DK_5XD.h and CC2650DK_5XD.c in the project (as seen in the following pic)

    and i changed the code in CC2650DK_5XD.c as follows (commenting all the pins except the LED pin where i have my LED attached) -

    But in this case the LED didn't even light up. So i changed it to below (basically changing PIN_GPIO_LOW to PIN_GPIO_HIGH) and the LED lit up however it didn't blink like its supposed to because of the GPIO_toggle functions i have used in the RTOS task-

    Are these the correct edits? It seems like its following only the initialization part, why is it not able to toggle the LED? Any idea why the LED is still NOT blinking using the GPIO driver?

  • Hi Shantam,

    What you are changing is the initial PIN configuration performed during the general board initialization. Note that this is a PIN driver struct and not related to the GPIO drive which you aim to use, you should be looking for the "GPIO_PinConfig" structure.

    Also note that in the CC2650DK_5XD.h file, the "**_**_GPIOName" structure need to have entries that match with the corresponding index in the "GPIO_PinConfig" structure. For example if you LED is the first entry in the "GPIO_PinConfig" structure, the first entry in "**_**_GPIOName" should be for this GPIO. The enum is what you use to address the pin later in the API as this should correspond to the index in the "GPIO_PinConfig" structure.