Problem compiling a new project for LPC1548

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem compiling a new project for LPC1548

903件の閲覧回数
lpcware
NXP Employee
NXP Employee
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
ラベル(1)
0 件の賞賛
返信
1 返信

655件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Tue Jul 01 02:55:35 MST 2014
If you are using LPCOpen, why don't you just using the LPCOpen wizards to create your new project? This then sets up all the links to the LPCOpen library chip (and board) projects automatically, as well as including code in main() to turn a LED on.

PS - you might want to check this post out though…
http://www.lpcware.com/content/forum/updated-lpc15xx-startup-files-lpcopen-compatibility

HTH!

0 件の賞賛
返信