2019-09-09 09:37 AM
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
2019-09-09 09:43 AM
> 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
2019-09-11 12:34 PM
> 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?
2019-09-11 12:36 PM
Just in case, my github: https://github.com/nikmosyl/stm32f105_usb_cdc_host
And one more question. Why is this pin in CubeMX?
Already have a USB_OTG_FS_VBUS (PA9) pin, why do I need this Drive_VBUS_FS? What is the function of this?
2019-09-12 01:56 PM
> > 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