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.

TM4C129XNCZAD: Re-initialize the USB on TM4C129XNCZAD

Part Number: TM4C129XNCZAD

Hi ,

Is there a way to re-initialize the USB without powering it off and on again?

Thank you.

The way I use it is as follows:

#define SYS_CLOCK_FREQ 120000000
#define USB_PLL_CLOCK  480000000

void USBCDCD_reinit(void)
{
    uint32_t ui32PLLRate, g_ui32SysClock;

    g_ui32SysClock = SYS_CLOCK_FREQ;
    ui32PLLRate = USB_PLL_CLOCK;

    state = USBCDCD_STATE_UNCONFIGURED;

    SysCtlPeripheralDisable(SYSCTL_PERIPH_USB0);
    SysCtlUSBPLLDisable();
    SysCtlDelay(4800000);

    SysCtlUSBPLLEnable();
    SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);

    SysCtlDelay(1000000);

    g_ui32SysClock = SYS_CLOCK_FREQ;
    ui32PLLRate = USB_PLL_CLOCK;
    USBDCDFeatureSet(0, USBLIB_FEATURE_CPUCLK, &g_ui32SysClock);
    USBDCDFeatureSet(0, USBLIB_FEATURE_USBPLL, &ui32PLLRate);

    USBStackModeSet(0, eUSBModeForceDevice, 0);
}

Ray Yang