cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting USB reset after USB suspend

jkuek
Associate II
Posted on November 19, 2012 at 00:15

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?
4 REPLIES 4
tsuneo
Senior
Posted on November 20, 2012 at 03:56

> 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

Tsuneo

jkuek
Associate II
Posted on November 22, 2012 at 02:22

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).

marcomarco9119
Associate
Posted on December 24, 2012 at 02:12

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);
}

ksarveshwar20
Associate
Posted on August 23, 2013 at 12:33

I am in need of USB Transmit Fifo code for STM32F407VG