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.

REG: Identifier un defined error

Other Parts Discussed in Thread: TM4C123GH6PM

Hello

I am using CCS V6 for TM4C123GH6PM controller, now i wrote a code for UART communication and all initialization stps as per API function, but now i am getting a so many error like this 

Description Resource Path Location Type
#20 identifier "GPIO_PA0_U0RX" is undefined main.c

#20 identifier "GPIO_PA1_U0TX" is undefined main.c 

but i am included below header files in my code but still now i have the same problem.

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

  • After i am defined GPIO Port/Pin Mapping Definitions in new header(Pin_map.h) file the last post error solved, but i want to know one thing its already defined in #include "driverlib/pin_map.h" then why the error came.

    now i am getting error like

    Description Resource Path Location Type
    unresolved symbol UARTprintf, first referenced in ./main.obj

    unresolved symbol UARTStdioConfig, first referenced in ./main.obj

    Plz tell why these errors are occurred. I am shown below my code and error also.


    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/hw_memmap.h"
    #include "inc/tm4c123gh6pm.h"
    #include "driverlib/gpio.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/ssi.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    #include "utils/uartstdio.h"

    #include "Pin_map.h"

    #define NUM_SSI_DATA 3

    void InitConsole(void)
    {
    // Enable GPIO port A which is used for UART0 pins.
    // TODO: change this to whichever GPIO port you are using.
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    // Configure the pin muxing for UART0 functions on port A0 and A1.
    // This step is not necessary if your part does not support pin muxing.
    // TODO: change this to select the port/pin you are using.
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);
    // Enable UART0 so that we can configure the clock.
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    // Use the internal 16MHz oscillator as the UART clock source.
    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
    // Select the alternate (UART) function for these pins.
    // TODO: change this to select the port/pin you are using.
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    // Initialize the UART for console I/O.
    UARTStdioConfig(0, 115200, 16000000);
    }

    int main(void)
    {
    uint32_t pui32DataTx[NUM_SSI_DATA];
    uint32_t pui32DataRx[NUM_SSI_DATA];
    uint32_t ui32Index;

    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
    SYSCTL_XTAL_16MHZ);
    InitConsole();

    //
    // Display the setup on the console.
    //
    UARTprintf("SSI ->\n");
    UARTprintf(" Mode: SPI\n");
    UARTprintf(" Data: 8-bit\n\n");
    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    GPIOPinConfigure(GPIO_PA2_SSI0CLK);
    GPIOPinConfigure(GPIO_PA3_SSI0FSS);
    GPIOPinConfigure(GPIO_PA4_SSI0RX);
    GPIOPinConfigure(GPIO_PA5_SSI0TX);

    GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 |
    GPIO_PIN_2);
    SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,
    SSI_MODE_MASTER, 1000000, 8);
    SSIEnable(SSI0_BASE);

    while(SSIDataGetNonBlocking(SSI0_BASE, &pui32DataRx[0]))
    {
    }
    pui32DataTx[0] = 's';
    pui32DataTx[1] = 'p';
    pui32DataTx[2] = 'i';
    // Display indication that the SSI is transmitting data.
    UARTprintf("Sent:\n ");
    // Send 3 bytes of data.
    for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
    {
    // Display the data that SSI is transferring.
    UARTprintf("'%c' ", pui32DataTx[ui32Index]);

    SSIDataPut(SSI0_BASE, pui32DataTx[ui32Index]);
    }
    while(SSIBusy(SSI0_BASE))
    {
    }
    // Display indication that the SSI is receiving data.
    UARTprintf("\nReceived:\n ");
    // Receive 3 bytes of data.
    for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
    {
    SSIDataGet(SSI0_BASE, &pui32DataRx[ui32Index]);
    pui32DataRx[ui32Index] &= 0x00FF;
    UARTprintf("'%c' ", pui32DataRx[ui32Index]);
    }
    return(0);
    }

  • Hello Yuvaraj,

    Do resolve the error for the Pin Name, you need to add the define PART_TM4C123GH6PM during compile time.

    Regards
    Amit
  • Hello Yuvaraj,

    You need to add the file uartstdio.c in the compilation flow by using Import option.

    I would suggest using a known UART project as a starting point.

    Regards
    Amit
  • Hello Amit

                         Plz tell Where i could add PART_TM4C123GH6PM during compile time.

     

    With Regards

    Yuvaraj

  • Hello Yuvaraj,

    In Properties -> Build -> ARM Compiler -> Predefined Symbols

    Regards
    Amit
  • Thank you AMit...