Skip to main content
Associate II
December 11, 2025
Question

STM32H743 – USB Microphone: Best way to transfer DFSDM audio data to USB Audio IN?

  • December 11, 2025
  • 2 replies
  • 436 views

 

Hi everyone,

I’m working on an audio project with an STM32H743ZIT6 and a MEMS microphone (MP34DT05-A). Audio is captured via DFSDM + DMA, and the DMA callback (HAL_DFSDM_FilterRegConvCpltCallback) fires reliably with fresh PCM audio samples.

At the moment, I am transferring the audio data to the USB Audio IN endpoint directly inside the DFSDM callback using:

USBD_LL_Transmit(pdev, AUDIO_IN_EP, buffer, packet_size);

To avoid overlapping transmissions, I set a busy flag until the DataIn callback (from the USB stack) fires. Only then do I allow the next USB packet to be sent.

This works in the sense that nothing crashes, but the actual audio stream never “starts” on the PC (e.g., in Audacity the recording stays silent and no data seems to flow).
So now I am unsure whether my current design is fundamentally flawed.

What is the correct way to link DFSDM audio → USB IN endpoint? Is it recommended to send directly from the DFSDM callback (as I do now) or push the data into a ring buffer and let a USB-SOF-driven scheduler feed the IN endpoint every 1 ms? 
How do I ensure that USB frames are served precisely every 1 ms?

If anyone has guidance, best practices or a minimal working example, I’d appreciate any help.

Thanks!

2 replies

Technical Moderator
January 15, 2026

Hi @MannyMarc35 

Do you reproduce using a reference board?

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
Associate II
January 19, 2026

Hi @MannyMarc35 
I think the best approach is to store the audio data from the DFSDM callback into a ring buffer instead of sending it directly to the USB endpoint. Then, use a timer to regularly read data from the ring buffer every 1ms and send it to the USB Audio IN endpoint.

See this video: https://www.youtube.com/watch?v=q_ZujMfFz7s&t=4s