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.

TM4C1290NCPDT USB serial device not detected

Other Parts Discussed in Thread: TM4C1290NCPDT

I am using TM4C1290NCPDT controller.

I am trying to configure USB as virtual serial port. Below is my USB configuration function.

void USB_Configuration(void)
{
    uint32_t ui32PLLRate;

    ui32PLLRate = 480000000;

    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTB_BASE,  GPIO_PIN_0 | GPIO_PIN_1);

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);

    //
    // Initialize the transmit and receive buffers.
    //
    USBBufferInit(&g_sTxBuffer);
    USBBufferInit(&g_sRxBuffer);


    //
    // Set the USB stack mode to Device mode with VBUS monitoring.
    //
    USBStackModeSet(0, eUSBModeDevice, 0);


    //
    // Tell the USB library the CPU clock and the PLL frequency.  This is a
    // new requirement for TM4C129 devices.
    //
    USBDCDFeatureSet(0, USBLIB_FEATURE_CPUCLK, &ui32SysClock);
    USBDCDFeatureSet(0, USBLIB_FEATURE_USBPLL, &ui32PLLRate);

    //
    // Pass our device information to the USB library and place the device
    // on the bus.
    //
    USBDCDCInit(0, (tUSBDCDCDevice *)&g_sCDCDevice);
}

I copied usb_serial_struct.c & usb_serial_struct.h files from usb_device_serial example code.

And also i put USB0DeviceIntHandler() in startup.ccs file. 

In my hardware i directly connected VBUS, D+,D-, & GND to USB connector.

But when i connect my device to PC using USB cable. The PC is unable to detect COM Port. There isn't any notification like unknown device or driver error when i connect or disconnect the usb cable.

So what's wrong in my code/hardware?

  • Hello Ritesh,

    Some basic questions first. Is the code hanging some where in a loop? In the code above I see that you are configuring Port B, but I do not see the SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB) being called.

    Regards

    Amit

  • Hello Amit,

    Thanks for the Reply.

    My code is not hanging anywhere i have one timer running and TFT LCD display update loop running. The code is running without hang.

    And i have other general GPIO_initialize function in which i have defined ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB) with other used GPIO Enable functions.

  • The Problem is solved. 

    This is my code.

    void USB_Configuration(void)
    {
        uint32_t ui32PLLRate;
    
    	ui32PLLRate = 480000000;
    
    	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);
    
    	ROM_GPIOPinTypeUSBAnalog(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
        ROM_GPIOPinTypeUSBAnalog(GPIO_PORTL_BASE, GPIO_PIN_6 | GPIO_PIN_7);
    
    	//
        // Initialize the transmit and receive buffers.
        //
        USBBufferInit(&g_sTxBuffer);
        USBBufferInit(&g_sRxBuffer);
    
    
        //
        // Set the USB stack mode to Device mode with VBUS monitoring.
        //
        USBStackModeSet(0, eUSBModeDevice, 0);
    
    
        //
        // Tell the USB library the CPU clock and the PLL frequency.  This is a
        // new requirement for TM4C129 devices.
        //
        USBDCDFeatureSet(0, USBLIB_FEATURE_CPUCLK, &ui32SysClock);
        USBDCDFeatureSet(0, USBLIB_FEATURE_USBPLL, &ui32PLLRate);
    
        //
        // Pass our device information to the USB library and place the device
        // on the bus.
        //
        USBDCDCInit(0, (tUSBDCDCDevice *)&g_sCDCDevice);
    }

    The Problem is solved by adding
    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTL_BASE, GPIO_PIN_6 | GPIO_PIN_7);
    instruction.

    In hardware i am only using D+, D- & USBVBUS pins other pins are not connected.
    Anything else i need to added for configuration as a USB Device operation?

  • Hello Ritesh

    Glad that the earlier hint on Pad initialization brought you closer to the actual issue.

    Regards

    Amit