Цитата(Alex_1811 @ Jul 13 2011, 15:10)

Чтобы не плодить темы...
Правильно.
У меня тоже тут кое-что есть. Ниже - копия моего сообщения в форуме ST по поводу
найденой мной ошибки в RL-USB 4.21 (может и раньше была). Переводить влом, однако
мой битый английский будет наверняка понятен уважаемым коллегам.
FYI: while playing with the RL-USB from KEIL on the board with STM32F103RC
(similar to MCBSTM32) I might have found a severe mistake in the KEIL "USB-Driver".
The driver file is "usbd_STM32F103.c" and is normally to copy to and custom in the
project.
Symptoms: firmware with USB CDC implemented stalled as soon as the USB cable
was unplugged on the self powered device.
Found: the USB interrupt stayed pending because of ESOF flag set while in the ISR
there was no branch processing this flag. USBD_Reset() enables the interrupt on
this flag along with SOF. The part of the code doing this looks like:
CNTR = ....
((USBD_P_SOF_Event != 0) ? CNTR_SOFM : 0) |
((USBD_P_SOF_Event != 0) ? CNTR_ESOFM : 0);
The interrupt occurs as soon as and only when the USB is being unplugged.
Suspicion: "copy and paste" mistake. Besides, I suppose, KEIL programmers might
have tested the code on the device that was bus powered only (supply gone,
problem gone).
Solution: the last line setting CNTR_ESOFM has been removed; firmware works.
My question to USB gurus: how the handler for ESOF should look like if I decide to process it?
Сообщение отредактировал KnightIgor - Jul 26 2011, 11:43