• AVR Freaks

Hot!PIC32MX795 as USB HID Host to a custom HID device

Author
shiraazz
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2020/07/03 04:24:31
  • Location: 0
  • Status: offline
2020/08/10 04:16:09 (permalink)
4 (1)

PIC32MX795 as USB HID Host to a custom HID device

I am using harmony 2.06
When I use the default TPL config the keyboard works fine (I am using the keyboard example)
the default assigns by class subclass and protocol, if I use TPL by vendor and product the thing just crashes, I have no idea what to do next
 
what could be the cause?
 
I am trying to create a driver for another usb device
#1

6 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 6736
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: PIC32MX795 as USB HID Host to a custom HID device 2020/08/10 09:12:02 (permalink)
    2 (1)
    edit: mis read
    post edited by Jim Nickerson - 2020/08/14 08:16:43
    #2
    shiraazz
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2020/07/03 04:24:31
    • Location: 0
    • Status: offline
    Re: PIC32MX795 as USB HID Host to a custom HID device 2020/08/12 00:28:39 (permalink)
    0
    I am referring to this bit of code int the system_init.c file


    const USB_HOST_TPL_ENTRY USBTPList[ 1 ] =
    {
    //TPL_INTERFACE_CLASS_SUBCLASS_PROTOCOL(0x03, 0x01, 0x01, &hidInitData, USB_HOST_HID_INTERFACE) , //DEFAULT
    // TPL_INTERFACE_CLASS_SUBCLASS_PROTOCOL(0x03, 0x00, 0x00, &hidInitData, USB_HOST_HID_INTERFACE) , //CUSTOM
    TPL_INTERFACE_CLASS_SUBCLASS(0x03, 0x00, &hidInitData, USB_HOST_HID_INTERFACE)
    //TPL_DEVICE_VID_PID(0x461, 0x10, &hidInitData, USB_HOST_HID_INTERFACE) , // KEYBOARD VID PID
    //TPL_DEVICE_ANY(&hidInitData, USB_HOST_HID_INTERFACE), //ANY
    //TPL_DEVICE_VID_PID(0x16D1, 0x0423, &hidInitData, USB_HOST_HID_INTERFACE) , //CUSTOM
    };
     
    Only the default one works (TPL_INTERFACE_CLASS_SUBCLASS_PROTOCOL)

    TPL_DEVICE_VID_PID or TPL_DEVICE_ANY always causes a general exception even for the keyboard

    If I use TPL_INTERFACE_CLASS_SUBCLASS_PROTOCOL for my custom device, the device never attaches even though it says that it found the driver class (debugging messages via serial output)
     
     
    #3
    shiraazz
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2020/07/03 04:24:31
    • Location: 0
    • Status: offline
    Re: PIC32MX795 as USB HID Host to a custom HID device 2020/08/13 23:27:48 (permalink)
    0
    JANickerson
    shiraazz
    I am using harmony 2.06
    When I use the default TPL config the keyboard works fine (I am using the keyboard example)
    the default assigns by class subclass and protocol, if I use TPL by vendor and product the thing just crashes, I have no idea what to do next
     
    what could be the cause?
     
    I am trying to create a driver for another usb device


    I am not sure of what a "TPL" is.
    Maybe the default setup knows how to talk to a known class of device on thee PC ( as a keyboard ) and yours is unknown by the PC.


    I am trying to integrate with a fingerprint scanner
    #4
    shiraazz
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2020/07/03 04:24:31
    • Location: 0
    • Status: offline
    Re: PIC32MX795 as USB HID Host to a custom HID device 2020/09/01 00:21:31 (permalink)
    0
    Is there anyone that can help regarding this?
    #5
    vexorg
    Super Member
    • Total Posts : 84
    • Reward points : 0
    • Joined: 2019/09/27 10:59:40
    • Location: 0
    • Status: online
    Re: PIC32MX795 as USB HID Host to a custom HID device 2020/09/01 01:44:01 (permalink)
    5 (1)
    It's nightmare to figure out. Harmony has examples of preset devices, but no sample of a template or how to write your own driver interface. Made worse by eveything using function pointers that are inlines about 5 levels deep to figure out what's going on.
     
    The TPL thing made no real sense in harmony, in the end I binned harmony, wrote my own USB routines, low level (endpoint data), and then device level that call those.
     
    Like you, my application was a custom usb device, I have the initial handshaking part look for my device only, though devices, interfaces, vid and pid. Then populate the endpoints, and off you go.
     
    The handshaking using the control registers, endpoint0, done piece-wise as the headers are dynmicaly sized. Read 8 or 9 bytes (depending what you're reading), then that has the size of the device data or interface data. It's a horrible structure, it need the whole process done right to get down to the level for the details you need to talk to the device.
    #6
    shiraazz
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2020/07/03 04:24:31
    • Location: 0
    • Status: offline
    Re: PIC32MX795 as USB HID Host to a custom HID device 2020/09/01 01:56:08 (permalink)
    5 (1)
    My boss is already complaining about spending time and resources on this
    #7
    Jump to:
    © 2020 APG vNext Commercial Version 4.5