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.

Question regarding an issue, L138/C6748 with BLED112 usb dongle

Hi-

I'm using LCDK board and trying to use BLED112 bluetooth usb dongle via USB OTG port.

Unfortunately, C6748_StarterWare_1.20.04.01 doesn't have USBCDC host example.

My first question is
Is there a reason why it doesn't have USBCDC host example? Is LCDK able to support usb host cdc?

I found an usb host cdc example from link below, but I was not able to read or write the usb dongle.
github.com/.../tiva-c_usb_host_cdc_driver

I used usbhcdc.c/h files and made source code like below.
(I want to attach my source code, but it seems not available here. If you need, I can send them via email.)
===============================================================
static void ConfigureIntUSB(void)
{
    /* Initialize the DSP interrupt controller */
    IntDSPINTCInit();
   
    /* Register ISR to vector table */
    IntRegister(C674X_MASK_INT5, USB0HostIntHandler);
   
    /* Map system interrupt to DSP maskable interrupt */
    IntEventMap(C674X_MASK_INT5, SYS_INT_USB0);
   
    /* Enable DSP maskable interrupt */
    IntEnable(C674X_MASK_INT5);
   
    /* Enable DSP interrupts */
    IntGlobalEnable();
}

int main(void)
{
 ............
 do
    {
        //
        //Setup the interrupt controller
        //
        ConfigureIntUSB();

        DelayTimerSetup();

        //
        // Enable Clocking to the USB controller.
        //
        PSCModuleControl(SOC_PSC_1_REGS,1, 0, PSC_MDCTL_NEXT_ENABLE);

        //USBStackModeSet(0, USB_MODE_HOST, NULL);

        //
        // Register the host class drivers.
        //
        USBHCDRegisterDrivers(USB_INSTANCE, g_ppHostClassDrivers, NUM_CLASS_DRIVERS);
  
  g_ulCDCInstance = USBHCDCDriveOpen(USB_INSTANCE, USBCDCCallback);
  
  USBHCDPowerConfigInit(USB_INSTANCE, USBHCD_VBUS_AUTO_HIGH);
  
          //
        // Initialize the host controller.
        //
        USBHCDInit(USB_INSTANCE, g_pHCDPool, HCD_MEMORY_SIZE);
        SET_CONNECT_RETRY (USB_INSTANCE, USBMSC_DRIVE_RETRY);
        USBHTimeOut->Value.slEP0 = USB_EP0_TIMEOUT_MILLISECS;
        USBHTimeOut->Value.slNonEP0= USB_NONEP0_TIMEOUT_MILLISECS;
        USBHCDTimeOutHook (USB_INSTANCE, &USBHTimeOut);
  
  while(1)
     {

      if(g_eState == STATE_DEVICE_ENUM)
      {
       if(USBHCDCReady(g_ulCDCInstance) == 0)
       {
     ret_size_s = 0;
     ret_size_s = USBHCDCWrite(g_ulCDCInstance, &ucChar_tx[0], 5);

     memset(ucChar_rx, 0x0, sizeof(ucChar_rx));
     ret_size = 0;

     //if(USBHCDCReady_read(g_ulCDCInstance) == 0)
     {
      ret_size = USBHCDCRead(g_ulCDCInstance, &ucChar_rx[0], sizeof(ucChar_rx));
      if(0 < ret_size)
       ret_size = 0;
     }
       }
      }

      if((USBHTimeOut->Status.slEP0)||
    (USBHTimeOut->Status.slNonEP0))
   {
    deviceRetryOnTimeOut--;
   }
   if(!deviceRetryOnTimeOut)
   {
    UARTprintf("%s\n", "Timedout too many times!!!");
    g_eState = STATE_TIMEDOUT;
    deviceRetryOnTimeOut = 4;

    USBHTimeOut->Value.slEP0 = USB_EP0_TIMEOUT_MILLISECS;
    USBHTimeOut->Value.slNonEP0= USB_NONEP0_TIMEOUT_MILLISECS;
    USBHTimeOut->Status.slEP0 = 0;
    USBHTimeOut->Status.slNonEP0= 0;
   }

   //
   // Periodically call the main loop for the Host controller driver.
   //
   //USBHCDMain();
   USBHCDMain (USB_INSTANCE, g_ulCDCInstance);
     }
    }while(1);
}
==============================================================
  
When I call USBHCDCWrite function, USBEndpointStatus() return USB_HOST_OUT_ERROR in USBHostIntHandlerInternal.

I'm trying to find some solution for it, but it seems very complicated.

Could you give me a hint to resolve this issue?
Any tips or help will be appreciated for me~!

Thanks~
  
  

  • Hi,

    We are checking out this thread and will update you soon.

    Thanks & regards,
    Sivaraj K
  • Hi,

    sunghwan said:
    I'm using LCDK board and trying to use BLED112 bluetooth usb dongle via USB OTG port.
    Unfortunately, C6748_StarterWare_1.20.04.01 doesn't have USBCDC host example.
    My first question is
    Is there a reason why it doesn't have USBCDC host example? Is LCDK able to support usb host cdc?


    Yes, the C6748 starterware doesnot have USB CDC host example. It has just the peripherla mode example.

    However, the USB host controller of C6748 processor should support USB host mode for connecting CDC devices.

    ------------------------------

  • Dear Shankari

    Thanks you so much for your answer.

    I also believe that it should support USB Host mode for connecting CDC device.

    I'll keep tying to make it work and let you know result.

    I think I would be helpful for someone who need it.

    Thanks~

  • Dear Sivaraj

    Thanks for your support.

    I am hoping to get a good news from you.

    I'll also keep trying this and share the result.

    Thanks again and have a good weekend~!

    Sunghwan Bae