Error in compiling code for USB CDC LPCOpen

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error in compiling code for USB CDC LPCOpen

443 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc2015 on Thu Nov 19 09:45:01 MST 2015
Hi,
When I build example USB CDC project for lpc1347 ("D:\nxp\LPCXpresso_7.9.2_493\lpcxpresso\Examples\LPCOpen\lpcopen_2_05_lpcxpresso_nxp_lpcxpresso_1347\usbd_rom_cdc") I get this error, please help me:


Quote:
[color=#f33]../example/src/cdc_main.c:32:19: fatal error: board.h: No such file or directory[/color]



I use a third party header board with LPC1343 on it so I removed include line for board.h and then these errors occurred:


Quote:
../example/src/cdc_main.c: In function 'USB_IRQHandler':
[color=#f33]../example/src/cdc_main.c:64:32: error: 'LPC_USB' undeclared (first use in this function)[/color]
  uint32_t *addr = (uint32_t *) LPC_USB->EPLISTSTART;
                                ^
../example/src/cdc_main.c:64:32: note: each undeclared identifier is reported only once for each function it appears in
../example/src/cdc_main.c: In function 'main':
../example/src/cdc_main.c:119:2: warning: implicit declaration of function 'SystemCoreClockUpdate' [-Wimplicit-function-declaration]
  SystemCoreClockUpdate();
  ^
../example/src/cdc_main.c:121:2: warning: implicit declaration of function 'Board_Init' [-Wimplicit-function-declaration]
  Board_Init();
  ^
../example/src/cdc_main.c:124:2: warning: implicit declaration of function 'Chip_USB_Init' [-Wimplicit-function-declaration]
  Chip_USB_Init();
  ^
[color=#f33]../example/src/cdc_main.c:127:35: error: 'LPC_ROM_API' undeclared (first use in this function)[/color]
  g_pUsbApi = (const USBD_API_T *) LPC_ROM_API->usbdApiBase;
                                   ^
[color=#f33]../example/src/cdc_main.c:131:27: error: 'LPC_USB0_BASE' undeclared (first use in this function)[/color]
  usb_param.usb_reg_base = LPC_USB0_BASE;
                           ^
../example/src/cdc_main.c:169:4: warning: implicit declaration of function 'NVIC_EnableIRQ' [-Wimplicit-function-declaration]
    NVIC_EnableIRQ(USB0_IRQn);
    ^
[color=#f33]../example/src/cdc_main.c:169:19: error: 'USB0_IRQn' undeclared (first use in this function)[/color]
    NVIC_EnableIRQ(USB0_IRQn);
                   ^



BTW my target is lpc1343 but it seems there is no USB CDC example for it so I look into lpc1347 examples I think this code can be used for 1343 too.
Thanks.
Labels (1)
0 Kudos
1 Reply

315 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Mon Nov 30 06:33:54 MST 2015
LPC1343 has no usb-rom, so your USB sample for LPC1347 will not work on the LPC1343.
For USB to work on the LPC1343 you have to look at the old examples for LPC1343. I don't know if there exist an lpcopen library for the LPC1343.
0 Kudos