lpcware

Problem compiling a new project for LPC1548

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by mnem on Tue Jul 01 02:45:57 MST 2014
Hi all,

I'm working in my first project with LPCXpresso and I'm experiencing some bad results compiling just an empty project. My MCU is the LPC1548JBD100 and I use the LPCXpresso board LPC11C24 to program it. I have followed the steps indicated in the getting started of the LPCXpresso and had no problems with the example projects as blinky, etc.

Now I want to start my new own project. Then, I start the new project wizard from the quickstart pannel selecting a simple C Project as the template for the new project. Once created the main.c file I have this code:



#include < cr_section_macros.h >

// TODO: insert other include files here

// TODO: insert other definitions and declarations here

int main(void) {

    // TODO: insert code here

    // Force the counter to be placed into memory
    volatile static int i = 0 ;
    // Enter an infinite loop, just incrementing a counter
    while(1) {
        i++ ;
    }
    return 0 ;
}


This simply code compiles without problems. Then I start to include my own code to just set a LED in my PCB. To do that the first thing I do is to include the library gpio_15xx.h from the "lpc_chip_15xx" project of LPCOpen. I understand that lpc_chip_15xx is a superset of the CMSIS for the LPC1500 series and then, I have to use that set as my libraries. Before I include some code I add the path for the inc folder in the lpc_chip_15xx project to allow the LPCXpresso to find the libraries (include files).

The problem appears here. When I include just the line:


// TODO: insert other include files here
#include < gpio_15xx.h >


Adding just that line, i try to compile the project and I have 75 errors all located in the gpio_15xx.h file:


Quote:
Documents/LPCXpresso_7.2.0/workspace/LED6/inc/gpio_15xx.h:48:2: error: unknown type name '__IO'
  __IO uint8_t B[128][32]; /*!< Offset 0x0000: Byte pin registers ports 0 to n; pins PIOn_0 to PIOn_31 */
  ^
Documents/LPCXpresso_7.2.0/workspace/LED6/inc/gpio_15xx.h:48:15: error: expected ':', ',', ';', '}' or '__attribute__' before 'B'
  __IO uint8_t B[128][32]; /*!< Offset 0x0000: Byte pin registers ports 0 to n; pins PIOn_0 to PIOn_31 */
               ^
Documents/LPCXpresso_7.2.0/workspace/LED6/inc/gpio_15xx.h:81:1: error: unknown type name 'STATIC'
STATIC INLINE void Chip_GPIO_WritePortBit(LPC_GPIO_T *pGPIO, uint32_t port, uint8_t pin, bool setting)

Documents/LPCXpresso_7.2.0/workspace/LED6/inc/gpio_15xx.h:81:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
STATIC INLINE void Chip_GPIO_WritePortBit(LPC_GPIO_T *pGPIO, uint32_t port, uint8_t pin, bool setting)
               ^
Documents/LPCXpresso_7.2.0/workspace/LED6/inc/gpio_15xx.h:95:1: error: unknown type name 'STATIC'
STATIC INLINE void Chip_GPIO_SetPinState(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin, bool setting)
^
Documents/LPCXpresso_7.2.0/workspace/LED6/inc/gpio_15xx.h:95:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
STATIC INLINE void Chip_GPIO_SetPinState(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin, bool setting)
               ^
Documents/LPCXpresso_7.2.0/workspace/LED6/inc/gpio_15xx.h:108:1: error: unknown type name 'STATIC'
STATIC INLINE bool Chip_GPIO_ReadPortBit(LPC_GPIO_T *pGPIO, uint32_t port, uint8_t pin)



all the errors are just like these... I need help at this point. I tried to include in my project all the .h files needed by the gpio_15xx.h file but didn't work neither. I can't find any solution in this forum or on internet. What I am doing wrong? Can anybody help me? I know that the LPCXpresso is finding the libraries so the problem I think it must be related with the configuration of the project, somehow. Am I wrong?

Hope you can help me. Thank you very much in advance for your help.


mnem

Outcomes