cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine the correct choice of the endpoint for the HOST CDC?

ns.moskalev
Associate II

Hello.

I raised the USB host CDC to stm32f105. After passing the initializations, I do USBH_CDC_SetLineCoding (), and right after USBH_CDC_GetLineCoding () and I get the wrong bit rate.

What will be the problem?

How to find out the address of the endpoint of a connected device?

How to understand that my HOST transfers data to the desired endpoint?

Respectfully yours,

Nikita

4 REPLIES 4

> How to find out the address of the endpoint of a connected device?

The device tells it to the host in the descriptors.

> How to understand that my HOST transfers data to the desired endpoint?

Well, it's your program, so it does what you told it to do. You can observe the traffic on the bus using an USB analyzer.

JW

ns.moskalev
Associate II

> Well, it's your program, so it does what you told it to do.

LOL. Are you sure?

Why then does USBH_CDC_SetLineCoding () not set the speed that I give?

ns.moskalev
Associate II

Just in case, my github: https://github.com/nikmosyl/stm32f105_usb_cdc_host

And one more question. Why is this pin in CubeMX?

0690X00000AR7y7QAD.png

Already have a USB_OTG_FS_VBUS (PA9) pin, why do I need this Drive_VBUS_FS? What is the function of this?

> > Well, it's your program, so it does what you told it to do.

>

> LOL. Are you sure?

Yes, I am sure it's your program. You may argue that somebody else wrote that function, but at the end of the day, you are responsible for what you put into your program. And it's open source, so you can look into that function and all other functions - and, for that matter, into the connected device, if it's open source or your source, too - and find out what's the problem. It's very unlikely somebody else will do it for you.

As I've told you, the best way to start debugging USB is to observe the traffic on the bus using an analyzer.

> Already have a USB_OTG_FS_VBUS (PA9) pin, why do I need this Drive_VBUS_FS?

I don't use CubeMX. Maybe you don't need it. The idea is, that the GPIO is supposed to switch on/off the VBUS power supply, while the VBUS pin serves as sense for the device role, in OTG setting.

JW