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.

RTOS/MSP432E401Y: USB Hub Driver class not working

Part Number: MSP432E401Y

Tool/software: TI-RTOS

Greetings:

Someone please take a look at the attached project and tell me what I'm doing wrong. The hub driver doesn't seem to detect any key presses, nor does it respond to plug/unplug events. This was adapted from the USB keyboard host example, which does not include hub support.

Note: The hub driver code included in the MSP432 software library doesn't match it's documentation, which doesn't match the sample code shown in said documentation.

Thank you,

Michael Cress

usb_keyboard_host_MSP_EXP432E401Y_tirtos_gcc.zip

  • Michael,
    Was the USB keyboard example working properly for you? I'll have a look at the project, but I may have to outsource any USB-specific questions to colleagues or other community members :)
    -Bob L.
  • Hi Bob,

    Yes; I was able to plug a keyboard directly into the MSP432 via an OTG cable and successfully exercise the demo application prior to adding the Hub driver bits.


    Michael
  • HI Michael,

    Is this still an issue?  If so can you first verify that your board is working properly by running the usblib example 'usb_keyboard_host'?  At my end, while working on a TI-RTOS based hub example, my board stopped working correctly on anything related to host.   I looked through your code and it looks fine although I am not sure whether you will need a thread for the hub.

    I have attached a NO-RTOS based hub example that I have been working on and it works with a non-hub based keyboard and a mouse. 

    usbhosthub_no-rtos_example

    Regards,

    Arthi

       

  • Hi Arthi,

    Yes; my project is based on the usb_keyboard_host project. I was temporarily pulled away from this task, but I am now back on it as of yesterday.

    I am currently pouring through the TI-related USB code to better understand what all is happening behind the scenes. I'll update this when I have more information as to what is happening with my code.

    Thanks,

    Michael Cress
  • Michael,
    Any update?
    -Bob L.
  • Bob,

    I currently have the nested hubs enumerating devices. I'm still not getting HID events from my keyboard, so I am currently troubleshooting why that is.


    Regards,

    Michael
  • Michael,

    The USB stack was written to handle keyboards without hubs.  So if you are using a keyboard with a hub, that could be the reason you are not getting any events from your keyboard.  

    If you run the example I attached above which uses one powered hub and a keyboard without a hub you will see that the host receives the keyboard events.  

    Maybe you can use that example to connect your second hub (which should not be a keyboard with a hub) and go from there with debugging the code.   

    If you still want to use a keyboard with a hub, then the USB library will have to be updated to appropriately enumerate and notice the keyboard events.

    Regards,

    Arthi

      

  • Arthi,

    Thanks for the info. Currently, the keyboard is enumerating through the nested hub and I am receiving the keyboard HID events as verified using a breakpoint on the keyboard interrupt callback. However, the display driver doesn't seem to work to print out stuff to the terminal. I'm currently trying to figure out why that is.

    Thanks,

    Michael
  • So, it looks like the USB keyboard host example fails to handle the character because the last enumerated item is not the keyboard. Therefore, the value of the "state" variable is USBKBH_UNKNOWN. So, as a hack to get it to work for now, I added the following:



    case USBKBH_UNKNOWN:
    //Michael Cress -- hack to get this to work for a POC demo
    ch = getC(timeout);
    break;


    The output to the UART doesn't seem to work though. All I get is "�_�_�_�_�_�_�_�_�������". These correspond 1:1 to key presses though. I am using "screen" to connect to the USB UART with both 115200 and 9600 baud settings but nothing works yet. Any ideas?


    Thanks,

    Michael

  • Ok, it's working now. I had forgotten the correct syntax for screen. Thanks.

**Attention** This is a public forum