2012-08-07 03:11 AM
I have got the VCP Example from STM32 USB OTG HOST-DEVICE library running on my STM32F207ZE. The example was pasted into my project with small modification - it don't get data from UART port, but application simply puts data into APP_Rx_Buffer.
The problem: when I disconnect USB cable (even if port is closed) the MCU halts. The debug also stops to work! I can't access my MCU usuing neither OpenOCD+Olimex ARM-USB-OCD-H JTAG nor ST-Link Utility + ST-Link/v2. I can't halt MCU Core, read registers etc. I can only press hardware reset button on my board. So it's impossible to check where exactly program halts. What I noticed? If I make sequention:- halt MCU core- disconnect USB cable- run the corethe everything is OK. The situation doesn't chagne if I don't send anything through USB (I cut out all writes to APP_Rx_Buffer). Could you help me where I can find the problem? What should I check or correct? Best regards #usb-stm32f22012-08-09 06:29 AM
Problem temporarily solved. In function DCD_HandleUSBSuspend_ISR() there is a line:
/* Request to enter Sleep mode after exit from current ISR */ SCB->SCR |= (SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk);This line causes the MCU go sleep. After changing configuration of USB_OTG everything is OK.
Best regardsKonoppo