none
USB Printer Driver RRS feed

  • Question

  • I am facing an issue with USB Thermal Printer.

    I am trying to connect USB Printer with my WEC 2013 board. This printer was earlier working fine with old printer's firmware but after printer's firmware update from manufacturer, it has stopped working with iMX6 based WEC 2013 device.

    I am using WEC default printer driver i.e. \WINCE800\public\common\oak\drivers\usb\class\printer by cloning it into platform folder. There is no code change except added logs for debugging.

    On connecting printer (with new firmware) it gets stuck at:

       hTransfer = pUsbPrn->UsbFuncs->lpSetInterface( pUsbPrn->hUsbDevice,
                                                      NULL,
                                                      NULL,
                                                      0, // synchronous
                                                      UsbInterface->Descriptor.bInterfaceNumber,
                                                      UsbInterface->Descriptor.bAlternateSetting );

    On printing logs, i found that old firmware had USB support for 1.1 while new firmware has support for USB 2.0.

    Following are USB descriptor logs:

    OLD Firmware:

    >USBDeviceAttach(0xd788e630, Printer_Class)
    >ParseUsbDescriptors
    USB_DEVICE_DESCRIPTOR:
    ----------------------
    bLength: 0x12
    bDescriptorType: 0x1
    bcdUSB: 0x110
    bDeviceClass: 0x0
    bDeviceSubClass: 0x0
    bDeviceProtocol: 0x0
    bMaxPacketSize0: 0x10
    idVendor: 0x416
    idProduct: 0x5011
    bcdDevice: 0x0
    iManufacturer: 0x1
    iProduct: 0x2
    iSerialNumber: 0x0
    bNumConfigurations: 0x1

    USB_CONFIGURATION_DESCRIPTOR:
    -----------------------------
    bLength: 0x9
    bDescriptorType: 0x2
    wTotalLength: 0x4e
    bNumInterfaces: 0x1
    bConfigurationValue: 0x1
    iConfiguration: 0x0
    bmAttributes: 0x80
    MaxPower: 0x32

    ConfigIndex:0
    USB_INTERFACE_DESCRIPTOR[0]:
    -------------------------
    bLength: 0x9
    bDescriptorType: 0x4
    bInterfaceNumber: 0x0
    bAlternateSetting: 0x0
    bNumEndpoints: 0x1
    bInterfaceClass: 0x7
    bInterfaceSubClass: 0x1
    bInterfaceProtocol: 0x1
    iInterface: 0x0

    *** Found interface @ index: 0 ***
    USB_INTERFACE_DESCRIPTOR[1]:
    -------------------------
    bLength: 0x9
    bDescriptorType: 0x4
    bInterfaceNumber: 0x0
    bAlternateSetting: 0x1
    bNumEndpoints: 0x2
    bInterfaceClass: 0x7
    bInterfaceSubClass: 0x1
    bInterfaceProtocol: 0x2
    iInterface: 0x0

    *** Found interface @ index: 1 ***
    USB_INTERFACE_DESCRIPTOR[2]:
    -------------------------
    bLength: 0x9
    bDescriptorType: 0x4
    bInterfaceNumber: 0x0
    bAlternateSetting: 0x2
    bNumEndpoints: 0x3
    bInterfaceClass: 0xff
    bInterfaceSubClass: 0x0
    bInterfaceProtocol: 0xff
    iInterface: 0x0


    NEW Firmware:

    >USBDeviceAttach(0xcef59ad0, Printer_Class)
    >ParseUsbDescriptors
    USB_DEVICE_DESCRIPTOR:
    ----------------------
    bLength: 0x12
    bDescriptorType: 0x1
    bcdUSB: 0x200
    bDeviceClass: 0x0
    bDeviceSubClass: 0x0
    bDeviceProtocol: 0x0
    bMaxPacketSize0: 0x40
    idVendor: 0x416
    idProduct: 0x5011
    bcdDevice: 0x100
    iManufacturer: 0x1
    iProduct: 0x2
    iSerialNumber: 0x3
    bNumConfigurations: 0x1

    USB_CONFIGURATION_DESCRIPTOR:
    -----------------------------
    bLength: 0x9
    bDescriptorType: 0x2
    wTotalLength: 0x20
    bNumInterfaces: 0x1
    bConfigurationValue: 0x1
    iConfiguration: 0x5
    bmAttributes: 0xc0
    MaxPower: 0x32

    ConfigIndex:0
    USB_INTERFACE_DESCRIPTOR[0]:
    -------------------------
    bLength: 0x9
    bDescriptorType: 0x4
    bInterfaceNumber: 0x0
    bAlternateSetting: 0x0
    bNumEndpoints: 0x2
    bInterfaceClass: 0x7
    bInterfaceSubClass: 0x1
    bInterfaceProtocol: 0x2
    iInterface: 0x4

    *** Found interface @ index: 0 ***

    Please suggest. 

    Thanks,

    Rahul Bhatia


    Wednesday, July 4, 2018 9:49 AM

