2025-12-02 7:52 AM - last edited on 2025-12-02 8:01 AM by Saket_Om
I’m trying to build a UAC2.0 (USB Audio Class 2.0) device on STM32H7, supporting:
After reviewing many threads here, I still haven’t found a complete or working reference.
Here are some related ST Community posts with no clear resolution:
Across all of these, the same question remains unanswered:
Is there a working UAC2.0 reference for STM32H7?
Not to be confused with X-CUBE-AUDIO (last updated 2019). Reference: X-CUBE-AUDIO-KIT
The audio kit focuses heavily on LiveTune and doesn’t explain the folder structure or how to adapt it for UAC2.0 device work. Most forum replies simply say "look at X-CUBE-AUDIO," but there is no clear documentation on how to integrate it into an actual USB audio project.
I looked into:
Both use UAC2.0, but neither is fully functional. There are several issues (audio distortion, buffering, pointer handling, feedback endpoint logic, etc.) that prevent reliable playback, let alone adding recording.
I also evaluated STM32WBA-BLE-USBx Standalone, but porting it to H7 requires major rewrites and may not be compatible with the existing H7 USB stack.
I considered starting from the H7 USBD Audio Standalone UAC1.0 example and updating it manually to UAC2.0, bypassing USBX entirely, but I’m unsure whether this is practical or recommended.
I’m currently unable to move forward with actual development because I’m spending all my time debugging:
ring-buffer logic bugs
incorrect pointer handling
missing wrap-around
feedback endpoint issues
unexplained artifacts (e.g., a loud screech at 4–5 seconds)
Before I continue down another rabbit hole, I need a clear answer:
What is the correct, supported path to get UAC2.0 working on STM32H7?
Any guidance from ST experts would be greatly appreciated. @FBL @JonathanC
2025-12-16 8:02 AM
@FBL I don't think I understand. Can you clarify?
2025-12-16 8:29 AM
I don't think you and I are understanding each other. Is it possible that I can talk to someone real-time, real quick so that they can understand what I'm asking for? I have H7 and you're recommending me to use software available on N6, and I'm asking for porting help. No matter what I do, the sound I am getting is not at all clear, and I've mentioned that in the main post, which I will repeat down here:
I’m currently unable to move forward with actual development because I’m spending all my time debugging:
ring-buffer logic bugs
incorrect pointer handling
missing wrap-around
feedback endpoint issues
unexplained artifacts (e.g., a loud screech at 4–5 seconds)
2025-12-16 2:55 PM
I think you may be over-estimating the support ST is willing and able to provide. You should expect to handle the vast bulk of the programming yourself. This forum is not a code writing service.
> ring-buffer logic bugs
> incorrect pointer handling
Nothing about these is N6-specific, or even STM32-specific. These are general programming constructs for which there are many resources available. Why are there issues with these rather simple constructs? Whose code is this?
This forum is better for specific technical questions rather than broad requests.
There will never be a generic guide to porting code with specific instructions as that rather depends on the code that needs to be ported. Some files you just drag/drop into the new project. Some files will require changes to low-level peripheral handling. If nothing in them is N6- or H7- specific, just copy them over. That should be the majority of things.
At a broad level, create a new project in STM32H7 and bring over files one by one. You may be able to configure most things in STM32CubeMX but it may not be possible to fully port everything with the clickable configuration options.
Broadly, try it, and if you are stuck, you can ask specific technical questions with supporting information and code which generally get answered quickly and answered well.
2025-12-17 6:23 AM
You are absolutely correct @TDK
The issues I am having are due to the example codes I get from CubeMX. I used Ux_Device_Audio2.0_Playback example code, and it is made for the board STM32H743i-eval board, and the H753i-eval is compatible.
I run it, and the example code is already flawed. Right off the bat, running the code lands you a hard fault, which is due to improper writer pointer overflow.
I fixed that. Then another issue comes up, so I've summarized the issues to the best of my ability to that list. I'm not by no means an expert, which is why I resorted to here. I've mentioned this in the other threads, which lead me to this thread.
So it was my expectations that the example code would be working, although incomplete, but working. There is also a lot of Ux (Azure USBX) files and there's not enough documentations to guide me through that, so I'm really learning on my own.
FBL redirected me to N6, so I wanted to know how to port that over to H7. I did start with the new project and started to transfer files over, but even when the project runs, the audio is much worse than before, it is inaudible. Which led me to believe two things:
1. That code is for N6 as there are different architecture and is not available in H7 (maybe different RAM size, or even a different component on the development board).
2. The MX generation creates a folder structure that may use different include paths that I may not be aware. It's like that idea that you have too many files, and you think it's using all that files, but it's not, and only uses few files, so there's less overwrites or whatnot. Again, I'm not an expert so I might be talking gibberish. But I do feel that the software is too bloated.
2025-12-18 4:04 AM
Hi @audio
You can check this article Downloading STM32Cube packages from GitHub correct... - STMicroelectronics Community. To download an STM32Cube package without compilation errors, you have to clone the repository along with the linked submodules using git clone example below:
git clone --recursive https://github.com/xxx
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.
2025-12-18 4:38 AM
Thank you @audio for your feedback!
As @TDK pointed out, this forum is intended to provide technical guidance and support rather than complete code development.
To effectively work with the N6 USBX examples and port them, a minimum understanding of the N6 architecture is essential. I recommend reviewing UM3249 as a reference to port projects. However, it’s important to start from the example I provided to ensure a proper baseline, diverging too early can cause confusion.
Regarding your concerns about CubeMX code generation, they are starting points and often require adaptation, I encourage you to share specific issues on the ST Community so they can be tracked and addressed.
Please continue to share specific technical questions or issues you encounter.
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.