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.
Hi
I am also facing same problem here, if You know the answer please reply
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.
Yeah. It will work.