Skip to main content
Graduate II
October 14, 2025
Solved

How to drive a FT232 chip by STM32 USB HOST CDC example?

  • October 14, 2025
  • 3 replies
  • 477 views

Hi there,

I am working on a project that requires sending just two commands to an FT232 chip and waiting for the response data.

I can already successfully communicate the STM32 USB HOST CDC and the STM32 USB DEVICE CDC (refer to repo's first commit ).

However, while I was trying to modify the USB HOST CDC example to work with FT232(refer to the above repo's second commit), it didn't work.

Can anyone give me some advice or demo code?

Thank you.

    This topic has been closed for replies.
    Best answer by Junde

    Hi there, 

    After some tries, I can use the STM32F429 to communicate with the FT232. (Refer to the source code in the attachment)

    However, there are some bugs in the code:

    1. There are always 2 more bytes to be received at the beginning of the data frame. (I ignore the first 2 bytes now)

    2. Some frames can be received more than once. (I compare the continuously received frames and ignore the same ones.)

    3. After re-plugging the FT232 device, the device can't work. (How to support the hot plug)

    (And I already tried the STM32F1 Device CDC example with the same HOST code; all the above problems do not exist.)

    Below are the LOG for the STM32F1 Device(left) and the FT232 Device(right):

    Junde_1-1760674334317.png  Junde_2-1760674355342.png

    I don't know the reason why the FT232 can't support the hot plug function.

    3 replies

    Super User
    October 14, 2025

    If you want UART, why not cut the FT232 chip out and use UART directly from the STM32?

    JundeAuthor
    Graduate II
    October 14, 2025

    Hi @TDK ,

    Thanks for your reply.

    The FT232 is integraded in a module that we must use, and that module is not manufacture by ourself.

    So that's why we need to build communication with it.

    Super User
    October 14, 2025

    @Junde wrote:

    The FT232 is integraded in a module that we must use,


    "must"?

    What compels you?

     


    @Junde wrote:

    that module is not manufacture by ourself.


    So have you tried contacting the manufacturer for support?

    Or maybe contact FTDI for support in hosting their chips on a microcontroller?

     

    PS:

    Perhaps this might help: https://github.com/hathach/tinyusb/discussions/725#discussioncomment-505374 ?

    via Google search for "ft232 host stm32"; other internet search engines are available.

    Super User
    October 14, 2025

    See this recent thread: STM32F407 USB Host config for FT232RL.

    As noted there by @waclawek.jan, the FT232 is not a standard CDC class device - so you'll have to look at its descriptors and you would need a custom driver for it. 

     

    JundeAuthorAnswer
    Graduate II
    October 17, 2025

    Hi there, 

    After some tries, I can use the STM32F429 to communicate with the FT232. (Refer to the source code in the attachment)

    However, there are some bugs in the code:

    1. There are always 2 more bytes to be received at the beginning of the data frame. (I ignore the first 2 bytes now)

    2. Some frames can be received more than once. (I compare the continuously received frames and ignore the same ones.)

    3. After re-plugging the FT232 device, the device can't work. (How to support the hot plug)

    (And I already tried the STM32F1 Device CDC example with the same HOST code; all the above problems do not exist.)

    Below are the LOG for the STM32F1 Device(left) and the FT232 Device(right):

    Junde_1-1760674334317.png  Junde_2-1760674355342.png

    I don't know the reason why the FT232 can't support the hot plug function.

    Super User
    October 17, 2025

    @Junde wrote:

    I already tried the STM32F1 Device CDC example with the same HOST code; all the above problems do not exist


    As already noted, the FT232 is not a standard CDC device - so that's to be expected.

     


    @Junde wrote:

    I don't know the reason why the FT232 can't support the hot plug function.


    It's not the FT232 - that certainly copes with hot-plugging on other systems - so it must be something missing/wrong in your code...

    JundeAuthor
    Graduate II
    October 17, 2025

    Hi @Andrew Neil 

    Thanks for your reply.

    It's not the FT232 - that certainly copes with hot-plugging on other systems - so it must be something missing/wrong in your code...

    Yes, I know there must be something wrong with the code, but I don't know where and why it is.