cancel
Showing results for 
Search instead for 
Did you mean: 

simpel tone / beep on stm32F7 with wm8994

hjh
Associate III
Posted on August 05, 2015 at 22:25

Hi guys

I try to make a simpel sinusial tone / beep on the STM32F7-Discovery borad but can not find a solution.

Do anybody have the time to show howto ?

Hjalmar
4 REPLIES 4
hjh
Associate III
Posted on August 13, 2015 at 13:01

hi guys 

Do Anybody have a simpel way to make a tone / a beep on the stm32f7 with the wm8994 on..

I try something with :

This one give me a tone, but it do not stop...it continue and the stm32f7 do frezee ........anybody with an idea ?

  1. include ''stm32746g_discovery_audio.h''
  2. include ''stm32f7xx_hal_sai.h''
  3. include ''stm32f7xx_hal_i2s.h''
  4. include ''main.h''
  5. include ''GUI.h''
  6. include ''DIALOG.h''
  7. include ''WM.h''

//Sin table values 

uint16_t Sine550hz

http://www.openstm32.org/128

 = { 32767, 39811, 46526, 52597, 57741, 

61717, 64340, 65486, 65102, 63207, 

59888, 55301, 49660, 43230, 36310, 

29224, 22304, 15874, 10233, 5646, 

2327, 432, 48, 1194, 3817, 7793, 

12937, 19008, 25723, 

32767, 39811, 46526, 52597, 57741, 

61717, 64340, 65486, 65102, 63207, 

59888, 55301, 49660, 43230, 36310, 

29224, 22304, 15874, 10233, 5646, 

2327, 432, 48, 1194, 3817, 7793, 

12937, 19008, 25723, 

32767, 39811, 46526, 52597, 57741, 

61717, 64340, 65486, 65102, 63207, 

59888, 55301, 49660, 43230, 36310, 

29224, 22304, 15874, 10233, 5646, 

2327, 432, 48, 1194, 3817, 7793, 

12937, 19008, 25723, 

32767, 39811, 46526, 52597, 57741, 

61717, 64340, 65486, 65102, 63207, 

59888, 55301, 49660, 43230, 36310, 

29224, 22304, 15874, 10233, 5646, 

2327, 432, 48, 1194, 3817, 7793, 

12937, 19008, 25723};

static __IO uint32_t hjhVolume = 35;

void hjhAudioInit() 

BSP_AUDIO_OUT_Init(OUTPUT_DEVICE_BOTH, hjhVolume, I2S_AUDIOFREQ_8K); 

BSP_AUDIO_OUT_SetAudioFrameSlot(CODEC_AUDIOFRAME_SLOT_02); 

void hjhAudioTone(){ 

BSP_AUDIO_OUT_SetVolume(hjhVolume); 

int res = BSP_AUDIO_OUT_Play((uint16_t*)&Sine550hz

http://www.openstm32.org/0

,sizeof(Sine550hz)); 

GUI_DispDecAt(res, 0, 60,5); 

}

void BSP_AUDIO_OUT_TransferComplete_CallBack() 

BSP_AUDIO_OUT_Stop(CODEC_PDWN_SW); 

}

Amel NASRI
ST Employee
Posted on August 13, 2015 at 13:12

Hi skovholm_hansen.hjal,

wm8994 is used in the example available under STM32Cube_FW_F7_V1.1.0\Projects\STM32746G-Discovery\Applications\Audio\Audio_playback_and_record.

If you can check how this example was implemented, it may bring you some help.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

hjh
Associate III
Posted on August 13, 2015 at 20:51

Hi mayla

I did ...but it takes a file and i can not figure out why it do continue in my code when it have played the array....I am newbie to stm32f7 so mabye thats the reason ;o)

I did hope that somebody did have a quick fix otherwise i will make my own code to talk to the wm8994 but it is not easy so therefore i did want to use HAL ...

Best regards

Hjalmar

misterstarshine
Associate III
Posted on September 16, 2016 at 16:15

Hi.

I've tried that code example you provided and can confirm that it does indeed seem to freeze the board. Have you sorted it out? I'm on the hunt for a very simple example that outputs stereo audio from a memory buffer but with no success.