This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/AM3359: USB pipe schedule issue

Part Number: AM3359

Tool/software: TI-RTOS

Hi TI,

                     beaglebone black, processor SDK RTOS 4.2.0.9, ccs 7.4

I am working on usb host bulk transfer, using USBHCDPipeSchedule() to write the data to ulBulkOutPipe.

According to //e2e.ti.com/.../

"when you schedule a write to an OUT pipe, you get an IN transaction", guess it is also true for TI-RTOS.

I have to write out 4 sets of data to configure the device. The device will return  4 distinct ACK signals in variable length upon receiving the individual data set.

However, I only receive 1st set of ACK signal, and the rest 3 write-outs not invoking the callback function (i.e., no UART print out). Below are codes for data-sending, and callback function.

void USBHCDCSendChars(unsigned char *pucData, uint32_t ulSize, tUSBHCDCInstance *USBHCDCDevice)
{

    USBHCDPipeSchedule( USBHCDCDevice->ulIndex,
                        USBHCDCDevice->ulBulkOutPipe,
                        pucData,
                        ulSize);

}


unsigned char SchedulePipeInBuffer[512];
void USBHCDCINCallback(uint32_t  ulIndex, uint32_t  ulPipe, uint32_t ulEvent)
{
    unsigned int ulSize, j, k;

    // Handles a request to schedule a new request on the BULK IN pipe
    if(ulEvent == USB_EVENT_SCHEDULER)
    {
        USBHCDPipeSchedule(sUSBHCDCDevice->ulIndex, sUSBHCDCDevice->ulBulkInPipe, SchedulePipeInBuffer, 512);
    }

    // Called when new data is available on the BULK IN pipe.
    if(ulEvent == USB_EVENT_RX_AVAILABLE)
    {
          // If the callback exists then call it.
          if(sUSBHCDCDevice->pfnCallback != 0)
          {
              // Get the bulk in data size.
              ulSize = USBHCDPipeReadNonBlocking(sUSBHCDCDevice->ulIndex, sUSBHCDCDevice->ulBulkInPipe, SchedulePipeInBuffer, 512);

              if(ulSize)
              {
                      UART_printf("callback counts = %d\r\n", ulSize);
                      for (j = 0; j < ulSize; j++)
                      {
                          UART_printf(" %02x", SchedulePipeInBuffer[j]);
                      }
                      UART_printf("\r\n");
              }

              // Call
              sUSBHCDCDevice->pfnCallback(sUSBHCDCDevice->ulIndex,
                                          CDC_EVENT_RX_AVAILABLE,
                                          (void*)SchedulePipeInBuffer,
                                          ulSize);


              // Schedule another read
              USBHCDPipeSchedule(sUSBHCDCDevice->ulIndex, sUSBHCDCDevice->ulBulkInPipe, SchedulePipeInBuffer, 512);
          }
    }
}

 

Please advise, thanks in advance

Mike