cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual COM Port with standalone USBX (no threadx or rtos) on NUCLEO-U5A5ZJ-Q board

HH_42
Associate II

Hi all

I want to enumerate a Virtual COM Port on my NUCLEO-U5A5ZJ-Q board, using USBX peripheral in standalone mode. I have followed other articles, but they either use RTOS, or a different device class.

So my question is:

How can I setup the USBX peripheral for a CDC VCP device that can send and receive without Threadx?

Kind regards ☺

2 REPLIES 2
Sarra.S
ST Employee

Hello @HH_42

USBx supports the bare-metal mode, as a reference we have provided a CDC example available under the STM32CubeH7 repo in GitHub, this example can be easily ported to U5: 

https://github.com/STMicroelectronics/x-cube-azrtos-h7/tree/dev/usbx/Projects/NUCLEO-H723ZG/Applications/USBX/Ux_Device_CDC_ACM_Standalone

 

 

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.

Thank you for replying @Sarra.S 

I did attempt to port the code to U5, but I have a different problem. In the section of the code where the USB core is reset, the reset register causes a HAL_TIMEOUT

HH_42_2-1719494571692.png

 

In one of the board's RTOS + USBX examples, the same code runs and the USBx->GRSTCTL register contains 0x80000000 (see highlighted line in image - 1419). This causes the code to proceed. However, in MY application, the very same line of code returns 0x80000001, causing the HAL_TIMEOUT

This happens even when I have a blank project with only USB_OTG enabled in Device On;y Mode and nothing else

Can you please advise on how to proceed? Or what could possibly cause this behavior?

Thanks ☺