2024-05-20 11:21 PM - edited 2024-05-21 01:14 AM
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
2024-05-21 08:12 AM
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.
2024-05-21 11:16 PM
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
2024-05-23 11:16 AM
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.
2024-05-23 11:46 PM
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.
Thanks
Justin
2024-05-24 08:54 AM
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.
2024-05-24 12:16 PM
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.
2024-05-27 05:53 AM
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.
2024-05-27 06:18 AM
How can I configure the USB library to print debug messages?