2012-11-18 03:15 PM
I'm using an f405 with USB and want to make the device compliant with USB specifications.
Using the HID joystick mouse project from the ST USB library as an example, the chip successfully goes to sleep on USB suspend and wake on USB resume. On some computers, I get a USB reset instead of a resume. How can I detect the USB reset and wake up?2012-11-19 06:56 PM
> On some computers, I get a USB reset instead of a resume.
Before Win7, Windows put bus reset instead of Resume ''Do USB devices get reset on system sleep resume?'' - Microsoft Windows USB Core Team Blog http://blogs.msdn.com/b/usbcoreblog/archive/2009/10/27/do-usb-devices-get-reset-on-sleep-resume.aspx All of USB device libraries should have code piece to process bus reset, but most of them don't care of resume by bus rest. Anyway, which ''ST USB library'' are you working on? STM32_USB-Host-Device_Lib_V2.1.0 OR STM32_USB-FS-Device_Lib_V3.4.0 Tsuneo2012-11-21 05:22 PM
I am using STM32_USB-Host-Device_Lib_V2.1.0.
The problem is the library doesn't seem to detect a USB reset when the device is in deep sleep(due to USB suspend).2012-12-23 05:12 PM
Any follow-up on this? I'm facing the issue as well. USB Reset doesn't seem to trigger USBWakeUp_IRQn. This is in V3.4.0.
void
USB_Interrupts_Config(
void
)
{
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
/* Configure the EXTI line 18 connected internally to the USB IP */
EXTI_ClearITPendingBit(EXTI_Line18);
EXTI_InitStructure.EXTI_Line = EXTI_Line18;
// USB resume from suspend mode
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
/* 2 bit for pre-emption priority, 2 bits for subpriority */
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
/* Enable the USB interrupt */
NVIC_InitStructure.NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 2;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
/* Enable the USB Wake-up interrupt */
NVIC_InitStructure.NVIC_IRQChannel = USBWakeUp_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_Init(&NVIC_InitStructure);
}
2013-08-23 03:33 AM