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.
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.
my source code is as the following:
uhostnc_base = s_usbHostNCBases;
base = s_usbHostBases;
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.
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)
Have you solved it？