cancel
Showing results for 
Search instead for 
Did you mean: 

How to Set USB CDC Line Coding?

spflanze
Associate II
Posted on August 02, 2016 at 05:11

Using STM32CubeMX 4.16.0  I generated a project with the USB_DEVICE Communication Device Class option enabled. In the document at:

http://www.st.com/content/ccc/resource/technical/document/user_manual/b8/5a/28/c2/cf/b6/47/d6/DM00105256.pdf/files/DM00105256.pdf/jcr:content/translations/en.DM00105256.pdf

I see in section 4.4.5 that I must call USBH_CDC_SETLineCoding() to set the line coding. I cannot find this function anywhere in the generated files. How is the line coding supposed to be set? Is the document out of date? If so where is the up to date version?

#usb-cdc-line-coding
1 REPLY 1
Nesrine M_O
Lead II
Posted on August 02, 2016 at 13:13

Hi Stephen, 

Using STM32CubeMX 4.16.0  I generated a project with the USB_DEVICE Communication Device Class option enabled.

I think that you are using STM32Cube USB device library and not the STM32Cube USB host library.

Please refer to the

http://www.st.com/content/ccc/resource/technical/document/user_manual/cf/38/e5/b5/dd/1d/4c/09/DM00108129.pdf/files/DM00108129.pdf/jcr:content/translations/en.DM00108129.pdf

user manual for more details about the USB device library.

Also I recommend you to have a look to USB applications under the cube firmware package as example:

STM32Cube_FW_F4_V1.13.0\Projects\STM324x9I_EVAL\Applications\USB_Device

STM32Cube_FW_F4_V1.13.0\Projects\STM324x9I_EVAL\Applications\USB_Host

-Syrine-