AnsweredAssumed Answered

RT1021 USB FreeRTOS Requires Send to continue?

Question asked by variable_andrew on Oct 15, 2019
Latest reply on Mar 23, 2020 by variable_andrew

I'm testing the dev_composite_cdc_vcom_cdc_vcom_freertos demo - 

 

In virtual_com.c , if I comment out the copy to TX, so that there is no data TX, then it appears that the RX will only execute once and all subsequent RX data is ignored. 

 

Any idea on why that is?

 

 

I'm referring to the below function. 

So normally, the "user code" check for recvSize is true every time I send data from terminal via USB.

BUT if i comment out the code to trigger a send, for some reason vcomInstance->recvSize is only ever != 0 once. 

 

void USB_DeviceCdcVcomTask(void)
{
    usb_status_t error = kStatus_USB_Error;
    volatile usb_cdc_vcom_struct_t *vcomInstance;

    for (uint8_t i = 0; i < USB_DEVICE_CONFIG_CDC_ACM; i++)
    {
        vcomInstance = &g_deviceComposite->cdcVcom[i];
        if ((1 == vcomInstance->attach&& (1 == vcomInstance->startTransactions))
        {
            /* User Code */
            if ((0 != vcomInstance->recvSize&& (0xFFFFFFFFU != vcomInstance->recvSize))
            {
                int32_t i;

                /* Copy Buffer to Send Buff */
                // Comment out the below 3 lines - then the RX block is only executed once 
                // for (i = 0; i < vcomInstance->recvSize; i++)
                // {
                //     vcomInstance->currSendBuf[vcomInstance->sendSize++] = vcomInstance->currRecvBuf[i];
                // }
                vcomInstance->recvSize = 0;
            }

            if (vcomInstance->sendSize)
            {

Outcomes