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.

Incopatibile declaration and declaration has no storage or class - strange behavior of CCS 6

Other Parts Discussed in Thread: TM4C123GH6PM

Hello,

i got really odd problem with CCS. I made my functions in copied hello project and i got issue: Description    Resource    Path    Location    Type
#148 declaration is incompatible with "void ConfigureUART(void)" (declared at line 17 of "..\peripherial_config.h")    hello.c    /BOV3    line 49    C/C++ Problem
and also 2nd errorthis declaration has no storage or class specifier

here is main:

//deleted other headers - to many to post
#include "peripherial_config.h"


#ifdef DEBUG
void
__error__(char *pcFilename, uint32_t ui32Line)
{
}
#endif






int
main(void)
{
    //
    // Setup the system clock to run at 50 Mhz from PLL with crystal reference
    //
    SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                    SYSCTL_OSC_MAIN);

    //
    // Enable and configure the GPIO port for the LED operation.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    //GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED);
    GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_6, GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD);
    ROM_GPIODirModeSet(GPIO_PORTB_BASE, GPIO_PIN_6, GPIO_DIR_MODE_OUT);
    ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_6, 0);

    ConfigureUART();  //<- here i got error in main file
    while(1)
    {
        //
        // Turn on the LED
        //
       ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_6, GPIO_PIN_6);

        //
        // Delay for a bit
        //
        SysCtlDelay(2000000);

        //
        // Turn on the LED
        //
       ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_6, 0);
        //
        // Delay for a bit
        //
        SysCtlDelay(2000000);
    }
}

here is peripherial_config.c and header file

#include "peripherial_config.h"
 unsigned int i;
void
ConfigureUART(void)
{
    //
    // Enable the GPIO Peripheral used by the UART.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    //
    // Enable UART0
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    //
    // Configure GPIO Pins for UART mode.
    //
    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Use the internal 16MHz oscillator as the UART clock source.
    //
    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);

    //
    // Initialize the UART for console I/O.
    //
    UARTStdioConfig(0, 115200, 16000000);
}


and header file:

extern void ConfigureUART (void);

  • The posted code looks valid. I am guessing that somewhere, say one of the other files included by main, you have something like a stray ; which causes the rest of the code to be parsed as top-level declarations.

  • Hello, 

    Thank you for response. IT must be sth with ccs because I load other projects examples and add test function to see it works and it does. But when I add to project0 or hello any function which is placed in other file than main I got error. it seems that cos can't see the definition of function. It really makes me angry because I need to convert my project and improve it for yesterday and I cant

  • hello everyone

    I'm very new to CCS and Tiva board, I'm getting Same error that You are getting...

    #148 declaration is incompatible with "void ConfigureUART(void)"

    can you explain Solution steps to it?

    also Can you suggest some link to Create new project with tm4c123gh6pm