AnsweredAssumed Answered

BULK vs Isochronous USB transfers

Question asked by Max Giammatteo on Apr 10, 2014
Latest reply on Apr 15, 2014 by CarlosCasillas

Hi,

 

I am new to freescale and quite new to embedded programming. At work we are trying to implement serialUSB communication between a main board running QNX and using devc-serusb (the serial USB driver provided by qnx) and two devices runnign MQX and using a protocol converter to implement serial-to-USB conversion (this is based on the example provided in section 3 of AN4345: Using MQX Communication...." provided on the freescale website.

 

We are having performance issues at the moment which appear as soon as we try to write and read to both devices and we suspect that the Bulk transfers we are using might be part of the issue.

 

We are using a CDC_CONFIG_STRUCT lCDCConfig on the MQX side to define the devices endpoints.

More specifically we are setting:

 

lCDCConfig.cic_send_endpoint = CIC_NOTIF_ENDPOINT;

    lCDCConfig.dic_send_endpoint = DIC_BULK_IN_ENDPOINT;

    lCDCConfig.dic_recv_endpoint = DIC_BULK_OUT_ENDPOINT;

 

My trivial question is whether it would be possible to define those members of the CDC_CONFIG_STRUCT so that we use Isochronous transfers rather than Bulk transfers I don't seem to find any hints on the interent about this).

 

Is there any other essential settings on the structure that would help besides what we are already doing?

 

If USB_CDC only implements Bulk transfers,  is there anything else we could use instead for serial-USB?

 

uint_8 USBCDC_Init(void)

{

    uint_8 lError = 0;

    CDC_CONFIG_STRUCT lCDCConfig;

    USB_CLASS_CDC_ENDPOINT * lpEndPointPtr;

 

    gRecvBuff = _mem_alloc_uncached(DATA_BUFF_SIZE);

 

    lpEndPointPtr = USB_mem_alloc_zero(sizeof(USB_CLASS_CDC_ENDPOINT)*CDC_DESC_ENDPOINT_COUNT);

    lCDCConfig.comm_feature_data_size = COMM_FEATURE_DATA_SIZE;

    lCDCConfig.usb_ep_data = &usb_desc_ep;

    lCDCConfig.desc_endpoint_cnt = CDC_DESC_ENDPOINT_COUNT;

    lCDCConfig.cdc_class_cb.callback = USB_App_Callback;

    lCDCConfig.cdc_class_cb.arg = &gHandle;

    lCDCConfig.vendor_req_callback.callback = NULL;

    lCDCConfig.vendor_req_callback.arg = NULL;

    lCDCConfig.param_callback.callback = USB_Notif_Callback;

    lCDCConfig.param_callback.arg = &gHandle;

    lCDCConfig.desc_callback_ptr =  &desc_callback;

    lCDCConfig.ep = lpEndPointPtr;

    lCDCConfig.cic_send_endpoint = CIC_NOTIF_ENDPOINT;

    lCDCConfig.dic_send_endpoint = DIC_BULK_IN_ENDPOINT;

    lCDCConfig.dic_recv_endpoint = DIC_BULK_OUT_ENDPOINT;

 

    if (MQX_OK != _usb_device_driver_install(USBCFG_DEFAULT_DEVICE_CONTROLLER))

    {

        printf("Driver could not be installed\n");

        lError = 1;

    }

 

    // Initialize Variables

    memset(gDataString, 0, sizeof(gDataString));

    memset(gRecvBuff, 0, DATA_BUFF_SIZE);

 

    // Initialize the USB interface

    gHandle = USB_Class_CDC_Init(&lCDCConfig);

 

    _lwsem_create(&gDataSentSemaphore,1);

    _lwsem_create(&gDataRecvSemaphore,0);

 

    /*while((gStartApp != TRUE) && (gStartTransactions != TRUE))

    {}*/

 

    return lError;

}

 

MANY THANKS for your help

Max

Outcomes