USBX Hub allows only 2 devices from SSP version above 1.3.0.

Hi,  I have one PE-HMI1 kit , 3 customized boards with SK-S7G2 MCU and USB Hub with 4 Ports. In my case, Our 3 customized boards should communicate with PE-HMI1 kit through USB Hub. 

I have USB Hub program running on PE-HMI1. I have added required stacks(USBX Host Class Hub,USBX Host Class CDC-ACM). In that I set a callback function on USBX on ux  and USBX Pool Memory size 85000.   I have attached my call back function here. 

Problem is: While connecting USB devices(Customized sk-s7g2 board) one by one. the callback function is called for upto 2 devices. on 3rd device connection, the callback is not called. 

I don't know i have missed anything. Help me to resolve this issue. 

UX_HOST_CLASS_CDC_ACM * g_cdc_acm;
UX_HOST_CLASS_CDC_ACM * g_cdc_acm_serial;
UX_HOST_CLASS_CDC_ACM * g_cdc_acm_ans1;
UX_HOST_CLASS_CDC_ACM * g_cdc_acm_ans2;


UINT usb_host_event_callback(ULONG event, UX_HOST_CLASS * class, VOID * instance)
{
   UINT status;
   UX_HOST_CLASS *cdc_acm_host_class;

   /* Check if there is a device insertion. */
   if (UX_DEVICE_INSERTION == event)
  {
    /* Get the storage class. */
    status = ux_host_stack_class_get(_ux_system_host_class_cdc_acm_name, &cdc_acm_host_class);
    if (UX_SUCCESS != status)
   {
     return(status);
    }

    /* Check if we got a CDC ACM class device. */
    if (cdc_acm_host_class == class)
   {
     g_cdc_acm = (UX_HOST_CLASS_CDC_ACM *) instance;

     if (g_cdc_acm->ux_host_class_cdc_acm_device->ux_device_descriptor.idProduct == 0x1111)
    {
      g_cdc_acm_serial = (UX_HOST_CLASS_CDC_ACM *) instance;
    }
    else if (g_cdc_acm->ux_host_class_cdc_acm_device->ux_device_descriptor.idProduct == 0x1112)
    {
     g_cdc_acm_ans1 = (UX_HOST_CLASS_CDC_ACM *) instance;
    }
    else if (g_cdc_acm->ux_host_class_cdc_acm_device->ux_device_descriptor.idProduct == 0x1113)
    {
      g_cdc_acm_ans2 = (UX_HOST_CLASS_CDC_ACM *) instance;
    }
   }
   else
  {
   /* Default case, nothing to do */
   }
 }

/* Check if some device is removed. */
else if(UX_DEVICE_REMOVAL == event)
{
  status = ux_host_stack_class_get(_ux_system_host_class_cdc_acm_name, &cdc_acm_host_class);
  if (UX_SUCCESS != status)
  {
    return(status);
  }

  /* Check if we got a CDC ACM class device. */
  if (cdc_acm_host_class == class)
  {
    g_cdc_acm = (UX_HOST_CLASS_CDC_ACM *) instance;
    if (g_cdc_acm->ux_host_class_cdc_acm_device->ux_device_descriptor.idProduct == 0x1111)
    {
      g_cdc_acm_serial = (UX_HOST_CLASS_CDC_ACM *) NULL;
    }
    else if (g_cdc_acm->ux_host_class_cdc_acm_device->ux_device_descriptor.idProduct == 0x1112)
   {
     g_cdc_acm_ans1 = (UX_HOST_CLASS_CDC_ACM *) NULL;
    }
    else if (g_cdc_acm->ux_host_class_cdc_acm_device->ux_device_descriptor.idProduct == 0x1113)
    {
      g_cdc_acm_ans2 = (UX_HOST_CLASS_CDC_ACM *) NULL;
    }
  }
}
else
{
/* Default case, nothing to do */
}

return(UX_SUCCESS);
}

  • It is probably the fact that the USB peripheral only has 5 bulk pipes :-

     

     A USB CDC ACM device will require 2 bulk pipes, and an interrupt pipe, so only 2 USB CDC ACM devices can be supported.

  • In reply to Jeremy:

    Hi Jeremy,   I just found now. it is SSP problem.   I tried this program in lower ssp version in 1.2.1.  The Program works completely fine. All the USB devices detects and callback function also called.  

    So there is a program with SSP version 1.7.0. 

  • In reply to Prabakaran:

    I tried my USB Hub program in different SSP versions. The SSP versions till 1.3.3, All My USB devices detects with No issue.
    From SSP 1.4.0 to SSP 1.7.0, it detects only 2 USB devices. while I connect 3rd USB device, it says stack corruption problem.
  • In reply to Prabakaran:

    Hi Everyone, Some how the above issue should be solved for me. I can't work on lower ssp versions like SSP below 1.3.0.
    Since my project contains GUIX 5.6.0, It supports SSP 1.7.0 and above.

    I need to make USB hub to detect all of my USB devices in higher SSP versions like 1.7.8.

    Help me to solve this issue.