This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB WCID device

Hello all,

I am trying to make my device WCID by following the instructions here: github.com/.../WCID-Devices

I've implemented my own usb layer on top of the USB Device API provided by TI. In order to handle the special requests issued by usbport.sys I have implemented the GetDescriptor Callback, but when I plug in the device this callback is never called. 

Any suggestions on how to proceed?

Thank you,

Isaac

usbdmti.husbdmti.c

  • Although I do not know all the details of this USB code, I would liek suggest the following to debug.

    (1) List all the events triggered by device attachment. I would add I/O pin toggling in the ISRs so that I can see all the events happening correctly on a scope.
    (2) Normally, a flag will be set in the ISR and CPU in the mainloop will check this flag. I also see people dynamically set a function pointer in the ISR. in the mainloop, CPU executer the function pointed by the function pointer which starts the call back function. You need to figure out how this call back function is triggered and check if this trigger is generated.

    Thanks and regards,

    Zhaohong
  • Thank you for the suggestions,

    I modified the usb library.
    In usbdenum.c, I modified USBDGetDescriptor(), case USB_DTYPE_STRING:

    The original code called USBDCDStallEP0(0) if USBDStringIndexFromRequest() return -1. I changed it so that the user supplied GetDescriptor() callback was used instead. I attached my modified usbdenum.c for reference. After making the change, I recompiled usblib.

    The string descriptor that is required for WCID is located at address 0xEE. If one did not want to modify the usblib, they could just expand their own string descriptor table to have 239 entries (with nulls between the normal string descriptors and the WCID-required string descriptor at 0xEE).

    Isaac

    usbdenum.c