2024-11-27 01:35 AM
Hello everyone,
I've been struggling a lot recently trying to make this code work.
This project uses a STM32F746G DISCOVERY microcontroller.
I tried to make a simple project, heavily inspired by the BSP driver example, with the objective of recording through the boards integrated microphones, and playing it back after.
This code's function were taken from the STM32F746G DISCOVERY BSP examples, particularly the "audio_play.c" and "audio_rec.c" files.
The code is supposed to work as follows : Press the user button that generates an interruption to start recording. Using the integrated MEMS microphones (x2 MP34DT01-M), we record the sound produced and store it in the SDRAM, to play it back once the audio blocks are filled. The audio is played back in a loop.
Once the user button is pressed again, we come back into the default state, where we wait another button press to start recording again.
The code can be compiled and flashed without any issues, but after recording, the playback is just loud random noise, instead of the sound produced into the microphone (human voice).
As for the configuration :
System Core :
- GPIO : PI11 (user button) interruption enabled
Connectivity :
- USART1 to input messages to a serial monitor (putty)
- FMC (for the SDRAM 1)
Multimedia (the one worth checking out) :
SAI A (for audio recording)
SAI B (audio playback)
DMA :
If you need any more information, here's a link to the project if you want to check it out with more detail : https://github.com/Tresnov2142/Mic_recorder_V3
I'd really appreciate any help on this matter.
Thank you in advance
2024-11-27 08:57 PM
questions:
hardware, do you use STM32F746G DISCOVERY board ?
firmware, did you try with original project from ST ? like: STM32CubeF7/Projects/STM32746G-Discovery/Applications/Audio/Audio_playback_and_record at master · STMicroelectronics/STM32CubeF7 · GitHub
2024-11-28 04:57 AM
Thank you for replying,
I did run some of the original ST examples, and they work perfectly fine. The microphone works, so it's not a hardware issue.
It's probably memory management, or some misconfiguration, in my project.