Skip to main content
Associate III
October 7, 2026
Question

STM32N6570-DK + MP23DB01HP on MDF1: recommended CIC/gain/HPF/PDM-clock settings for 16 kHz audio, and start-up thump

  • October 7, 2026
  • 0 replies
  • 5 views

Hi all,

I'm recording 16 kHz mono audio from the on-board digital MEMS mic (MP23DB01HP) of the STM32N6570-DK using the BSP's MDF path (MDF1, filter 0, PE2 MDF1_CCK0, PE8 MDF1_DATIN0, GPDMA1 channel 0, SPI mode, falling edge). The recording runs next to a camera/ISP pipeline, an NPU model and an H.264 encoder, so I want the audio path to cost as little CPU as possible and sound clean.

Current setup (BSP defaults for 16 kHz)

  • Kernel clock: IC8 from PLL4 = 50 MHz (HSI-based), PROCDIV = 2, CCKDIV = 12, so the PDM clock is about 2.08 MHz
  • CIC: Sinc4, R = 32; reshape filter on, ÷4 (total decimation 128)
  • Gain +2 (about +6 dB); HPF 0.000625 × fPCM (about 10 Hz)
  • Async continuous acquisition, circular DMA into a 16 KB buffer

What I tried
I built a test firmware that records one clip per MDF configuration (5 s each, one config per boot) and compared them offline. Configs: Sinc4 vs Sinc5 R = 32 (gain steps −7, −8, −9), HPF at 10, 20, 40 and 152 Hz, a PLL4 retune to 81.92 MHz with IC8 ÷ 10 for an exact 2.048 MHz PDM clock (AN5795 Table 19), and R = 16 with a 1.024 MHz PDM clock.

What I saw

  • Sinc5 at gain −8 gives the same loudness as Sinc4 at +2 (the extra CIC gain is about 30 dB, which matches the gain steps).
  • With the 10 Hz HPF, every clip has a DC offset (about 0.04 of full scale) and a start-up transient: the first 0.5 s is 10 to 12 dB louder and clips, and it decays over about 4 s. Cutoffs of 20 Hz or higher remove the DC and much of the thump.
  • R = 16 with a PDM clock of about 1 MHz gave mostly silence (about −71 dBFS) with loud bursts. The 2 MHz configs worked fine.
  • My timing is HAL-tick based, and it reports about 15.9 kHz for the 50 MHz configs and about 15.6 kHz for the retuned clock. The ratio between the two matches the design, but the absolute values are about 2.4% lower than I calculated. I think my tick is the source of the offset, but I'm not certain.

Questions

  1. Is there an official recommended MDF configuration for the MP23DB01HP at 16 kHz? Which PDM clock range and which CIC order should I use?
  2. What is the mic's start-up (power-up and ready) time? Is a thump at the start expected, and is the normal fix to discard the first few hundred milliseconds in software?
  3. Is it safe and supported to reconfigure PLL4 at runtime (as I do for the exact 2.048 MHz clock)? Is using the HSE (48 MHz) as the PLL source recommended for an accurate audio clock?
  4. Is NORMAL_SPI mode fine here, or should I use LF_MASTER_SPI as AN5795 suggests for digital mics?
  5. Any known issue with calling BSP_AUDIO_IN_DeInit followed by BSP_AUDIO_IN_Init repeatedly? In my test, the 3rd init in the same boot failed (the first two worked), so I now reboot between configs. I haven't tracked down the cause.

References: RM0486 section 35 (MDF) and Table 290, AN5795.

Thanks!