USB demo on TWRK64F120M with HUB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB demo on TWRK64F120M with HUB

775 Views
eduardrazumovsk
Contributor III

Hello,

Does the demo keyboard should work also with HUB ?

When connecting directly the keyboard to K64 USB port it works everything OK (can see keyboard using terminal thru UART)

Now, I have connected the K64 USB to a HUB (Microchip USB2422) and a keyboard to the HUB downstream USB port.

The USB2422 HUB have "Power_EN" ports to enable power to it's downstream ports

My problem is that there is no "Power_EN" from the HUB to its downstream ports in that case

I have tried other HOST - connected the HUB upstream port to a PC (instead of the K64) - in that case everything works great - The HUB enables power to downstream ports

What can be the difference between the K64 and the PC ?

Thanks

Eduard

0 Kudos
3 Replies

516 Views
egoodii
Senior Contributor III

The 'demo' probably doesn't have the 'HUB' class enabled.

But note of course that once you have a 'hub', the stack must be ready to accept multiple simultaneous devices, even of the same 'class'.  The demo may not be set up for THAT either.

Try uTasker.

0 Kudos

516 Views
eduardrazumovsk
Contributor III

Hi

Thanks for the reply

I also assumed that the demo doesn't support HUB, but wasn't sure... How can I know for sure ?

Regarding the multiple simultaneous devices - I don't think that the stack have to support it - It is the HUBs job - the HUB should do it and upstream the data on the individual K64 USB port

Thanks

Eduard

0 Kudos

516 Views
egoodii
Senior Contributor III

I don't know where your 'demo' came from, compared to the 'Freescale USB stack' I am using, but in usb_classes.c is:

/* here hub is considered as device from host point of view */

#ifdef USBCLASS_INC_HUB

    #include "usb_host_hub.h"

#endif

and, within USB_CLASS_MAP_CONST CLASS_MAP class_interface_map[] =

...

#ifdef USBCLASS_INC_HUB

   {

      usb_class_hub_init,

      sizeof(USB_HUB_CLASS_INTF_STRUCT),

      USB_CLASS_HUB,

      USB_SUBCLASS_HUB_NONE,

      USB_PROTOCOL_HUB_FS,

      0xFF, 0x00, 0x00

   },

#endif

...

and of course the 'usb_hub_host' driver files to go with those.

As for 'multiple', I'm not convinced that the stack I am looking at has the 'hooks' so that EACH 'callback' (for instance) on a HID instantiation references a different handle-indexed structure so that 'multiples' could be kept entirely isolated.  If your stack looks so sub-indexed, then you are one step ahead!

0 Kudos