2025-03-14 7:57 AM
Hi
I am in the need to have USB working on the STM32U5G9DK2 board, however I specially do not need ThreadX, so I will configuring USBX in standalone mode. And I do not need to be using UART to complement my sample code as a lot of the sample codes found on CUBEIDE do.
What I am looking for is to communicate the board with a terminal on my PC using the USB port rather than the ST-LINK.
So far after configuring IOC and complementing main.c with some initialization, I am able to have the PC recognize the board as a Serial Device, which is half the battle. The problem now is figuring out how to send and receive data to and from the PC (I am using a Teraterm terminal).
To compliment the information I am providing here, I started by getting the sample code Ux_Device_CDC_ACM, which uses ThreadX and USBX, from which I replaced the used of the UART and instead use both Send and Received Threads to communicate with the Teraterm terminal on the PC, which works well. My issue is that the overhead and complexity ThreadX as well as my application requirements makes the use ThreadX not attractive at all.
So I just need USBX in standalone mode on the U5.
Any help will be much appreciated.
2025-03-14 8:58 AM
Hi @GustavoGalan ,
You can refer to this application Ux_Device_CDC_ACM_Standalone
2025-03-25 8:40 AM
Thanks for the response. The issue is that the USBD_CDC_ACM_Activate never gets called, thus the cdc_acm class never gets instantiated
cdc_acm = (UX_SLAVE_CLASS_CDC_ACM*) cdc_acm_instance;
causing the program to crash when the cycle process is attempted to be executed making reference to cdc_acm.
Any help will be greatly appreciated.