"USB1 not working in MQX 4.0.1 (Tower) and 4.0.2 (Auto)?"

Discussion created by richard_stulens Employee on Jun 7, 2013
Latest reply on Jun 11, 2013 by Anthony Huereca

Some people report that USB1 is not working in the current MQX releases for Vybrid.


We found that this may be caused by the Bypass bit in the USB1 PLL (PLL7) not being cleared during initialization.

The issue will be further investigated, but for now a quick fix is to clear the bypass by adding the code in bold.:


In file init_gpio.c (bsp lib):


        // For USB1

        Anadig_PLL7_CTRL &= ~Anadig_PLL7_CTRL_BYPASS_CLK_SRC_MASK; //the source of clock is 24MHz XTAL CLK

        Anadig_PLL7_CTRL |= Anadig_PLL7_CTRL_POWER_MASK; //power the USB1 PLL

        Anadig_PLL7_CTRL |= Anadig_PLL7_CTRL_EN_USB_CLKS_MASK; //power the USB1 PHY


        while(!(Anadig_PLL7_CTRL & Anadig_PLL7_CTRL_LOCK_MASK));// wait for pll to lock

        Anadig_PLL7_CTRL &= ~Anadig_PLL7_CTRL_BYPASS_MASK; //clear the bypass


Best regards,