All replies

  • Hi Rahul,

    Have you provided this information to the printer manufacturer?  It is my understanding that USB 2.0 devices should down shift to support 1.x so you should work with the device manufacturer to establish why it is failing to do so.

    Sincerely,

    IoTGirl

    Wednesday, July 4, 2018 5:41 PM
    Moderator
  • Thanks for reply.

    I have sent e-mail to manufacturer.

    Meanwhile, I have few more queries as i have less experience with USB drivers.

    Both printer works well with windows PC USB 2.0 port. Why this limitation of downshifting to 1.1 for iMX6 board ? is it because of windows default driver ? or USB hardware ?

    Can it be fixed by updating \ modifying WEC 2013 driver code. If yes, can you please guide me to some reference ?

    Thanks for the support.

    Regards,

    Rahul Bhatia

    Thursday, July 5, 2018 6:07 AM
  • Hi Rahul,

    Who is providing your BSP?  You might want to work with them on these questions as it pertains to your platform hardware.

    Note that Compact 2013 does have a USB 2.0 stack and it has had some updates so you may need to update your platform if you don't have fixes like https://support.microsoft.com/en-ca/help/2977886/fix-the-usb-2-0-stack-stops-responding-after-you-connect-a-faulty-devi

    Again, working with your hardware / BSP provider should help.

    Sincerely,

    IoTGirl

    Friday, July 6, 2018 3:42 AM
    Moderator
  • Thanks for your reply.

    I am trying to get more clarity to discuss this with BSP provider.

    USB Printer Driver:

    As I understand, BSP is using WEC 2013 printer class driver without any change.

    As per Microsoft documents: "If you have the correct registry entries set up on the target device and if the USB printer is class-compliant, then the USB subsystem loads the USB printer driver automatically. "

    SoM HW:

    iMX6 reference manual also says HOST is USB 2.0 complaint. Also, SoM works with USB 2.0 mass storage devices correctly. 

    WEC 2013 Update:

    We are using windows update 49 (December 2017) so hotfix must be included in our build.

    Request you to please suggest, if i should approach MS as the error is in printer driver, or manufacturer for faulty device or BSP vendor for providing 2.0 printer support.

    Thanks for your support.

    Friday, July 6, 2018 4:19 AM
  • Your BSP vendor should be able to help you with this.

    Since you're using an iMX6; have you tried our BSP?


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6

    Friday, July 6, 2018 9:17 AM
    Moderator
  • Thanks for reply Michel !

    I always want to use GuruCE BSP because of lots of features and regular updates with fixes. Unfortunately, I don't have complete decision authority to switch to BSP for our product. 

    On this forum too, i always look upto you and few more people like IoTGirl and Bruce for guidance. 

    Can you please guide me this time too with more details of issue. like what could be possible error in setinterface hang with USB printer?  Is it like, default MS printer driver does not support EHCI and i need to develop the same ? 

    Thanks for your support.

    Regards,

    Rahul Bhatia

    Friday, July 6, 2018 9:35 AM
  • Enable all USB debug zones, especially the ones that deal with driver loading. Also enable all USB printer debug zones. Then copy and paste the relevant output here. The USB stack on Windows 2013 is fully EHCI compliant, so it should support your USB printer if it follows the printer class implementation. Is the iMX6 really hanging? Without stepping through the code it's very hard to be able to say anything sensible...


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6

    Friday, July 6, 2018 9:48 AM
    Moderator
  • Hi Rahul,

    Further to Michel's guidance, the Printer OEM should know the difference between the firmware that worked and the new firmware that does not.  As there was no change to the CE device and there was a change to the printer, I would say that the issue is with the printer firmware change and not the CE device.

    I would be sorry for you to put in all this effort and it to be their issue.

    Sincerely,

    IoTGirl

    Sunday, July 8, 2018 3:29 AM
    Moderator
  • Dear Michel, IoTGirl,

    Thanks for your advice. I have tried 2 other manufacturer printers and these worked fine. I will follow up with faulty printer manufacturer and analyze debug zone logs. 

    Thanks for your support.

    Regards,

    Rahul Bhatia

    Tuesday, July 10, 2018 3:31 AM
  • Excellent! Hopefully the manufacturer will stand behind their product for you.  You can mention the two competitors that do work as well. :)
    Wednesday, July 11, 2018 4:27 AM
    Moderator