AnsweredAssumed Answered

VCP - closing COM port causes MCU enter the interrupt loop

Question asked by Konoppo on Aug 9, 2012
Latest reply on Mar 21, 2013 by xu.jie.001
Hi!

   I've got another problem with my STM32F207ZE and the USB VCP. My application (on STM) is running and LEDs are blinking :). It send by USB (VCP) to PC some text. When I close port in terminal on the PC the program continue to works, but after few minutes it enter an "ISR loop". It sequentially enters OTG_HS_EP1_IN_IRQHandler(). Program goes to USBD_OTG_EP1IN_ISR_Handler() than calls 
DCD_WriteEmptyTxFifo(pdev, 1); 
CLEAR_IN_EP_INTR(1, emptyintr);

After exit from ISR it enter it again, and again, and again... my application looks like halted. When I connect again my COM port on the PC - the application continues to work. 

What can I do with it? How to detect, that port is "closed" and not to send the data to it? Any idea? I'm sure that i'm not the first who have this problem. The application is USB-OTG-Example's based. 

Best regards
Konoppo

Outcomes