cancel
Showing results for 
Search instead for 
Did you mean: 

Need CDC-ACM (libusb, HS) Sample, Without UART for STM32U5 – For Real-Time DCMI Data.

saikumar
Senior

 

Hi ST Community,

I'm working with the STM32U5G9ZJT6Q and need to send real-time data from DCMI over USB through CDC . I generated a CDC-ACM project using CubeMX 6.14.0, and by default, it appears as a Virtual COM Port under device manager . Then i used Zadig to replace the driver with libusb-win32, and now the device shows up under libusb devices, ready for high-speed (HS) USB communication.

However, all CDC-ACM examples I’ve found using with UART, which doesn’t meet the performance needs for my video streaming use case.

I’m requesting a sample project or reference code using the STM32U5 USB stack, where CDC-ACM works with libusb (HS mode) and does not rely on UART, so I can send DCMI data directly over USB.

thanks,

4 REPLIES 4
FBL
ST Employee

Hi @saikumar 

 

While we can't provide a specific example for every request, we can assist you in customizing your project using reference board STM32U5G9J-DK2. Start with this example provided for CDC interface and let us assist you troubleshooting issues. Consider sharing minimum project so we can identify the specific problem you're encountering.

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.


hello, mr @FBL 

thanks for your reply,

  • In my earlier project: i used STM32H743ZI2 MCU for  ( USB CDC communication on High speed mode ).
  • By default the code provided proper initialization for USB endpoints, User don't need write  any initialization for receive and transmit . 

      The following functions were available 

  • static int8_t CDC_Receive_HS(uint8_t* Buf, uint32_t *Len);
    (This function was triggered via interrupt whenever the host sent data)
  • uint8_t CDC_Transmit_HS(uint8_t* Buf, uint16_t Len);
    (Used to send data back to the host
  • This made it easy to handle host-to-device and device-to-host USB communication entirely via USB, without using UART.

Now I am using STM32U5  series, as this stack is different .

  1. The callbacks USBD_CDC_ACM_Activate(), Deactivate(), and ParameterChange() are generated empty  
  2. The device enumerates as a Virtual COM Port by default.
  3. When I switch the driver using Zadig to WinUSB (libusb), the device is detected correctly under “libusb-win32 devices,” but no data transmission or reception occurs .  the problem is i don't know how to initialize USBD_CDC_ACM_Activate(), Deactivate(), and ParameterChange() , and   usbx_cdc_acm_write_thread_entry(ULONG thread_input) ,  and  usbx_cdc_acm_read_thread_entry(ULONG thread_input).      functions for my problem  . 

so could you please provide code  to properly initialize the USB CDC_ACM interface for  USB (lib_usb)  use without using UART.

How to set up the  reception and transmission, similar to how CDC_Receive_HS() and CDC_Transmit_HS() worked in my previous working H743ZI2 project.

i uploaded codes for reference.

thanks.

 

Hello @saikumar 

This example uses classic middleware on STM32U5. If you consider using USBX stack, I recommend this example. I'm not sure which driver (lib_usb) will it point.

  • On one side, the STM32 exchanges data with a PC host through USB CDC interface in Device mode.
  • On the other side, the STM32 exchanges data with ST-LINK MCU through UART which could be customized according to your specific requirements.

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.


hello, mr @FBL 

Actually, I have the same requirement as mentioned in this post:

"https://community.st.com/t5/stm32-mcus-embedded-software/how-to-implement-winusb-instead-of-cdc-acm-on-stm32u5-series-mcu/m-p/805629#M63864"

In your reply, you mentioned that we need to use  "https://github.com/STMicroelectronics/stm32u5-classic-coremw-apps/tree/main " .

 

I would like to ask :- instead of requiring a total stack change, is it not possible to update the existing STM32U5 series USB device stack to support WinUSB functionality directly?

This would help a lot , who are already using the default USB stack generated by STM32CubeMX for STM32U5 and want to use WinUSB without major modifications.

Looking forward to your input.

Thanks.