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.

UART studio

Other Parts Discussed in Thread: EK-TM4C123GXL

I am trying to use UART studio to see the output of the of my sensor, but I kept getting this error

"C:/ti/TivaWare_C_Series-2.1.2.111/driverlib/gpio.h", line 141: error #20: identifier "uint32_t" is undefined
"C:/ti/TivaWare_C_Series-2.1.2.111/driverlib/gpio.h", line 141: error #20: identifier "uint8_t" is undefined
"C:/ti/TivaWare_C_Series-2.1.2.111/driverlib/gpio.h", line 142: error #20: identifier "uint32_t" is undefined
"C:/ti/TivaWare_C_Series-2.1.2.111/driverlib/gpio.h", line 143: error #20: identifier "uint32_t" is undefined
"C:/ti/TivaWare_C_Series-2.1.2.111/driverlib/gpio.h", line 143: error #20: identifier "uint32_t" is undefined

Description Resource Path Location Type

#20 identifier "bool" is undefined .ccsproject /ADC_Temp line 153, external location: C:\ti\TivaWare_C_Series-2.1.2.111\driverlib\gpio.h C/C++ Problem
#20 identifier "int32_t" is undefined .ccsproject /ADC_Temp line 157, external location: C:\ti\TivaWare_C_Series-2.1.2.111\driverlib\gpio.h C/C++ Problem
#20 identifier "uint32_t" is undefined .ccsproject /ADC_Temp line 141, external location: C:\ti\TivaWare_C_Series-2.1.2.111\driverlib\gpio.h C/C++ Problem
#20 identifier "uint32_t" is undefined .ccsproject /ADC_Temp line 142, external location: C:\ti\TivaWare_C_Series-2.1.2.111\driverlib\gpio.h C/C++ Problem
#20 identifier "uint32_t" is undefined .ccsproject /ADC_Temp line 143, external location: C:\ti\TivaWare_C_Series-2.1.2.111\driverlib\gpio.h C/C++ Problem

  • Hello Ferz,

    It seems you have to include a librairie which defines these types. Usually it's "#include <stdint.h>"

    Regards,
    John

  • Hello Ferz,

    Or include "inc/hw_types.h" in the start of the list of includes.
  • Hello John,

    I wrote that down already, but still it's error.
  • Hi Amit,

    i include that too already, still I keep getting the error.
  • Hello Ferz

    Your CCS project would be useful for inspection.

    Regards
    Amit
  • Hello Amit,

    so this is the error that I found:

    Description Resource Path Location Type
    #10010 errors encountered during linking; "ADC_Temp.out" not built ADC_Temp C/C++ Problem
    #10056 symbol "UARTgetc" redefined: first defined in "./main.obj"; redefined in "./uartstdio.obj" ADC_Temp C/C++ Problem
    #10056 symbol "UARTgets" redefined: first defined in "./main.obj"; redefined in "./uartstdio.obj" ADC_Temp C/C++ Problem
    #10056 symbol "UARTprintf" redefined: first defined in "./main.obj"; redefined in "./uartstdio.obj" ADC_Temp C/C++ Problem
    #10056 symbol "UARTStdioConfig" redefined: first defined in "./main.obj"; redefined in "./uartstdio.obj" ADC_Temp C/C++ Problem
    #10056 symbol "UARTvprintf" redefined: first defined in "./main.obj"; redefined in "./uartstdio.obj" ADC_Temp C/C++ Problem
    #10056 symbol "UARTwrite" redefined: first defined in "./main.obj"; redefined in "./uartstdio.obj" ADC_Temp C/C++ Problem
    <a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/10234.html">#10234-D</a> unresolved symbols remain ADC_Temp C/C++ Problem
    unresolved symbol UARTStdioInit, first referenced in ./main.obj ADC_Temp C/C++ Problem

    And here is the code:

    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/hw_types.h"
    #include "inc/hw_ints.h"
    #include "inc/hw_memmap.h"
    #include "driverlib/gpio.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    #include "utils/uartstdio.h"
    #include "utils/uartstdio.c"


    void UARTIntHandler(void)
    {
    unsigned long ulStatus;
    unsigned char received_character;
    ulStatus = UARTIntStatus(UART0_BASE, true); //get interrupt status
    UARTIntClear(UART0_BASE, ulStatus); //clear the asserted interrupts
    while(UARTCharsAvail(UART0_BASE)) //loop while there are characters in the receive FIFO
    {
    received_character = UARTCharGet(UART0_BASE);
    UARTCharPutNonBlocking(UART0_BASE, received_character); //echo character
    if (received_character == 13) UARTCharPutNonBlocking(UART0_BASE, 10); //if CR received,
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, GPIO_PIN_2); //blink LED
    SysCtlDelay(SysCtlClockGet() / (1000 * 3)); //delay ~1 msec
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0); //turn off LED
    }
    }

    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);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2);
    UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
    UARTFIFOLevelSet(UART0_BASE, UART_FIFO_TX4_8, UART_FIFO_RX4_8);
    UARTFIFOEnable(UART0_BASE);
    IntMasterEnable();
    IntEnable(INT_UART0);
    UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
    UARTStdioInit(0);
    UARTprintf("\033[2J\033[HEnter Text: ");
    while (1)
    {

    }
    }

    Thanks,
    Ferry
  • Hello Ferry,

    Not just the main.c but the CCS project (zip it and attach it to the post)

    Regards
    Amit
  • Hello Amit,

    Here the zip file.

    Thanks,
    Ferry
  • Hello Ferry,

    Golden rule. Always use a working project to derive a new project

    1. Defines TARGET_IS_TM4C123_RB1 and UART_BUFFERED is missing in your project
    2. In the main.c file the include has been added "utils/uartstdio.c" (This is the bulk of the problem)
    3. UARTStdioInit(0) has to be replaced with UARTStdioConfig(0, 115200, 16000000); for UARTprintf to work.....
    4. Why configure UART0 2 times??????

    Again: Reference a working project like D:\ti\TivaWare_C_Series-2.1.2.111\examples\boards\ek-tm4c123gxl\timers

    Regards
    Amit
  • Hello Amit,

    Thanks for your help and it works out for the previous code. Now I have encounter new problem. There is no error in my code and when I ran putty and run the code the value is not shown up at putty. I upload the file in case that you need it.

    Thanks,

    Ferry 2480.UART.zip

  • There is no error in my code and when I ran putty and run the code the value is not shown up at putty.

    That's not much of an error description. The way from the UART transmit register to the PC running putty is long.

    Did you verify that there is a RS232 signal on the transmission line ?

    Are the settings correct (baudrate/parity/start-stop bits) ?

    Is the hardware correct ? A 3.3V GPIO output will not work.

    And BTW:

    There is no error in my code...
    That only means there no syntax errors that make your compiler barf. The code can still fail catastrophically on the first instructions when running on the actual hardware.

  • Hello Ferz,

    Where is InitConsole called in the program?

    Regards
    Amit