Hi all,
WinCE600R3 + iMX51.
When the device suspends, it power off the 5v0 and 3v3 voltages: this cause wakeup events for usbh1 and usbotg that resume the device.
How can i disable wakeup from usbh1 and otg to avoid this?
Where in the code i put this? BSPPowerOff() function ?
Thanks
Just before the power off of the voltages i put:
//SM disable USBH1
dwSysIntr = 0x1d;
OEMIoControl(IOCTL_HAL_DISABLE_WAKE, &dwSysIntr, sizeof(dwSysIntr), NULL, 0, NULL);
//SM disable USBOTG
dwSysIntr = 0x1f;
OEMIoControl(IOCTL_HAL_DISABLE_WAKE, &dwSysIntr, sizeof(dwSysIntr), NULL, 0, NULL);
The proper way to disable the USB as a wake source is to use some CDEFINES definitions that allow compile-time configuration of the USB wakeup capabilities. In the respective SOURCES files of the USBH and USBOTG drivers, you will find the following CDEFINES definition:
CDEFINES=$(CDEFINES) -DCEDDK_USEDDKMACRO -DUSB_WAKEUP_CNANDDN
#-DUSB_WAKEUP_CN
#-DUSB_WAKEUP_NONE
Use the USB_WAKEUP_NONE (commented out by default) if you want to remove the registration of the USB as a wake source. Search for these CDEFINES in the source code of the USB driver to see how the configuration will differ. Be sure to rebuild the respective USB drivers after changing the CEDEFINES as the SOURCES files are not considered as build dependencies.