Skip to main content
Huy Pham
Associate
March 25, 2017
Solved

Is it possible to communicate with PC using STM32F401RE ?

  • March 25, 2017
  • 6 replies
  • 1742 views
Posted on March 25, 2017 at 09:27

Hello everyone. I am using STM32F401RE Nucleo Board. I want to communicate with PC through USB CDC Virtual COM Port. I was following an instruction for STM32F4 Discovery and then I realized that my Nucleo Board didn't have a second micro USB port like his Discovery Board. Is it possible for me to make my own second USB port like Discovery Board on my Nucleo Board ? What should I do ? 

Thank you very much. 

    This topic has been closed for replies.
    Best answer by S.Ma
    Posted on March 25, 2017 at 16:37

    There is no guarantee the differential signal quality will be good enough. (it's called the eye diagram)

    PCB layout is done carefully for differential signals such as USB, Display Port, DSI, LVDS, etc...

    If lucky it may work, if not use UART pin and RS232 to USB cable.

    Or simply buy a Bluetooth 5 USD module HC-05/06 to create a wireless virtual com port which will work on PC and Android phones.

    6 replies

    S.Ma
    Principal
    March 25, 2017
    Posted on March 25, 2017 at 15:31

    The built-in ST Link function may have a COM port for the user connected to the target STM32 USART (1?).

    This avoids purchasing a RS232-USB cable adapter. Adding USB cable to the nucleo is no guarantee to work as USB is a differential pair. Impedence matching to solder/plug a USB cable is risky.

    Huy Pham
    Huy PhamAuthor
    Associate
    March 25, 2017
    Posted on March 25, 2017 at 15:43

    Centauris.Alpha

    ‌ So you mean if I add a USB Port myself (VCC->3.3V,D+ -> PA12, D- -> PA11, GND -> GND), the communication through USB Port will be unstable ?

    S.Ma
    S.MaBest answer
    Principal
    March 25, 2017
    Posted on March 25, 2017 at 16:37

    There is no guarantee the differential signal quality will be good enough. (it's called the eye diagram)

    PCB layout is done carefully for differential signals such as USB, Display Port, DSI, LVDS, etc...

    If lucky it may work, if not use UART pin and RS232 to USB cable.

    Or simply buy a Bluetooth 5 USD module HC-05/06 to create a wireless virtual com port which will work on PC and Android phones.

    Huy Pham
    Huy PhamAuthor
    Associate
    March 25, 2017
    Posted on March 25, 2017 at 16:51

    Thank you very much. Your answer just explained why I can't get any data through USB Virtual COM Port when I try wiring to make it just like Discovery Board. I think I am going to give up that idea. 

    Tesla DeLorean
    Guru
    March 26, 2017
    Posted on March 26, 2017 at 03:41

    Could you get the data to the PC via the NUCLEO's VCP? ie USART2 PA2/PA3 on the F401

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Huy Pham
    Huy PhamAuthor
    Associate
    March 26, 2017
    Posted on March 26, 2017 at 07:46

    I still can get data to the PC using UART. The communication functions normally.