cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F746G-DISCO USBX CDC Com port enumerates but does not connect

justin23
Associate II

Hi All

I am trying to get a USB to serial application working using the STM32F746G-DISCO evaluation board. I have generated the project from STM32CubeIDE for the discovery board, and imported the CDC-ACM code from the ST x-cube-azrtos-f7/STM32F769I-Discovery/USBX/Ux_Device_CDC_ACM project as verbatim as possible.

When the application runs and the USB cable is connected, the COM port is enumerated successfully on Windows. When I try connect to the COM port from any application, the application times out and fails to connect.

The project is attached.

I have tried different projects on different boards with MCUs from the STM32F7 range and have always been met with this outcome.

Please can you assist me in getting this to work.

Thanks in advance.

Justin

 

8 REPLIES 8
FBL
ST Employee

Hi @justin23 

You have added additional code to the CDC-ACM example, try to strip it down to the bare minimum required to establish a connection. This can help isolate the problem.

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.


I'm out of offce with limited access to my emails.
Happy New Year!

Hi @FBL 

Thank you for the reply. I've removed the initialisation code generated by Cube except for GPIO and USB. I've also removed references to the UART added from the x-cube-azrtos-f7 example in the ux_device_cdc_acm.c file. None of this has helped. It still enumerates in Windows but fails to connect from an application.

What else can I try?

Thanks in advance.

Justin

 

FBL
ST Employee

Hi @justin23 

Since it is enumerated on Windows. It seems the issue is more likely linked to your host application. Or maybe there is an issue with the tool being used CubeIDE? Could you please be more precise about the issue ? Do you have to debug your application? How it fails to connect?

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.


I'm out of offce with limited access to my emails.
Happy New Year!

Hi @FBL 

All standard windows applications fail to connect to the USBX com port. These applications connect fine to the same com port if created with the old STM32 USB device driver library. Attached are images of the com port as enumerated on windows, and the error received on Realterm. Realterm appears to be timing out in trying to connect to the com port, and this seems to be the issue in all my other applications as well.

USBXComPort.png

USBXComfail.png

Thanks

Justin

 

FBL
ST Employee

Hi @justin23 

Ok. Would you print debug messages from USB library? I it's indeed enumerated but it seems like it is not configured correctly. I noticed you are not issuing error handlers. Do you have the same when configured in HS mode? 

 

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.


I'm out of offce with limited access to my emails.
Happy New Year!

Just a shot in the dark - in some of the older Cube USB CDC example code the CDC_SET_LINE_CODING and CDC_GET_LINE_CODING control messages did nothing.  And some versions of Windows would not connect to that device.  Implementing those two functions ("set" just saves the values and "get" returns them) allowed the newer versions of Windows to connect.

I have not yet used the USBX stack so I have no idea if that is the issue.  But maybe worth a look.

The UX_SLAVE_CLASS_CDC_ACM_SET_LINE_CODING request is called when the USB cable is connected and when the PC software attempts to connect. This fires the following function without error:

ux_device_class_cdc_acm_ioctl(cdc_acm, UX_SLAVE_CLASS_CDC_ACM_IOCTL_GET_LINE_CODING, &CDC_VCP_LineCoding);

The UX_SLAVE_CLASS_CDC_ACM_GET_LINE_CODING request is however never triggered.

 

How can I configure the USB library to print debug messages?