BULK vs Isochronous USB transfers

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

BULK vs Isochronous USB transfers

2,113件の閲覧回数
maxgiammatteo
Contributor I

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

0 件の賞賛
返信
2 返答(返信)

934件の閲覧回数
CarlosCasillas
NXP Employee
NXP Employee

Hi Max,

Although CDC Class specification supports Bulk or Isochronous transfers, the Virtual COM example just uses Bulk transfers. You could modify the low-level USB library, by opening it, which is located at the following path:  

   C:\Freescale\Freescale_MQX_4_0\usb\device\build\

If you are using a Freescale MCU with Full Speed USB controller, you will be able to configure it for up to 64 bytes per packet. Additionally, you could also try the following suggestions for performance improvement:

https://community.freescale.com/message/376735

https://community.freescale.com/message/328893


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

934件の閲覧回数
Wlodek_D_
Senior Contributor II

Hello,

Thank you for your post, however please consider moving it to the right community place (e.g. MQX Software Solutions) to get it visible for active members.

For details please see general advice Where to post a Discussion?

Thank you for using Freescale Community. 

0 件の賞賛
返信