cancel
Showing results for 
Search instead for 
Did you mean: 

USB port stay open after APP in WIN crush. stack in loop STM32F205ZC

Barbie
Associate II
Posted on May 26, 2014 at 13:05

I use stm32_vcp_1.3.1 application for setting USB FS. I use it to send data to APP on the Win. It work fine but when the APP crush unexpected and the USB port stay open I don't get any announce for it (I have announce on port close or disconnect only) and after some time i see that I stack in the USB interrupt loop '' OTG_FS_IRQHandler '' when it specifice get flags for TxFiFO and SOF.

I can't get out of this loop and couldn't get to my main nether cut this loop or set and announce about it.

Is there a way or a function I can use to fine this scenario happened?

 Thanks

Bar.

#usb-stm32f205
1 REPLY 1
chen
Associate II
Posted on May 28, 2014 at 12:35

Hi

'' It work fine but when the APP crush unexpected and the USB port stay open I don't get any announce for it (I have announce on port close or disconnect only)''

It is unrealistic to expect a USB specific event/message to tell USB devices that the HOST has crashed.

It is up to the PC application to close/release the USB port when is shuts down.

You have not actually stated what USB device you have implemented.

''after some time i see that I stack in the USB interrupt loop '' OTG_FS_IRQHandler '' when it specifice get flags for TxFiFO and SOF.

I can't get out of this loop and couldn't get to my main nether''

So it sounds like the PC application crash has left the USB stack doing something bad. It is continuously sending USB frames to you device, probably bad/invalid frames at that. There is nothing you can do in your application except detect invalid frames and reject them.

It sounds like the problem is on the PC application side. Is this something you developed?