MPC5748G USB Command Reset Issue

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

MPC5748G USB Command Reset Issue

1,340 Views
yanglei1
Contributor I

Hello,

         I enable the 80MHz clock and configure the USB PINs hardware in Processorexpert in SDS32 IDE.

For USB intialization, I set the RST bit to be 1 in regisetr USBCMD trying to reset the USB module. But no matter how long time is passed, the reset process couldn't be successfully finished(the RSET bit in USBCMD couldn't change from 1 to 0). Can anybody give me some advice to resolve this issue? I am debugg usb feature in DEVkit MPC5748G demo  EVB board.

0 Kudos
4 Replies

1,049 Views
jakobgen
Contributor I

Hi!

I was having the same issue. Seems like the USB phy wasn't clocked at all and that's why it was stuck on trying to reset.

The reason was that R72 on my development board was not populated (see https://www.nxp.com/downloads/en/schematics/DEVKIT-MPC5748G-SCH.pdf).

After placing the missing resistor, the USB examples from S32 Design Studio work fine now.

Best regards,

Jakob

0 Kudos

1,049 Views
yanglei1
Contributor I

my source code is as the following:

UHSTNC_Type *uhostnc_base;
UHST_Type *base;
uhostnc_base = s_usbHostNCBases[0];
base = s_usbHostBases[0];
unsigned int count = 10000;
unsigned int reg;

// reset usb controller
reg = base->USBCMD;
reg |= UHST_USBCMD_RST_MASK;
base->USBCMD = reg;
// check if reset done, port is enabled
while (base->USBCMD & UOTG_USBCMD_RST_MASK);

After the clock is configured, the previous code to initialize the usb host is called.

0 Kudos

1,049 Views
lognight
Contributor III

Have you solved the problem? I met the same situiation in devkit hardware platform. I used SDK v9.0.0 demo, and found the code ran on

while ((ehciInstance->ehciIpBase->USBCMD & USBHS_USBCMD_RST_MASK) > 0U)

0 Kudos

1,049 Views
kentsun
Contributor II

Have you solved it?

0 Kudos