Skip to main content
Visitor II
January 29, 2024
Question

USB gadget

  • January 29, 2024
  • 1 reply
  • 1092 views

 

I have successfully configured USB On-The-Go (OTG) on an STM32 microcontroller to support both Abstract Control Model (ACM) and Human Interface Device (HID) protocols. I utilized the stm32_usbotg_eth_config.sh script as a reference, and the setup is functioning as intended.

Now, I am seeking guidance on modifying the USB configuration to initially support only the HID protocol. Subsequently, I aim to dynamically enable the ACM protocol when specific events occur. To achieve this, I have adapted the script to exclusively open the HID protocol and created another script to open the ACM protocol as well.

While the second script is functional, I have observed that in order to detect the ACM functionality on my Windows computer, I need to disable the gadget (echo "" > UDC) and then re-enable it (echo $(ls -1 /sys/class/udc/ > UDC)) as per the kernel reference.

Is there a method to append an additional function without the need to disable and enable the UDC, or alternatively, is there a way to activate or deactivate functions dynamically while the USB gadget is still operational?

Your insights and guidance on this matter would be greatly appreciated.

Thank you.

1 reply

Douglas MILLER
ST Employee
February 5, 2024

This forum thread was marked by the moderator as needing a little more investigation, so a Support case was created in your name and will be handled off-line.