USB CDC host issue

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

USB CDC host issue

584 Views
starlord1205
Contributor I

Hi All,

I am currently trying to setup the usb cdc host on IMXRT1170. I have found one example but I am unable to figure out the working.  So what I understood from it is it gets the data from terminal and send it on the usb and vice versa. Now I dont want 32 byte limit. I just want to send and recieve data through code only. So to send data I am using below call:

USB_HostCdcDataSend(g_cdc.classHandle,"This is string\r\n",strlen("This is string\r\n"),
USB_HostCdcDataOutCallback, &g_cdc);

But for recieve USB_HostCdcDataInCallback should get called irrespective. 

 

if you see below function there is recieve call first so it only triggers when I am sending the data.

void USB_HostCdcDataOutCallback(void *param, uint8_t *data, uint32_t dataLength, usb_status_t status)
{
freeNodeToQueue(&g_EmptyQueue, g_UsbSendNode);

g_CurrentUsbRecvNode = getNodeFromQueue(&g_EmptySendQueue);
if (g_CurrentUsbRecvNode)
{
g_CurrentUsbRecvNode->next = NULL;
g_CurrentUsbRecvNode->dataLength = dataLength;
USB_HostCdcDataRecv(g_cdc.classHandle, (uint8_t *)&g_CurrentUsbRecvNode->buffer[0],
g_CurrentUsbRecvNode->dataLength, USB_HostCdcDataInCallback, &g_cdc);
}

g_UsbSendNode = getNodeFromQueue(&g_UsbSendQueue);
if (g_UsbSendNode)
{
USB_HostCdcDataSend(g_cdc.classHandle, (uint8_t *)&g_UsbSendNode->buffer[0], g_UsbSendNode->dataLength,
USB_HostCdcDataOutCallback, &g_cdc);
}
else
{
g_UsbSendBusy = 0;
}
}

Where is the USB RX interrupt handler. I am new to NXP MCUs and finding it a bit hard as compared to ST.

0 Kudos
Reply
3 Replies

454 Views
Khanajkmal
Contributor I

Hi 

I am also facing same problem here, if You know the answer please reply

0 Kudos
Reply

564 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @starlord1205,

I believe this is a duplicate post from a case you entered to our support portal directly. If it is okay with you, I will support your issue directly though the case portal to prevent double answers. Expect my email soon.

 

BR,

Edwin.

0 Kudos
Reply

555 Views
starlord1205
Contributor I

Yeah. It will work.

0 Kudos
Reply