Skip to main content
Explorer II
December 2, 2025
Question

Is There Any Working UAC2.0 Example for STM32H7?

  • December 2, 2025
  • 9 replies
  • 200 views

I’m trying to build a UAC2.0 (USB Audio Class 2.0) device on STM32H7, supporting:

  • High-Speed USB
  • 24-bit audio
  • Playback + Recording
  • Full-duplex, stable, low-latency operation

After reviewing many threads here, I still haven’t found a complete or working reference.

Previous Threads Don’t Answer the Core Question

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?

 

What I Have Tried (and Why I’m Stuck)

1. X-CUBE-AUDIO-KIT

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.

2. USBX Examples (Azure RTOS)

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.

3. Legacy H7 USBD Audio (UAC1.0)

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.

Moving forward...

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 

    This topic has been closed for replies.

    9 replies

    ST Employee
    December 4, 2025

    Hello, 

    I can answer for the X-CUBE-AUDIO-KIT part of your question, for the rest I let FBL comment.

    As said in other post, ST doesn't support TinyUSB as native stack. However, I can explain the folder tree organization how it is used inside X-CUBE-AUDIO-KIT.

    • USB middleware code is inside the folder `Middlewares\Third_Party\tinyusb`
    • It is configured through a Utility SW called `UsbCls`: 
      • generic source of the wrapper inside the folder `Utilities\UsbCls`
      • Activated thanks to USBCLS_AUDIO_IN_USED and USBCLS_AUDIO_OUT_USED
      • platform dependent code under the folder Projects\STM32H...\Applications\Livetune\Platform\usbCls_Conf
    • User code that implements init according to audio-kit settings (freq, nb channels, etc... :(
      • Utilities\Audio\Src\stm32_audio_usbCls.c
      • You don't need to use Utilities\Audio SW but you can look at `stm32_audio_usbCls.c` where it calls functions prefixed by `usbCls_*`. for instance, inside `UTIL_USB_audio_setup`, `UTIL_AUDIO_USB_deinit`, `UTIL_AUDIO_USB_idle`, etc.... It will help you, see what needs to be called in your application.

     

    • This implementation runs on STM32H573I-DK, STM32H735G-DK, STM32N6570-DK and STM32H7S78-DK
    • It is UAC2.0.

     

    Hope it helps,

    Br

    Jonathan

    audioAuthor
    Explorer II
    December 8, 2025

    Thank you @JonathanC 

    Awaiting response from @FBL 

    Technical Moderator
    December 10, 2025

    Hello @audio 

    Can you explain which threads don’t answer the core Question?

    For STM32H7, recording application development is ongoing and is expected in future release.

    So, there will be soon new release supporting feedback endpoint. We cannot provide any details on release dates.

    About the actual N6 project, now the CubeN6v1.3 supports playback + feedback.

    I hope it's clear !

    audioAuthor
    Explorer II
    December 12, 2025

    Hello @FBL 

     

    This one is still unresolved: https://community.st.com/t5/stm32-mcus-embedded-software/audio-in-ux-device-audio2-0-playback-project-on-stm32h753i-eval2/m-p/861015#M70643

     

    As for the projects, the folder structure is very confusing and could be organized better. For example, middleware and USBX is not organized nicely, and gets very confusing trying to find paths in the IDE project:

    ./Middlewares/ST/usbx
    ./STM32CubeIDE/Application/User/USBX
    ./STM32CubeIDE/Middlewares/USBX
    ./USBX

    For this reason, I still haven't finished fixing the issues every time I build, porting H753 into the N6 project, it is a waste of time, and I still have to go through it. Your project has issues, as I mentioned in the other thread.

    Technical Moderator
    December 15, 2025

    Hi @audio 

    This issue was not reproduced on my end. Unfortunately, I don’t have sufficient bandwidth nor the required tools to analyze, investigate, and debug the screeching issues you mentioned.

    Regarding the attached projects, please note they are not official releases. I try to provide solutions and support to help on the ST Community, but official releases might take some time to be available.

    As for the project folder structure, you are free to tailor it as you see fit. However, the provided structure follows the standard organization similar to what CubeMX generates by default.

    audioAuthor
    Explorer II
    December 15, 2025

    Hello @FBL 

     

    Are there any resources available on how to add middleware files so that I can create my own project to use H753 and still be able to port the N6 files over?

     

    That's more important than anything at the moment. I still want to see the project CubeN6v1.3 on my H753. 

     

    I just don't know how to deal with all the includes header as it is not easily accessible without using the includes path.

     

    Thanks

    Technical Moderator
    December 15, 2025

    Hi @audio 

    Did you try generate code using latest CubeMX version?

    audioAuthor
    Explorer II
    December 16, 2025

    @FBL I don't think I understand. Can you clarify?

    Technical Moderator
    December 18, 2025

    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

     

     

    audioAuthor
    Explorer II
    December 16, 2025

    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:

     

    Moving forward...

    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)

    Super User
    December 16, 2025

    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?

    Circular buffer - Wikipedia

     

    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.

    audioAuthor
    Explorer II
    December 17, 2025

    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. 

    Technical Moderator
    December 18, 2025

    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.

    1. 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.

    2. 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.