Hi Team,
My customer is using AM335x starterware's as the OS, the version is AM335X_StarterWare_02_00_01_01.
They met have one request with the USB1_DRVVBUS's setting. In our original starterware settings, the DRVVBUS is active during high and inactive during low. But they need to set the DRVVBUS work at the opposite approach. That's inactive during low. So they're trying to test set the codes to achieve this requirement.
When tracing at the file C:\ti\AM335X_StarterWare_02_00_01_01\drivers\usb.c file, in the function USBHostPwrConfig, we found that this read part marked as below is out of the memory of USB1_CORE.
Original function:
void USBHostPwrConfig(unsigned int ulBase, unsigned int ulFlags)
{
/* Check the arguments. */
ASSERT((ulBase == USB0_BASE)||(ulBase == USB1_BASE));
ASSERT((ulFlags & ~(USB_EPC_PFLTACT_M | USB_EPC_PFLTAEN |
USB_EPC_PFLTSEN_HIGH | USB_EPC_EPEN_M)) == 0);
/* If requested, enable VBUS droop detection on parts that support this
* feature. */
HWREG(ulBase + USB_O_VDC) = ulFlags >> 16;
/* Set the power fault configuration as specified. This will not change
* whether fault detection is enabled or not. */
HWREGH(ulBase + USB_O_EPC) =
(ulFlags | (HWREGH(ulBase + USB_O_EPC) &
~(USB_EPC_PFLTACT_M | USB_EPC_PFLTAEN |
USB_EPC_PFLTSEN_HIGH | USB_EPC_EPEN_M)));
}
The two definitions are as below:
#define SOC_USB_1_BASE (0x47401C00) ,
#define USB_O_EPC 0x00000400 ;
So the read part's value HWREGH(ulBase + USB_O_EPC) is HREGH(0x47401C00 + 0x00000400 ) = HWREGH(47402000)
This is out of USB1_CORE's memory. Is this an issue?
When modified this, it didn't act as the way expected. So another question is that, is there an approach to achieve the goal to let the USB1_DRVVBUS to active the VBUS during its low?