cancel
Showing results for 
Search instead for 
Did you mean: 

How to record audio with CCA02M1 microphones using DFSDM on a NUCLEO-L476RG

Yumasi
Associate II

Hi !

I am trying to do what I feel is a rather simple thing, which is doing the exact same thing as the demo firmware provided as an STM32CubeExpansion for testing the CCA02M1 MEMS microphones on a Nucleo L476RG.

So far, I have gotten to the point where the USB descriptor are properly initialized and I can the board as a microphone as Audacity. There is absolutely no sound coming out of it when I hit the record button however.

I have checked that the microphone works with the demo binary, so I know by solder bridge configuration is good.

I am trying to use a 48kHz sampling rate, with USB driven acquisition being disabled. I also noticed a few oddities alongside the "no sound in Audacity" bit:

  • The record speed in Audacity is a bit slower than with the demo firmware. Meaning a recording a second of "audio" in Audacity actually takes more than a second.
  • When examining the USB frames with an USB analyzer I noticed approximately half of the DATA IN request from Linux are unanswered. So Linux may be too fast for the board. (Which again, does not happen with the demo firmware)
  • I noticed a some "*** callbacks suppressed" messages in dmesg on the host side.
  • If I enable USB driven acquisition, I notice there is some data copied with DMA to the DFSDM output buffer (that would be PCM_Buff) after the board is started. However, as soon as I hit the record button, it is zero-filled and this does not seem to change even though there are DMA transfers and interrupts with DFSDM.
  • Even though, the USB descriptor is initialized and looks using lsusb -vd, I do "device descriptor read/64, error -32" messages in dmesg.

Thanks in advance ! 🙂

3 REPLIES 3
Eleon BORLINI
ST Employee

Hi @Yumasi​ ,

I'm not a direct expert on audio configurations on MCUs, but let me try to answer anyway...

After checking that the solder bridges of the CCA02M1 have been correctly configured for the DFSDM (as described in the user manual of the CCA02M2 and as you probably have already done, since it is not the default configuration, my suggestion is to start from the original MEMSMIC1 firmware and simply verify that the parameter describing the sample frequency in the cca02m2_conf_template.h file is the desired one (and, if not, modify it). It looks like a sync problem among sample frequency and acquisition, and for this reason is important to well tune these two parameter.

-Eleon

Hi @Eleon BORLINI​,

Thanks for your answer. The sampling frequency was indeed different between the MEMSMIC1 firmware, and my project. However, changing it to be the same as in the demo firmware made the board apparently sending so much USB messages it makes my host machine USB bus to reset itself. Do you know what my cause this ? My clock configuration for USB and DFSDM is the same as in the demo firmware.

Hi @Yumasi​ ,

that's very strange you have to reset the machine... can you try it on another PC?

-Eleon