This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB Composite VCOM Speed

Dear all,
Thanks a lot for every consecutive help i get from this forum and a special thanks to Tsuneo.

I downloaded VCOM example program from keil but that doesn't fits to my requirement.

The code doesn't work if I transmit the data as soon as i receive the IN interrupt.

I want to transmit 64bytes in 1 ms. i tried changing the usbdesc.c but it doesn't transmits the data at this rate and makes the PC to go hang.

My minimum requirement is to tranmsit 30KBytes/sec.

I highly appreciate your help.

Parents
  • "Well, even by doing that the PC comes to hang."
    "I think the PC side USB driver for VCOM is not able to handle the data and goes to hang."

    Test your firmware with a terminal app.

    RealTerm
    realterm.sourceforge.net/

    DockLight
    http://www.docklight.de/

    etc.
    wiki.oliverbetz.de/.../TerminalPrograms

    If your host app is coded in VB, and it uses OnComm with RThreshold, you may need to send extra ZLP from the device side. This problem of IOCTL_SERIAL_WAIT_ON_MASK was seen on usbser.sys on this topic in USB-IF.

    "USB CDC USBSER.SYS Buffering delay?"
    www.usb.org/.../viewtopic.php

    It is also applied to the NXP device driver. In the first place, the source code for the serial driver on the WinDDK has the problem on IOCTL_SERIAL_WAIT_ON_MASK handling. Then, any example driver which follows WinDDK has the same problem.

    Anyway, the ZLP just after the 64 bytes IN transfer is required, regardless of this problem.

    Tsuneo

Reply
  • "Well, even by doing that the PC comes to hang."
    "I think the PC side USB driver for VCOM is not able to handle the data and goes to hang."

    Test your firmware with a terminal app.

    RealTerm
    realterm.sourceforge.net/

    DockLight
    http://www.docklight.de/

    etc.
    wiki.oliverbetz.de/.../TerminalPrograms

    If your host app is coded in VB, and it uses OnComm with RThreshold, you may need to send extra ZLP from the device side. This problem of IOCTL_SERIAL_WAIT_ON_MASK was seen on usbser.sys on this topic in USB-IF.

    "USB CDC USBSER.SYS Buffering delay?"
    www.usb.org/.../viewtopic.php

    It is also applied to the NXP device driver. In the first place, the source code for the serial driver on the WinDDK has the problem on IOCTL_SERIAL_WAIT_ON_MASK handling. Then, any example driver which follows WinDDK has the same problem.

    Anyway, the ZLP just after the 64 bytes IN transfer is required, regardless of this problem.

    Tsuneo

