usbd_rom_cdc example don't work on my LPCXpresso1347

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

usbd_rom_cdc example don't work on my LPCXpresso1347

622 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elgarbe on Sun Nov 30 09:08:20 MST 2014
I have LPCXpresso v6.1.4_194 IDE, I download
http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc13xx-packages
and
http://www.lpcware.com/content/nxpfile/lpcopen-software-platform-usbd-library-drivers-windows

I start a new workspace and import LPCopen software. I fouse on usbd_rom_cdc example
I compile it and I jus have a warning:
Building file: ../example/src/cdc_main.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_LPCOPEN -DCORE_M3 -I"D:\Mis documentos\DropBox\ARM LPC\GARBE\LPC1347_LPCOpen\lpc_chip_13xx\inc" -I"D:\Mis documentos\DropBox\ARM LPC\GARBE\LPC1347_LPCOpen\lpc_board_nxp_lpcxpresso_1347\inc" -I"D:\Mis documentos\DropBox\ARM LPC\GARBE\LPC1347_LPCOpen\usbd_rom_cdc\example\inc" -I"D:\Mis documentos\DropBox\ARM LPC\GARBE\LPC1347_LPCOpen\lpc_chip_13xx\usbd_rom\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m3 -mthumb -MMD -MP -MF"example/src/cdc_main.d" -MT"example/src/cdc_main.d" -o "example/src/cdc_main.o" "../example/src/cdc_main.c"
../example/src/cdc_main.c: In function 'main':
../example/src/cdc_main.c:181:4: warning: pointer targets in passing argument 1 of 'vcom_write' differ in signedness [-Wpointer-sign]
D:\Mis documentos\DropBox\ARM LPC\GARBE\LPC1347_LPCOpen\usbd_rom_cdc\example\inc/cdc_vcom.h:117:10: note: expected 'uint8_t *' but argument is of type 'char *'
Finished building: ../example/src/cdc_main.c


it's for this line:

vcom_write("Hello World!!\r\n", 15);


So, I start a debug session, press run, plug a USB cable from uUSB on LPCXpresso board (uC side) to my USB PC, windows ask for a driver, so I select the path to "lpcopen-software-platform-usbd-library-drivers-windows", then windows install driver's and I can see a new COM port (COM4).
I open hyperterminal, select com4 and clik on connect.... nothing happend, I expect a "Hello World!!\r\n" message, but nothing.

So I asking myself how do I configure COM4 port? it's 9600 8N1?

am I doing something wrong?

Thk and best regards!
标签 (1)
0 项奖励
回复
1 回复

570 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elgarbe on Tue Dec 02 16:43:05 MST 2014
It's was an OS issue.
I test plug the board on a desktop PC and it's work ok. So I search for OS differenses and I found that first PC is an SP2 windows Xp, and second PC is an SP3 windows PC.
I just install SP3 on this PC and now it's working ok.

But I have a new problem. I made a litle change on the main routine:

while (1) {
/* Check if host has connected and opened the VCOM port */
if ((vcom_connected() != 0) && (prompt == 0)) {
vcom_write((unsigned char *)"Presione 1 para encender LED, 2 para apagarlo\r\n", 47);
prompt = 1;
}
/* If VCOM port is opened echo whatever we receive back to host. */
if (prompt) {
rdCnt = vcom_bread(&g_rxBuff[0], 256);
if (rdCnt) {
vcom_write(&g_rxBuff[0], rdCnt);
if(g_rxBuff[0] == '1'){
vcom_write((unsigned char *)" -> Encendiendo LED\r\n", 21);
Board_LED_Set(0, 1);
}else if(g_rxBuff[0] == '2'){
vcom_write((unsigned char *)" -> Apagando LED\r\n", 18);
Board_LED_Set(0, 0);
}else{
vcom_write((unsigned char *)" -> Comando no reconocido\r\n", 27);
}
}
}
/* Sleep until next IRQ happens */
__WFI();
}
}


I would like to check what key (1 or 2) is pressed on hyperterminal and turn on and off the LED on the LPCXpresso board. And put some message on the terminal.
I run this code and I have first message ("Presione 1 para encender LED, 2 para apagarlo") when I connect to vcom.
Then I press "1" key and led turns on and a "1" is show on hyperterminal. But the text " -> Encendiendo LED" is not showing. The same thing happens when I press 2 or another key.

I stop the debug session and put a brekpoint on line: vcom_write((unsigned char *)" -> Encendiendo LED\r\n", 21); I run the code, I press "1" key and my code stop at breakpoint. I press run again and now the message shows on hyperterminal. I remove the brekpoint, I press "1" key and nothing happend, I just receive the 1 eco on hyperterminal, but I don't receive the text.

Can anybody tell me what is wrong with my code?

Thank and best regards!
0 项奖励
回复