2025-11-25 2:07 PM
Hello everyone,
I'm trying to get the USB CDC protocol working with USBX. The hardware is fine because DFU works, and I can flash the board through it. Following a tutorial, I was also able to implement a bare-metal USB CDC device, and everything enumerated correctly and printed data.
I uploaded the USB_CDC example for the STM32WBA65RIVx, and that also enumerated without issues.
(I removed the UART part because I don’t have it; I only tested sending “hello world”.)
Then I tried to integrate USB CDC into my own project, and I got stuck because I couldn't understand why the example works but my IOC configuration does not.
Eventually, I found that enumeration only works if the option UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE is enabled.
When I disable that option, the PC cannot detect my board.
What could be the reason for this?
I increased:
usbx_system_stack_size to 32×1024
usbx_memory_pool_size to 32×1024
Another strange thing: this parameter must be set exactly like this, otherwise enumeration does not happen:
#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 512Even if UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE is enabled, increasing this value stops enumeration. I don’t understand why.
Minimum HEAP and STACK sizes are both set to 0x2000.
Any ideas or suggestions would be greatly appreciated.
I will attach some photos.
Solved! Go to Solution.
2025-11-26 1:16 AM
There are several configuration options for building USB Device CDC-ACM Class. All options are located in the ux_user.h.
UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE macro disables CDC ACM non-blocking transmission support. it is mentioned in readme notes :
CDC ACM non-blocking transmission by default disabled, to enable non-blocking transmission UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE must be disabled and 2048 additional in USBX byte pool and USBX_MEMORY_SIZE.
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.
2025-11-26 1:16 AM
There are several configuration options for building USB Device CDC-ACM Class. All options are located in the ux_user.h.
UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE macro disables CDC ACM non-blocking transmission support. it is mentioned in readme notes :
CDC ACM non-blocking transmission by default disabled, to enable non-blocking transmission UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE must be disabled and 2048 additional in USBX byte pool and USBX_MEMORY_SIZE.
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.
2025-11-26 3:35 AM
Hello, thank you for your response!
I checked the example’s README again and found this section, but I wasn’t able to locate the corresponding settings in my ux_user.h.
The option UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE is present in the file.
However, the part about “USBX byte pool” and “USBX_MEMORY_SIZE” is not present anywhere in ux_user.h.
Unfortunately, I do not understand where these values are supposed to be changed.
The only similar parameters I found are:
usbx_system_stack_size = 32 × 1024
usbx_memory_pool_size = 32 × 1024
These are located in the CubeMX GUI, under USBX parameters, and I believe I have already increased them sufficiently.
I have uploaded all my USBx parameters screenshot under my post, if you could check that too?
Could you please specify more precisely what I need to change and where I should change it?
Sorry if these questions seem basic — this is my first time working with such a complex system.
Thank you!