Skip to main content
Associate II
September 22, 2025
Question

STM32F407 USB Host config for FT232RL

  • September 22, 2025
  • 6 replies
  • 1591 views

Title edited to name the device being hosted.


Hello , 
I am currently trying to configure STM32F407 board as USB host. The code for it is given below. I am not receiving anything from the USB device(bus powered). I have a doubt that it might be related to the hardware of it(VBUS). The rest of the code is generated by the IDE itself so there is no doubt related to it. I have configured it as USB host only mode. I am new to embedded systems so any kind of help would be appreciated. Is there anything wrong with the code or any links to help me configure the USB host.
I would be glad to clarify any queries related to the above.

6 replies

Andrew Neil
Super User
September 22, 2025

welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

In particular, what STM32F407 board are you using, and what is the USB device?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
SohamCAuthor
Associate II
September 23, 2025

STM32F407ZGT6 , and the USB device is USB to serial converter FT232RL chip(which expects power from the bus).
Does this help? 

Andrew Neil
Super User
September 25, 2025

@Andrew Neil wrote:

In particular, what STM32F407 board are you using


(emphasis added)

 


@SohamC wrote:

STM32F407ZGT6 


That's just a chip part number - it doesn't tell what board you are using it on.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
waclawek.jan
Super User
September 23, 2025

> the USB device is USB to serial converter FT232RL chip

That's not a standard CDC class device, look at its descriptors. You would need a custom driver for it. 

JW

SohamCAuthor
Associate II
September 23, 2025

Thank you for the clarification, so what method would you suggest to establish communication with this chip? 

Andrew Neil
Super User
September 23, 2025

Have you tried an internet search for "Microcontroller Host FT232" ?

First hit I get with that is: STM32 USB Host. Virtual Port Com. FTDI and CH340

Which confirms what @waclawek.jan said ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Technical Moderator
September 23, 2025

Hi @SohamC 

Do you reproduce the issue using STM32F4DISCOVERY board? If so, have you tried the firmware example provided here. Then you can check host applications and dive deeper into requirements of host application. This section in wiki might be helpful as well. 

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.Best regards,FBL
waclawek.jan
Super User
September 23, 2025

As I've said, you'd need a custom driver for it. Maybe there is some vendor out there who offers that (maybe even FTDI, try asking them); or maybe the protocol is available and then you can implement it yourself.

JW

 

SohamCAuthor
Associate II
September 25, 2025

SohamC_0-1758786421132.png

I tried writing custom driver for the ftdi chip since its not available in the usb host library. I tried including the .h file in usb_host.c and main src as well for compilation. But the error symbol on the project logo is still there, I am not able to understand the problem. I think its because of linker. Can someone help me including the driver correctly.

 

Andrew Neil
Super User
September 25, 2025

If it's a build error (or errors), it/they will appear in the Console window when you do the build.

That will tell you exactly what the issue(s) is/are.

You can Copy and paste that output here - as text.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
SohamCAuthor
Associate II
September 25, 2025

The console window does not open and hence am not able to see the errors.

Andrew Neil
Super User
October 17, 2025

@SohamC did you manage to get this working?

@Junde is now on a similar quest: How to drive a FT232 chip by STM32 USB HOST CDC example?

Perhaps you could collaborate ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.