Skip to main content
Visitor II
June 26, 2024
Question

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

  • June 26, 2024
  • 1 reply
  • 1840 views

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 ☺

    This topic has been closed for replies.

    1 reply

    ST Employee
    June 26, 2024

    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

     

     

    HH_42Author
    Visitor II
    June 27, 2024

    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 ☺