Skip to main content
Associate
April 25, 2025
Solved

STM32F4 USBX CDC-ACM Bulk IN endpoint Stall

  • April 25, 2025
  • 1 reply
  • 554 views

I am looking for help solving a CDC-ACM problem with Azure Rtos ThreadX, and the USBX Middleware for STM32F4.

My device is an STM32F427VGTx.

I currently have a project that uses the USBX host library. I am connecting up to 4x CDC-ACM devices through an off-the-shelf USB Hub.

I had problems connecting multiple devices through the hub, but I have solved that after following the solution to update the USBX core bsp from the stm32-mw-usbx repo. (STM32H7 and USB2514 Continued Problems)

 

I can connect to all 4x CDC-ACM devices (data class instance and control class instance enumerate successfully on all devices).

I can send commands to all devices using the control interface by sending a transfer request to the control endpoint.

I can read from up to two CDC-ACM devices, but the third and fourth device will timeout after calling ux_host_class_cdc_acm_read. The function returns a transfer-request-timeout after failing to retrieve the ux_host_semaphore. The status of ux_host_semaphore_get is always TX_NO_INSTANCE and is set by tx_semaphore_cleanup() after semaphore timeout in a thread.

I am calling ux_host_class_cdc_acm_read inside a thread. It works for up to two devices. The first two still work while the third and fourth don't.

Best answer by akorsich

I have resolved the problem by reducing the amount of endpoints used in each CDC-ACM device.

 

For anyone struggling with a similar problem, count how many endpoints you are using.

The STM32 USB Peripheral has up to 8 endpoints. After reducing to two endpoints each (BULK IN, CMD OUT) I am able to succesfully connect and communicate with 4 CDC-ACM devices.

Our CDC-ACM devices was built using STM32G4 and the initial example used 4 endpoints (BULK IN, BULK OUT, CMD OUT, ISOCHRONOUS). That was why I could only connect to two devices before.

 

Thank you @FBL for the advice.

1 reply

Technical Moderator
May 7, 2025

Hi @akorsich 

Are you interfacing low speed devices? You may need to check this limitation section 2.14.2 Host packet transmission may hang when connecting through a hub to a low-speed device.

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.Best regards,FBL
akorsichAuthorAnswer
Associate
May 7, 2025

I have resolved the problem by reducing the amount of endpoints used in each CDC-ACM device.

 

For anyone struggling with a similar problem, count how many endpoints you are using.

The STM32 USB Peripheral has up to 8 endpoints. After reducing to two endpoints each (BULK IN, CMD OUT) I am able to succesfully connect and communicate with 4 CDC-ACM devices.

Our CDC-ACM devices was built using STM32G4 and the initial example used 4 endpoints (BULK IN, BULK OUT, CMD OUT, ISOCHRONOUS). That was why I could only connect to two devices before.

 

Thank you @FBL for the advice.