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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

1,098 Views
richard_stulens
NXP Employee
NXP Employee

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,

Richard

Labels (3)
0 Kudos
1 Reply

684 Views
anthony_huereca
NXP Employee
NXP Employee

Also related, when trying to use USB1, you need to enable it in the default vybrid tower config file for A5: mqx/source/bsp/twrvf65gs10_a5/twrvf65gs10_a5.h.

Change USBCFG_DEFAULT_HOST_CONTROLLER to use ehci1:

#define USBCFG_DEFAULT_HOST_CONTROLLER (&_bsp_usb_host_ehci1_if)

0 Kudos