Skip to main content
Visitor
June 9, 2026
Question

USBX CDC ACM example RAM usage

  • June 9, 2026
  • 0 replies
  • 14 views

Hello,

I am working with the official USBX CDC ACM example for the NUCLEO-C071RB:
https://github.com/STMicroelectronics/STM32CubeC0/tree/main/Projects/NUCLEO-C071RB/Applications/USBX/Ux_Device_CDC_ACM

Hardware: STM32C071RBT (128 KB Flash, 24 KB RAM)
Firmware: STM32Cube FW_C0 V1.4.0
Toolchain: STM32CubeIDE 2.1.1

The example runs successfully on the NUCLEO-C071RB board. However, after analyzing the RAM usage I am concerned about available headroom for my application.

Current RAM usage (from .map file):
- .data:  116 B
- .bss:   23628 B  (including ux_device_byte_pool_buffer: 8192 B, tx_byte_pool_buffer: 1024 B, three RTOS threads: 3x176 B)
- ThreadX heap (._threadx_heap in .ld): 4096 B
- Stack + Heap: 1536 B
- Total: 23744 B
- Free: 832 B (out of 24576 B)

Current configuration:
- UX_DEVICE_APP_MEM_POOL_SIZE = 8192 (app_azure_rtos_config.h)
- USBX_DEVICE_MEMORY_STACK_SIZE = 4096 (app_usbx_device.h)
- TX_APP_MEM_POOL_SIZE = 1024
- ThreadX heap in .ld = 4096 B

I need to add additional peripherals (UART, I2C, ADC) to this project which will further increase RAM usage.

My questions:
1. What are the safe minimum values for UX_DEVICE_APP_MEM_POOL_SIZE and the ThreadX heap size for a stable CDC ACM implementation?
2. Is there a recommended approach to reduce USBX + ThreadX RAM footprint on devices with only 24 KB RAM?
3. Is the standalone USBX (without ThreadX) a viable option for the STM32C071, and if so, is there a working example available?
I tried https://github.com/ST-TOMAS-Examples-USB/c071_usbx_cdc but it’t not enumerating / creating Hard Faults.

Thank you.