cancel
Showing results for 
Search instead for 
Did you mean: 

How to properly integrate USBX (Standalone) with X-CUBE-FREERTOS on STM32N657

MSGokul
Associate II

Hello Community,

I am working on an STM32N657X0H3Q project and have successfully configured both USBX and X-CUBE-FREERTOS (v1.4.0) within the same Application runtime context using CubeMX. My goal is to implement a USB CDC Composite device.

Since USBX traditionally relies on Azure RTOS (ThreadX) for its RTOS primitives, I am seeking the recommended best practice  for running USBX on a FreeRTOS-based system.

 

  1. Should I configure USBX in standalone mode? If running USBX in Standalone mode, what is the best way to handle thread safety when accessing the USB CDC interface from multiple FreeRTOS tasks? 
  2. Are there any known issues using the USBX Composite Builder when the underlying kernel is FreeRTOS instead of ThreadX?
1 REPLY 1
FBL
ST Employee

Hello @MSGokul 

I would suggest starting for standalone project you can refer to this article: How to implement USBX in standalone mode then you can to integrate FreeRTOS you can refer to this article :  How to add USBX to an STM32 FreeRTOS™ project 

  • Delete from main.c → in main loop : USBX_Device_Process(NULL);
  • Add to app_freertos.c → in StartUSBTask(): call USBX_Device_Process(NULL);

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