2026-04-17 1:11 AM - edited 2026-04-17 1:13 AM
Hey there,
I'm currently trying to port a project that I was using successfully on the STM32U5A5, to the STM32N657.
The project utilises the PDM2PCM library to convert a PDM audio stream received from a MEMS microphone via the SAI interface of the MCU into PCM audio data. It is based on an example from the STM32U3 MCU firmware package (STM32Cube/Repository/STM32Cube_FW_U3_V1.3.0/Projects/NUCLEO-U385RG-Q/Examples/SAI/SAI_AudioRecord_PDM), parts of which I have incorporated into my own application on the STM32U5A5.
I'm now trying to port this project to the STM32N657 on a NUCLEO-N657X0-Q board. I've found the matching PDM2PCM library for the N6's M55 core in the X-CUBE-AUDIO-KIT as mentioned here.
Now, when I integrate this library (libPDMFilter_CM55_GCC_wc32.a) into my project and start the debugger of the STM32CubeIDE it starts printing "Target is not responding, retrying..." in the debugging console as soon as the program flow reaches the call to the PDM2PCM_init function of the library.
It tried to find out if any of the fault handler functions (HardFault_Handler, etc.) are being called but it seems like the debugger just crashes (I have to unplug and plug the USB cable so that I can get it to work again).
I'm just running out of ideas here so any hint or help would be highly appreciated!
Thanks in advance and best regards,
Jens
Solved! Go to Solution.
2026-04-22 1:44 AM
Sure,
You can take a look here
How to use multifunction digital filter (MDF) to capture sound on STM32 MCUs - Application note
also, Audio-kit package provides source code example.
Br
Jonathan
2026-04-20 2:06 AM
Hello,
static void s_enable_CRC_peripheral(void)
{
__HAL_RCC_CRC_CLK_ENABLE();
CRC->CR = CRC_CR_RESET;
}
Br
Jonathan
2026-04-21 3:01 AM
Hey @JonathanC,
thanks for your reply! I’ve already enabled the CRC peripheral clock, as you suggested (I do the same on the U5), but that doesn’t seem to be the actual cause — unless I need to make an additional change in the CubeMX configuration for this to work on the N6.
I’ll spend a little more time on this problem, and if that doesn’t work, I’ll try MDF as a fallback solution, as you suggested.
Best regards,
Jens
2026-04-21 6:13 AM
Hey Jens,
I made a quick test based on the audio-kit package on the DK.
In stm32_audio_capture_conf.h, I forced
//#define UTIL_AUDIO_IN_PDM2PCM_USED (UTIL_AUDIO_PERSIST_CONFIG_get_cur()->audioInUsePdm2Pcm)
#define UTIL_AUDIO_IN_PDM2PCM_USED 1
In Utilities/Audio; add file stm32_audio_pdm2pcm.c to project
In the main call UTIL_AUDIO_PDM2PCM_Init after main_hooks_post_init();
I see no error at init.
I think (it's hard to say for sure again, sorry about that) you may have an issue with memory configuration.
I would suggest you look at the Audio-Kit for :
Br
Jonathan
2026-04-22 12:01 AM
Hey @JonathanC,
thanks again for your tips! It's really very much appreciated!
Unfortunately, I haven't had any luck getting PDM2PCM to work on my board, and since I'm running out of time, I'm going to put that on hold for now and try to get MDF up and running. Maybe I’ll come back to PDM2PCM later, since the topic really bugs me... ;)
Do you perhaps have any tips on tutorials or examples of how to convert PDM data streams to PCM audio using MDF?
Thanks again and best regards,
Jens
2026-04-22 1:44 AM
Sure,
You can take a look here
How to use multifunction digital filter (MDF) to capture sound on STM32 MCUs - Application note
also, Audio-kit package provides source code example.
Br
Jonathan