Showing results for 
Search instead for 
Did you mean: 

stm32u575rit6 USB without Threadx

Associate II

i am working with STM32U575RIT6,
i want to read and write data through USB_OTG_FS (without threadx).
i have externally added the middleware and usb device files (not generated files) to my project.
i am facing a linker error,
all the file paths and the functions declarations are all fine, no errors observed.
whenever i am trying to write code in main.c, i am facing the linker error.
i have attached the images of it, check them and let me know what i need to change.

this is the error in consolethis is the error in console


when code is added in main, i am getting errorswhen code is added in main, i am getting errors


i commented the functions and tested, no errors observed.i commented the functions and tested, no errors observed.





maybe this example helping you :

Nucleo-U5A5ZJ-Q configured as USB-C Host with MSC (mass storage) support

or this, with classic core :


If you feel a post has answered your question, please click "Accept as Solution".
Associate III

Hi @ramyasree,

If you are using ST-USB stack CDC ACM class you can refer to this application delivred by ST


I recommande you to :

  • Include "usb_device.h" in your main.c and

  • Add path of usb_device.h go to : project menu / properties / C/C++ General/ Paths and symbols 

thanks for the reply,
i have gone through the link and added the CDC standalone file system, but the problem is that, during the code generation, the middleware and usb files are not getting generated. check the attached images.
generated source filesgenerated source files


usb otg fs configurationusb otg fs configuration


the usb and middleware files are not generated,
whenever i try to add them externally i am getting the linker error.
so how can i solve this?
am i doing anything wrong in the configuration?
y are the files not generated?

ST Employee

Hello @ramyasree 

Unfortunately, when using CubeMX for classic USB MW applications, you should define paths for MW and backup them before regenerating. To do so, you need to include libraries and add paths as explained @Mohamed_AYED 

I hope this helps!

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.

this is my first time working with external libraries, so can you please share some article which helps me to understand how to add the file paths properly in stmcubeide.
till now i am adding the path by a rightclick on the include folder and click the option "add/remove path".
this is how i have added the files earlier.
i haven't used the properties path as @Mohamed_AYED mentioned.
i have added the images for better understanding, please check and let me know your comments.
all of your responses are much appreciated, as i am new to USB and STM MCU.
i am looking forward to learn more on STM and USB with all of your guidance.

Screenshot (153).png

 this is how i have confirmed the paths are added.

this is how i am adding the paththis is how i am adding the path


i have 2 main.c files if i add the whole CDC standalone file systemi have 2 main.c files if i add the whole CDC standalone file system


the paths are present in the properties window too.the paths are present in the properties window too.