cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 Discovery: Audio_Playback_And_Record?

flyer31
Senior
Posted on October 28, 2014 at 11:33

The STM32F4 demo board has this very nice Audio_Playback_And_Record demo firmware to show how to use the Codec and the MEMS microphone.

I would like to use this functionality on the STM32F401 chip. Unfortunately the STM32F401 discovery board does not include this firmware example (although Codec and MEMS microphone are present on the board, exactly as on the STM32F4 Discovery board).

Are there some general limitations of the STM32F401 which rule out such audio stuff on this controller? Or anybody has some hints about possible limitations / restrictions, if I use the STM32F401 for such audio applications?

#stm32f401-audio-codec
2 REPLIES 2
Posted on October 28, 2014 at 14:11

Hi,

There are no general limitations/restrictions of the STM32F401 which rule out such audio stuff on this controller. You can use the STM32F401 discovery board to implement such Audio application, by just porting the same project based on the STM32F4 Discovery board.

You can refer also to the 

http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF259243#

, where we deal with this application using the STM32F401-Discovery board.

Regards,

Heisenberg.

flyer31
Senior
Posted on October 28, 2014 at 16:38

Hi,

this is very good news, as it demonstrates that it is principally working - thank you very much.

Just all this cube-HAL base software included there makes it very difficult for me to understand what is really going on.

I have adapted the basic STM32F4 example already to our hardware. But currently I am struggling how to get it run e. g. with half frequency (84MHz - which then is the max for STM32F401). In the clock init file system_stm32f4xx.c I doubled PLL_P from 2 to 4. Then the processor is going to 84MHz. Further I changed the value of the variable ''SystemCoreClock'' to 84000000. Then TIM4 is initilized correctly. Further I included HSE_MHZ=8000000 in the pre-defines in the Compiler project tab.

Now WAV-Playing (on just standard STM32F4 Discovery board) is running nicely, but the Recording has some severe clicking problems. I thought, it might be due to the PDM_Filter_64_LSB Lib function, which is invoked in the I2S Microphone receiver interrupt. I thought that this function maybe needs too much time at 84MHz - it needs about 50µsec but the I2S interrupt fires every about 10µsec. But this function is also present in the Cube demo code. So I need to look somewhere else ... .

If somebody could give me a hint, where I have to turn a wheel to get the Recorder running nicely with half frequency (84MHz) on STMF4-Discovery board, I would be very grateful. (I hope that then it will be also a snap to run it on the STM32F401 Discovery board).

It is very difficult to debug such an audio application because the PDM stream in memory view is somehow not very enlighting :).