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-CDCACM set_line_coding command

Hi all.
I'm working on an LPC2378 and I'm trying to manage cdcacm communications. I've taken descriptors values from chapter 16 of the book "Serial Port Complete 2nd edition". Now i'm trying to manage various messages, that is to say
SEND_ENCAPSULATED_COMMAND, especially SET_LINE_CODING and so on...
I'm finding problem with set_line_coding... the first command i've tried.
What i've to reply to the command? what endpoint I've got to use?

Thanks in advance for any help.
Marco Bna'

  • Implementation of SET_LINE_CODING request is too hard for beginners.
    See the examples.

    For Keil MCB2370 board,
    C:\Keil\Arm\Examples\Boards\Keil\MCB2300\USBCDC\

    OR

    LPCUSB
    sourceforge.net/.../lpcusb

    Tsuneo

  • Do I simply need to read incoming data?
    I don't have MCB2300 example... Would you like to send me it, please? Or would you like to tell me where I should find this?

    Thanks a lot.
    Marco Bnà

  • If you have downloaded the Keil tools, then you most probably have it. Just ignore the "examples" part of the path.

    C:\Keil\ARM\Boards\Keil\MCB2300\USBCDC

  • The software has been installed by my chief and he is unable to find it... :(

  • You'll find CDC implementation in LPCUSB.
    LPCUSB will work on LPC23xx with a little change.

    "LPC2xxx USB Writing data to endpoint"
    tech.groups.yahoo.com/.../21325
    "> Jan Thogersen wrote:
    > > I have tried the LPCUSB stack found on sourceforge and it works like a
    > > charm! Only small changes had to be made for it to work on a LPC2368.
    >
    > What changes did you have to make?
    Of cause the routing of pins had to be changed. And to save power the
    lpc23xx has no clock routed to the usb module at reset, so I had to
    route the clock to get access to the registers in the module. Without
    the clock I only get data access abort .

    USBClkCtrl = USBClkCtrl_DEV_CLK_EN;
    while (!( USBClkSt & USBClkSt_DEV_CLK_ON)); // Wait for USB clock to
    come active

    The LPC23xx also has errors in the USB module. The soft_connect and vbus
    detection doesn't work. So I have to poll the vbus and set soft_connect
    pins manually."




    SET_LINE_CODING is carried over control write transfer.
    Maybe, this is the first control write transfer you've ever seen.
    Other requests, either standard or class-specific, are carried by control read or no-data control transfer.
    If you are modifying an existing example like HID and MSC, it doesn't implement even the control write transfer handling. You have to implement this basic part, not just the request handling.
    Then, I said it's better to see an example.

    Tsuneo