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 connection failure when device is in USB Host mode

Hello, Keil users,

I am trying to get a connection between LPC4357 and a U-Blox modem over USB.
First of all I connected the modem to PC, it was recognized correctly, it adds 6 COM ports.

I have looked at examples provided by Keil, and created a simple project where I initialize my MC as USB CDC Host. For the second test I took
another device based on the same MC that is initialized as a USB CDC Device and connected to a USB Host, created at a previous step, the connection between two LPC4357 MC is successful.
The next step was to try the connection with a modem. For debug purposes Event recorder was enabled. The problem is that I am getting PipeReceiveFailed event, of length 15, and error is 64. This error happens when I am trying to get the device status.

I have looked for this error and it is "Transfer handshake was stall".

Are there hints how to prevent this error and to establish the communication correctly?

I attach the screenshot of the event recorder

https://ibb.co/d1RniH

Here is the code listing

        usb_status = USBH_Initialize(0);
        if (usb_status != usbOK)
                printf ("InitFailure!\n");

        while(1){
                con = (USBH_CDC_ACM_GetDeviceStatus(0) == usbOK);
                if (con ) {
                        connected = true;
                        if (con == true) {
                                con_last = true;
                                LED_On(0);

                                USBH_CDC_ACM_Send(0, buff, 3);

                        } else {
                                con_last = false;
                                LED_Off(0);
                                }
                        } else {
                                osDelay(1000);
                        }
        }

Parents
  • Hi Andrii,

    this will not quite work the way you imagined it.
    Such device, as the one you have are called composite devices, and for such device you have to write your own driver, meaning you have to use Custom Class capability of the USB Host.

    Also, a big problem with such device is that they have a lot of functionality implemented as proprietary, meaning there is no standard for such device, but manufacturers decide which interface they are using for what.

    Usually, manufacturer of such a device provides a driver for MS Windows, however to be able to talk to such a device with embedded device you will have to get specification of that device from manufacturer on how this device is driven regarding USB interfaces, and this might be an insurmountable problem.

    Best regards, Milorad

Reply
  • Hi Andrii,

    this will not quite work the way you imagined it.
    Such device, as the one you have are called composite devices, and for such device you have to write your own driver, meaning you have to use Custom Class capability of the USB Host.

    Also, a big problem with such device is that they have a lot of functionality implemented as proprietary, meaning there is no standard for such device, but manufacturers decide which interface they are using for what.

    Usually, manufacturer of such a device provides a driver for MS Windows, however to be able to talk to such a device with embedded device you will have to get specification of that device from manufacturer on how this device is driven regarding USB interfaces, and this might be an insurmountable problem.

    Best regards, Milorad

Children