VirtualSerialDevice nxpUSBlib Example

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

VirtualSerialDevice nxpUSBlib Example

880 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Arkadyosh on Tue Apr 24 05:46:51 MST 2012
Hi,
I'm trying to run Virtual Serial Device Example on LPC1786 in my development board(I dont have any of supported board LPCXpresso, EA etc). I set BSP configuration to "LPC177x_8x_EAOEMBaseRevA"(it is similar to my board), for CDL I set "LPC177x_8", for nxpUSBlib "LPC177x_8x_Device" and for Example_VirtualSerialDevice LPC177x_8x. For all of this modules I choose target processor for LPC1786. Im want to use USB port 2, so I have to some changes in HAL_USBInit(), and now its look like follow:

  LPC_IOCON->P1_30 &= ~(0x07);
  LPC_IOCON->P1_30 |= 0x02;// vbus

LPC_IOCON->P0_31 &= ~0x07;
        LPC_IOCON->P0_31 |= 0x1; // USB2 D+, USB2 D- is dedicated
        LPC_SC->PCONP |= (1UL<<31);

        LPC_USB->USBClkCtrl = 0x1A;                /* Dev, PortSel, AHB clock enable */
while ((LPC_USB->USBClkSt & 0x1A) != 0x1A);
LPC_USB->OTGStCtrl = 0x3;  // portsel usb u2 port
HAL_Reset();

I use only 3 lines: D2+, D2- and VBus. When I connect board with PC, PC find device as unknown device. When I debug code, and go into DcdIrqHandler() I see that device dont get EndpointSlowInterrupt and Device cant be enumerate by Host, I still got DEV_STAT interrupt, next receive SIEDeviceStatus which value is 0x11 and USB is reset.

I use Red Suite 4 and nxpUSBlib v0.94.
What change in this example I must to put to get correct connection, anybody have some idea?

Regards


Labels (1)
0 Kudos
Reply
3 Replies

843 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kpa on Mon May 07 08:49:13 MST 2012
Hello,

I am also using the nxpUsbLib as a CDC virtual Com.
I use the default Example_VirtualSerial on a LPC11Uxx chip. The echo works fine for single character but when sending chunk of bytes only the first one is received.
Could you please give me some hints about how to correct this behaviour.

Also I have seen that the ROM USB CDC driver seems to be able to echo chunk of bytes. Do you have a support of the LPC11Uxx chip for the ROM USB CDC driver ? If not how could I adapt the LPC1800 ROM driver to the LPC11Uxx ?

Thanks in advance

Kpa
0 Kudos
Reply

843 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Arkadyosh on Wed Apr 25 22:00:35 MST 2012
Hi Tuong,

Thanks for reply. My problem is solved. In the meantime I get second board and there everything is ok, PC recognize device and I get virtual com. That was hardware problem but now I dont know exactly what was wrong.

Regards,
Arkadyosh
0 Kudos
Reply

843 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tuong on Wed Apr 25 02:55:31 MST 2012
Dear Arkadyosh,

I think your pin configuration is ok, it should works. Please check your hardware for 3.3V pull up on D2+, also the link from D2+, D2- from the USB connector to the chip. For example, on the EA OEM base board, in order to run host or device mode on port2, we have to change the JP18, JP19 to host or device position.

With best regards,
Tuong Nguyen
0 Kudos
Reply