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.

tivac launchpad programming

Other Parts Discussed in Thread: TM4C123GH6PM

Hi, I am doing programming on the tivac launchpad using the ccs 5.5 and I am getting errors saying that GPIO not 

defined, even after I linked the GPIO driver lib file, its not going away, please advice

  • Hello Srisai

    A code post would be helpful along with the Error log

    Regards

    Amit

  • this is the program

    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/gpio.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"

    int main(void) {

     SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);

        SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

        GPIOPinConfigure(GPIO_PA0_U0RX);
        GPIOPinConfigure(GPIO_PA1_U0TX);
        GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

        UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,
            (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));

        UARTCharPut(UART0_BASE, 'E');
        UARTCharPut(UART0_BASE, 'n');
        UARTCharPut(UART0_BASE, 't');
        UARTCharPut(UART0_BASE, 'e');
        UARTCharPut(UART0_BASE, 'r');
        UARTCharPut(UART0_BASE, ' ');
        UARTCharPut(UART0_BASE, 'T');
        UARTCharPut(UART0_BASE, 'e');
        UARTCharPut(UART0_BASE, 'x');
        UARTCharPut(UART0_BASE, 't');
        UARTCharPut(UART0_BASE, ':');
        UARTCharPut(UART0_BASE, ' ');

        while (1)
        {
         if (UARTCharsAvail(UART0_BASE)) UARTCharPut(UART0_BASE, UARTCharGet(UART0_BASE));
        }

    }

    and this is the error I'm getting

    Description 
    #20 identifier "GPIO_PA0_U0RX" is undefined 
    Description 
    #20 identifier "GPIO_PA1_U0TX" is undefined 

    the error is still there even after I link the GPIO dirlib from the driverlib

    please advice

  • GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);

    Both defines reside w/in pin_map.h - which does not reveal w/in your listing.   Special methods are required to "tell" your IDE the identity of your MCU - so that pin_map.h finds your MCU and those definitions.

  • srisai teja said:

    and this is the error I'm getting

    Description 
    #20 identifier "GPIO_PA0_U0RX" is undefined 
    Description 
    #20 identifier "GPIO_PA1_U0TX" is undefined 

    These defines above are dependent on a preprocessor symbol define "PART_TM4C123GH6PM". I guess you made a new project. You, can verify these preprocessor symbol define at one of the example programs project options->C/C++ for Tiva Launchpad. Here is mine below from the Hello example program.

    -kel