cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use audio codec in STM32CubeMX?

Ali Pourmohammad
Associate II
Posted on June 06, 2017 at 19:48

Hello.

I use STM32CubeMX for programming of a STM32F407 Discovery board.

I want to play a sound using audio codec.

Unfortunately I can't communicate with codec by I2C and I2S.

There is no any sound in headphone.

Is there any simple example for Audio Playing in 

STM32CubeMX without using DMA or Interrupt or USB?

Maybe using a MEMS Mic?

#audio-playing-in-stm32cubemx
5 REPLIES 5
Imen.D
ST Employee
Posted on June 07, 2017 at 14:37

Hi

Pourmohammad.Ali

,

There is no examples available with STM32CubeMx, wehave

the Audio example but with DMA or interrupt within

/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fen%2Fembedded-software%2Fstm32cubef4.html

firmware package available at this path:

STM32Cube_FW_F4_V1.0\Projects\STM32F4-Discovery\Applications\Audio\Audio_playback_and_record

Hopecommunity' users will helpyou with working example.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on June 07, 2017 at 16:26

Dear Imen, Hello.

Thanks a lot for your help.I tried that example but I couldn't communicate with the codec.First I want to communicate with the codec.I use STM32CubeMX compiler and Hal drivers.I activated I2S3 and I2C1 then tried to read the ID register of the codec but it didn't work.I tried it using two different STM32F407 discovery board.May you guide me how can I read the ID register first?

Best RegardsAli Pourmohammad

Posted on June 07, 2017 at 16:28

Dear Imwn,

How can I use Audio_playback_and_record example in STM32CubeMX compiler?

Best RegardsAli

Posted on June 08, 2017 at 15:05

Hi, 

The Audio_playback_and_record example is not to use with STM32CubeMx.

It is a working example to runwith your tool chain as (EWARM, MDK-ARM, SW4STM32, TrueSTUDIO) 
When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on June 08, 2017 at 19:14

Dear Imen,

I read the codec and Hal_Drivers datasheets completely.I wrote a function to initialize the codec first, and play a sound later without using DMA and any interrupt.But it couldn't communicate with the codec.I only need a simple and short example to communicate with the codec in STM32CubeMX 4.13.0 compiler.For example reading the ID register of the codec.

Best RegardsAli Pourmohammad