cancel
Showing results for 
Search instead for 
Did you mean: 

Hosting a USB -> RS232 on STM32

AJE
Associate II
Posted on July 09, 2015 at 10:43

Hi

I have a project where I need to host a CDC on an STM32F microcontroller.

The usarts are in use hence the need for the CDC.

I have found library code from STs cube in

''stm32cubef4\STM32Cube_FW_F4_V1.7.0\Middlewares\ST\STM32_USB_Host_Library\Class\CDC''

which configures the USB to host a CDC. The problem I have is making my application talk to the device.

Obviously when a USB to serial adapter is connected to a windows PC, a COMx

interface is created which can then be connected to by an application.

What I'm not clear on is how I would make the firmware in my STM32 talk to

the CDC so that serial data can be passed to a connected serial device.

I have spent a lot of time searching for examples on this issue, but have not found any.

Can someone give me some hints on how to connect to the CDC device

please?

Thanks

Andrew

2 REPLIES 2
Amel NASRI
ST Employee
Posted on July 09, 2015 at 11:48

Hi Andrew,

In the path you provided, you will find drivers for CDC class.

But there is also a CDC example in STM32Cube_FW_F4_V1.7.0\Projects\STM324xG_EVAL\Applications\USB_Host\CDC_Standalone. 

It is a typical application on how to use the STM32F4xx USB OTG Host peripheral to operate with an USB CDC device application.

The readme.txt file provides more details on how to use this example.

You can start from there, or from a CubeMX generated code to build your own application.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

AJE
Associate II
Posted on July 09, 2015 at 12:31

Hi Mayla

Thank you for your reply. I have just taken a quick look, and that's exactly what I need to get under way.

Thanks again :)

Andrew