AnsweredAssumed Answered

How does USB Host CDC data communication work?

Question asked by Pilot B on Apr 18, 2018
Latest reply on Apr 19, 2018 by Pilot B

Hello everyone,


I'm trying to get USB Host CDC working on STM32F407-DISC board. I'm using USB library version 2.2.0.


So far, I got enumeration working fine by connecting a CDC device. I'm able to send data to the CDC device. But the data is wrong. For example, the data was sent is "Hello"(it should be "48 65 6C 6C 6F"). But the CDC device received something like "00 00 00 00 AF". I suspect the line coding caused the issue. But I'm not sure.


Some questions:

1. Does the line coding matter? 

2. I found this in the code:

phost->device_prop.speed = HPRT0_PRTSPD_FULL_SPEED;

I guess at the beginning, both the host and device use "Full Speed"(12M/s). Is it correct?

3. During enumeration, USB Host get the device line coding "115200 8N1". I also called CDC_SETLineCoding() by using the same line coding "115200 8N1". The CDC_SETLineCoding() is to set the device's line coding? Or is it to set the Host's line coding? Or Both?

4. If CDC_SETLineCoding() is not for setting Host's line coding, then what function is to set Host's line coding?


Thanks everyone!