2026-03-04 12:15 PM
I'm trying to get a basic example of USB comms working on an STM32U575 chip working. I've looked into several bits of example code, but they all just say "it should just work" and don't.
STM32CubeU5 Example. This seems like a logical choice, as it's packaged in the FW pack that I'm currently using. But I can't get the VSCode STM32Cube extension to recognize that it's a project and build. I've tried moving the STM32CubeIDE directory contents (.cproject, .project, etc.) to the root of the application directory, but it's still not being recognized. Also, looking into Core directory, I don't see any code that demonstrates USB data transfer. It looks like a template for starting with AzureRTOS, but nothing beyond that. What am I missing?
USB_Device Middleware. This is one example that describes using a middleware called USB_DEVICE, and then calls to a function CDC_Transmit_FS(). There are several other examples floating around with this. However, I can't find that middleware and I also can't find that function anywhere in the included files when I enable the USBX middleware. (The last one is somewhat obvious, but I'm not really seeing much to help me decipher things). Is the USB_DEVICE middleware deprecated? Or only for other MCU families?
Are there any other examples I can try out that will work out of the box so I can poke around the code?
Also, because I need higher bandwidth than the USB FS can provide, I'm already planning on upgrading to the H7 series. So if there's a better/more reliable example for the H7 Nucleo board, I'm open to try that.
2026-03-05 5:34 AM - edited 2026-03-24 8:16 AM
Hello @sethkaz
>but it's still not being recognized.
For the firmware example of the USB CDC project, did you manage to run it on STM32CubeIDE before porting it to Visual Studio Code?
>I don't see any code that demonstrates USB data transfer.
USB data transfer occurs through these functions after creating and initializing the thread. You should look for the following functions:
VOID usbx_cdc_acm_write_thread_entry(ULONG thread_input)
VOID usbx_cdc_acm_read_thread_entry(ULONG thread_input)
I will attach a project that demonstrates a simple CDC transmit using NUCLEO-U545 and USBX. You can use it as a reference.I also attached a project on STM32H743 which uses ST middleware as reference if you want.
>However, I can't find that middleware
We primarily use two middlewares in our STM32 products: ST USBX middleware and ST classic middleware. The middleware you mentioned is ST classic middleware.
STM32U5 series uses USBX as native middleware, which is why you did not find the specific function in your project.
If you want to learn more about USBX you can consult this WIKI or this documentation.
ST middleware is natively used in products like STM32H7 or STM32F4.
To learn more you can seek "1.3 Middlewares" of this article.
>because I need higher bandwidth than the USB FS can provide
Because you need higher bandwidth than USB FS can provide, I recommend using a product that supports USB HS. in STM32H7 There are several examples available for boards that already supports USB HS which you intend to use, such as this one.
I should point that USB HS require additional hardware implementation if you are using a custom PCB design board. or STM32 boards (ex: NUCLEO) that does not have external USB HS transceivers by default.
BR
Gyessine
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.
2026-03-17 12:23 PM
Hi Gyessine,
> For the firmware example of the USB CDC project, did you manage to run it on STM32CubeIDE before porting it to Visual Studio Code?
No, I was not able to get it to compile in STM32CubeIDE either.
Thank you for the explanation of the middlewares.
I am switching to the H7 board. I'm specifically trying out the Nucleo-H7S3L8 board. I'm using the example I found here. Unfortunately, it also doesn't compile in STM32CubeIDE or the VSCode extension. I looked at the instructions for getting it running in STM32CubeIDE on the readme, but the instructions were not clear. It asks me to find the Project->Debugger Configuration. I don't have that menu option in STM32CubeIDE 2.1.0. I found an external loader window by selecting the menu item Run -> Debug Configurations, then selecting the CDC_Standalone_Boot Debug. Then selecting the Debugger tab, I find an External Loaders section.
I also can't find the MX25UW25645G_STM32H7S3L8-NUCLEO.stldr file to use. I tried copying that in, but the IDE complained it couldn't find it. I did find the MX25UW25645G_NUCLEO-H7S3L8.stldr. I assume this is ok?
I also found MX25UW25645G_NUCLEO-H7S3L8-XSPIM1.stldr and MX25UW25645G_NUCLEO-H7S3L8-OBL.stldr. I'm not sure if those make a difference or not.
When I try to build, I get this error:
Errors running builder 'CDT Builder' on project 'CDC_Standalone_Boot'.
Cannot invoke "com.st.stm32cube.common.mx.registry.IIdeHelper.getRootProject(org.eclipse.core.resources.IProject)" because the return value of "com.st.stm32cube.common.mx.registry.MxRegistry.getIdeHelper()" is nullWhat do I need to do to get this functional?
2026-03-24 8:18 AM
Hi @sethkaz
Would you share your project? Did you check the following article around STM32CubeIDE: How to debug an STM32H7Rx/Sx project.
This can be helpful in your case.
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.
2026-03-24 10:35 AM
Hi FBL,
I don't mind sharing the project, but it's literally a copy of the examples from the repo. I tried compiling the template that's listed at the top of the guide you linked and the USB example that I linked earlier.
As I mentioned above, I'm getting an error of:
Errors occurred during the build.
Errors running builder 'CDT Builder' on project 'Template_XIP_Boot'.
Cannot invoke "com.st.stm32cube.common.mx.registry.IIdeHelper.getRootProject(org.eclipse.core.resources.IProject)" because the return value of "com.st.stm32cube.common.mx.registry.MxRegistry.getIdeHelper()" is nullI'm following the readme to make my program work, but the instructions aren't clear. Please confirm:
1. "Open your toolchain." Means to open STM32CubeIDE, correct? Is there a secondary toolchain that needs to be opened in addition to STM32CubeIDE?
2. Open "Multi-projects Workspace file .project" is the one located here. Correct? (I was able to open it after I installed python3-tk, as the import was failing due to that being missing)
3. "Select the 'Template_XIP_Appli' project" should just be selecting it in the Project Explorer, correct?
4. Building should be just right clicking on the project title and selecting "Build Project". Correct?
I'm asking all these because it feels like I'm missing something basic that is assumed but isn't showing up as a problem elsewhere.
As in, do I need to import this in a special way? Do I need to copy the example project out of the ~/STM32Cube/Repository/STM32Cube_FW_H7RS_V1.3.0 directory?
2026-03-24 2:23 PM - edited 2026-03-24 2:24 PM
> CDC_Standalone
> Nucleo-H7S3L8 board
If I try this example via the Example Selector in STM32CubeMX, it generates the project and compiles just fine (both boot and application). Make sure you change the toolchain to STM32CubeIDE. Click "Generate Code" then "open project" when it completes.
Maybe try loading the project that way. Toss the tutorial.
2026-03-24 2:52 PM
Thank you for the response. I generated the code in CubeMX and opened it into the IDE, but I'm still getting the same error.
Did you generate that on Linux, Windows, or other?
2026-03-24 3:33 PM - edited 2026-03-24 3:35 PM
Windows. Latest versions of STM32CubeIDE and STM32CubeMX. Can you zip up your project and attach? Are you on updated versions? (though it should work fine in previous ones as well)
Should look like this in the explorer:
Are there spaces or non-ascii characters in the path?
2026-03-24 3:50 PM