How to notify "notification" when using "USBX Device CDC ACM"

公郎 金丸 20 Reputation points
2024-02-01T04:50:06.54+00:00

Hi. We use "USBX Device CDC ACM". We want to set Notification(SERIAL_STATE) for "Flow control". But, USBX does not have no API function for setting Notifications. How should I set "Notification" when using "USBX Device CDC ACM" ? Best Regards.

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
329 questions
0 comments No comments
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 13,956 Reputation points
    2024-02-01T20:33:08.59+00:00

    Hi @公郎 金丸 Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.

    Looking into the implementation of USBX repository, I noticed that the value for serial state notification has been defined in the header file ux_host_class_cdc_acm.h Below is the declaration for the parameter

    #define UX_HOST_CLASS_CDC_ACM_NOTIFICATION_SERIAL_STATE         0x20
    
    

    You can try modifying the value defined for it in your local code sample and see if the changes are reflected. I have looked up to see the acceptable values for the parameter and could not find the appropriate value for Flow control. Please let us know if you have found the value that needs to be set to achieve this.

    Hope this helps!


    If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.


1 additional answer

Sort by: Most helpful
  1. Sedat SALMAN 13,345 Reputation points
    2024-02-01T08:12:20.4566667+00:00

    Hello As I know there is no API call for this

    but I think you can extend USBX CDC class ti send notifications

    Its been a long time but i have used the following document

    to implement

    https://community.st.com/t5/stm32-mcus/how-to-implement-the-usb-device-cdc-vcom-in-stm32-using-the/ta-p/599170