USB CDC Device Send and Receive data

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

USB CDC Device Send and Receive data

1,409 Views
GiulianoLeitede
Contributor II

I'm trying to migrate some code from old FLS USB to KSDK USB stack and I'm facing some troubles to find basic functions like _send and _recv when working with CDC class. The "USB Stack Device RM" on session 3.6.2.6 and 3.6.2.7 saws about "usb_device_cdc_acm_send" and "usb_device_cdc_acm_recv" respectively but I couldn't find those functions anywhere. Also the CDC_VCOM example doesn't make use of them to send and receive data to and from host, instead it writes or reads a buffer and makes use of "USB_DeviceSendRequest" function. Where can I find those _send and _recv functions pointed by documentation?

 

Thanks

Labels (1)
Tags (2)
0 Kudos
Reply
1 Reply

954 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Giuliano Vitor

Seams that USB documentation for SDK 2.0 is not updated. usb_device_cdc_acm_send and usb_device_cdc_acm_recv were used for SDK 1.3, in SDK 2.0 you can find this functions like USB_DeviceCdcAcmRecv and USB_DeviceCdcAcmSend. For example in the cdc_vcom example you can find in the kUSB_DeviceCdcEventSendResponse and kUSB_DeviceCdcEventRecvResponse events something like:

case kUSB_DeviceCdcEventSendResponse:     
{
...
USB_DeviceCdcAcmRecv(handle,
                     USB_CDC_VCOM_BULK_OUT_ENDPOINT,
                     s_currRecvBuf,
                     g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize);‍‍‍‍‍
...
break;
}

case kUSB_DeviceCdcEventRecvResponse:
{
     if ((1 == s_cdcVcom.attach) && (1 == s_cdcVcom.startTransactions))
     {
          s_recvSize = epCbParam->length;
          if (!s_recvSize)
          {
          /* Schedule buffer for next receive event */
          USB_DeviceCdcAcmRecv(handle,
                               USB_CDC_VCOM_BULK_OUT_ENDPOINT,
                               s_currRecvBuf,
                               g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize);
...
break;
}

inside USB_DeviceCdcAcmRecv and USB_DeviceCdcAcmSend they used this USB_DeviceRecvRequest and USB_DeviceSendRequest that you mentioned

Hope this information help you

Best Regards

Jorge Alcala

0 Kudos
Reply