cancel
Showing results for 
Search instead for 
Did you mean: 

[CubeMX] USB CDC library

licencje1
Associate II
Posted on June 03, 2015 at 11:37

Hi,

I've recently try to use code generated by CubeMX to prepare simple USB<->UART converter. Everything goes almost ok but inside function CDC_Control_FS(...) [usbd_cdc_if.c] in case ''CDC_SET_LINE_CODING'' inside buffer I should have received setting for uart (set on PC by user) but the only one setting that is inside function buffer is baud rate, nothing more :( Could somebody tell my why, or what shall I do to deal with that?

P.S Is there any maual for Cube library (I've found only sheet with about 58 pages)?

#stm32f4 #usb #uart #cubemx #cdc
2 REPLIES 2
chrif
Associate II
Posted on June 12, 2015 at 12:29

Hi,

You can refer to the example in

STM32Cube_FW_F4_V1.6.0\Projects\STM324xG_EVAL\Applications\USB_Device\CDC_Standalone.

Also have a look to UM1720 and UM1725.

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00105256.pdf?s_searchtype=keyword

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00105879.pdf?s_searchtype=keyword

Posted on February 04, 2017 at 19:01

I ran into another imperfection of the CDC Class. That regards the handling of control messages to 'CDC_Control_FS '. Some of the messages make use of the wValue in the control message, which is not passed as a parameter. I expect that the orginal specification ( see 

https://cscott.net/usb_dev/data/devclass/usbcdc10.pdf

) from 1998

:(

is still valid.

I have noticed that CDC_Control_FS is called with SET_CONTROL_LINE_STATE updating the virtual DTR and DCD handshake lines whenever the terminal program in the host opens or closes the COM port. But since the port can be opened without handshaking, this doesn't reflect the port status. So I haven't found a method to detect whether the host has opened the port.