cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual COM port (USB CDC) example - ... Endpoints? _SOLVED but SEVERE MISTAKE in RL-USB!

ColdWeather
Senior
Posted on July 09, 2011 at 23:13

Hello!

I've adjusted the Virtual Com Port example from the

FS USB Library V3.2.1/V3.3.0 to my needs on

STM32F103RC.

It works.

As a preparation to merge USB CDC and Mass Storage

(suggestions and solutions are welcome!) I'm trying now

first to ''move'' the COM communication to the endpoints

4,5 and 6 instead of the origin 1,2 and 3 in the example.

It does not work.

Exactly, the Virtual COM does appear under Win7

(endpoint 0 is untouched) but no communication

occures.

I think I've missed some substitution or misunderstood

the allocation of the endpoints.

Could anyone share with me a kind of check list, what

changes/substitutions should be made to the application

part of the USB library (usb_conf.h, usb_desc (.h, .c),

 

usb_prop (.h, .c), usb_endp.c, usb_istr (.h,.c) and

 

usb_pwr (.h, .c)) to get the communication over

EP4, EP5 and EP6?

TIA.

#usb-endpoints-change #virtual-com-port-alternative-endpoints #composite-virtual-com #usb-cdc-rl-usb-severe-mistake
11 REPLIES 11
ColdWeather
Senior
Posted on July 23, 2011 at 10:41

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 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 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?

picguy2
Associate II
Posted on July 25, 2011 at 21:18

sorry for the test -- I was unable to post a new message