Children
  • Hi Tsuneo,

    Thats a great help.

    Right now i am using windows Hyper Terminal program.

    It would be of great help if you can also guide me for OUT messges.

  • Hi Tsuneo,

    I took the code from www.standardics.nxp.com/.../code.lpc214x.usb.zip and to my surprize, the raw code itself is not working for reception.

    I made that NO_UART_CABLE to 1. and when i open the the COM(X) and type anything there, PC comes to hang. I tried this with many PCs, same thing happens.

    I don't think there is any problem in the code. Can you download usb.zip from the same location and just make a run i you too are getting the same problem?

    I want to add one more thing. I am not using MCB2140 board but it is my custom design similar to MCB2140 and there are no problems with the board.

    i will highly appreciate your help

  • Hi all,

    Things started working now. All problem was because of a corrupted usbser.sys.

    I downloaded the hotfix freshly from microsoft and everything started working fine.

    Thanks a lot to all of you specially Tsuneo.

    Regard!
    Kamal

  • "All problem was because of a corrupted usbser.sys."

    ???
    The NXP example (AN10420) has a vendor specific interfaces, and it works with the custom device driver attached to the zip file.

    Windows usbser.sys works with a CDC-ACM device.
    Did you modify the NXP example to a CDC implementation?

    Anyway, MS starts to distribute Win XP SP3 over Windows Update.
    forums.microsoft.com/.../ShowPost.aspx

    It has newer versions (usbser.sys: 5.1.2600.5508, usbccgp.sys: 5.1.2600.5512) than the hotfix.

    This version of usbser.sys and usbccgp.sys allow composite device of CDC using IAD (Interface Association Descriptor), successfully. I'm testing it now. Maybe, a composite device with multiple CDC will also work on this version, which has been proved on Vista SP1.

    Tsuneo

  • Even i was thinking this..

    I tested the example in many PCs which doesn't have usbser.sys file at all. I was getting problem in all those PCs. In one XP PC usbser.sys was there but it didn't worked with that too. I thought of using windows cdc driver and for that i downloaded usbser.sys. I made it work with cdc driver too. Just for fun again i tried flashing the nxp code and this time it started working... Now it is working fine in the machines where usbser.sys is installed. I don't know the link between nxp vendor specific driver and usbser.sys but it worked.

    Don't know how....

    Kamal

  • Hello.

    First of all, I want to say that I don't know if this is the right forum to do the question, but after days searching in the web, reading papers and changing the code, I'll try to explain my dude here.

    I'm programming a device, with a USB communication in order to communicate with PC. I use an ATmega1281 with MAX3420 as USB controller. I get the windows recognize the device as COM Port...but I can only send or only receive data. If I try to set number of endpoints to 2 in the Data Class Interface descriptor, windows return an error (code 10), and can't initialize the device.
    Here I show the descriptors I use. Thank you for your time in advance!

    const unsigned char CD[]=
    // CONFIGURATION Descriptor {0x09, // bLength 0x02, // bDescriptorType = Config 67,0x00, // wTotalLength(L/H) = Nº Bytes (67[0x43}) (Sin cabeceras 48[0x30]) 0x4300 0x02, // bNumInterfaces = 2 0x01, // bConfigValue 0x00, // iConfiguration 0xC0, // bmAttributes. b7=1 b6=NO self-powered b5=RWU supported (1 0 1 0 0 0 0 0) 0x32, // MaxPower is 100 ma

    // INTERFACE Descriptor 0x09, // length = 9 0x04, // type = IF 0x00, // InterFace Number = 0 0x00, // bAlternate Setting 0x01, // bNum Endpoints = 1 IN 0x02, // bInterfaceClass = 2 Communication 0x02, // bInterfaceSubClass = 2 0x01, // bInterfaceProtocol =1 (SubClass ACM=Abstract Control Mode, InterfaceProtocol=V.25ter, common AT commands) 0x00, // iInterface

    // Header Functional Descriptor (marks beginning of the concatenated set of Functional Descriptors) 0x05, // bFunctionLength, Descriptor size in bytes --[18] 0x24, // bDescriptorType, CS_INTERFACE 0x00, // bDescriptorSubtype, Header Functional Descriptor 0x10,0x01, // bcdCDC, CDC specification release number in BCD format (1,1)

    // Abstract Control Management Functional Descriptor 0x04, // bDescriptorLength, Descriptor size in bytes 0x24, // bDescriptorType, CS_INTERFACE 0x02, // bDescriptorSubtype, Abstract Control Management Functional Descriptor 0x06, // bmCapabilities, Support for the GET/SET_LINE_CODING, BREAK & SET_CONTROL_LINE_STATE (2->6)

    // Union Functional Descriptor 0x05, // bFunctionLength, Descriptor size in bytes 0x24, // bDescriptorType, CS_INTERFACE 0x06, // bDescriptorSubtype, Union Functional Descriptor 0x00, // bMasterInterface, The controlling interface for the union (bInterfaceNumber of a Communication or Data Class interface in this configuration) 0x01, // bSlaveInterface0, The controlled interace in the union (bInterfaceNumber of an interface in this configuration)

    // Call Management Functional Descriptor 0x05, // bFunctionLength, Descriptor size in bytes 0x24, // bDescriptorType, CS_INTERFACE 0x01, // bDescriptorSubtype, Call Management Functional Descriptor 0x03, // bmCapabilities, Device doesn't call management itself (0->3) 0x01, // bDataInterface, Interface used for call management

    // Endpoint Descriptor EP3-IN 0x07, // bLength 0x05, // bDescriptorType (Endpoint) 0x83, // bEndpointAddress (EP3 IN) 0x03, // bmAttributes (interrupt = 3) 0x40,0x00, // wMaxPacketSize (8->64[0x0040]) 0x02, // bInterval, Maximum latency

    // INTERFACE Descriptor 0x09, // length = 9 --[44] 0x04, // type = IF 0x01, // InterFace Number = 1 0x00, // bAlternate Setting 0x02, // bNum Endpoints = 2 (IN&OUT) 0x0A, // bInterfaceClass = A (Data) 0x00,0x00, // bInterfaceSubClass, bInterfaceProtocol (SubClass ACM=Abstract Control Mode, InterfaceProtocol=V.25ter, common AT commands) 0x00, // iInterface

    // Endpoint Descriptor EP2-IN 0x07, // bLength 0x05, // bDescriptorType (Endpoint) 0x82, // bEndpointAddress (EP2-IN) 0x02, // bmAttributes (bulk = 2) 0x40,0x00, // wMaxPacketSize (64[0x40]) 0x00, // bInterval

    // Endpoint Descriptor EP1-OUT 0x07, // bLength 0x05, // bDescriptorType (Endpoint) 0x01, // bEndpointAddress (EP1-OUT) 0x02, // bmAttributes (bulk = 2) 0x40,0x00, // wMaxPacketSize (64[0x40]) 0x00, // bInterval
    };

  • Start a new thread, and post your descriptors as code, so they are readable.

  • I have an appalling experience with usbser.sys. It is by far the worst driver I ever encounter! I kept on asking myself: "why does microsoft even support USB if they do not implement the protocol fully?!". blue screens on win2k but not on XP (which was not fully functional either!), program failures, you name it. a total disaster!