cancel
Showing results for 
Search instead for 
Did you mean: 

recording audio on STM32H735 discovery kit

Pouya Rostam
Associate II

Hey folks,

I am trying to record the audio on STM32H735 discovery kit, but the callback functions (BSP_AUDIO_IN_TransferComplete_CallBack) never been called. I also tried the BSP example for the board; however the audio recording demo is not working there too!

Any help would be appreciated.

9 REPLIES 9
Bouraoui Chemli
ST Employee

Hi @Pouya Rostam​ 

Which package and example did you use? What is the message of error ?

In order to identify the problem and see when it occurs, I suggest you to debug and localize where the code hangs/stop. You can set more breakpoints in your project.

Bouraoui

Pouya Rostam
Associate II

Thank you for the help. I used STM32CubeIDE and just went with the BSP example (without any change) for the board (STM32H735g-dk). There is not error message, but the Audio LOOPBACK demo is not working.

Stefan Meyre
Associate III

same question here; BSP example talks about "press TAMPER button for next menue" but there is no TAMPER button. Touch works and User button brings you to next example, but I cant get into the different audio_in and audio_out states of the audio_loopback.c example (recording; playback etc.)... what did I miss?

senthil
Associate II

I am also get same problem No sound hear From MIC

akbjk.1
Associate II

Same question here.

I can get the headphone/line_out output working with the example provided (BSP, SAI example).

I can't get the mic2 working in the BSP example.

I can't get the line_in working in the BSP example.

Instance 0 of the driver use SAI1A and require a solder bridges change.

Instance 1 use (PDM, SAI4) and 2 use DFSDM, same pins as SAI4) and require no solder bridges change.

I orginaly tested instance 1 and 2. Nothing was working.

Since I have a STM32F746G (I'm porting some old F7 project to H7, and the everything like screen, touchscreen etc were ported ok but the audio) that has the mic2 wired differently, I tweaked the solder bridges to have the same mic2 configuration (so to the wm8994 codec, using instance 0 and SAI1A).

I quickly found the the driver is not tested for this use, since it lacks a WM8994_Probe() call in BSP_AUDIO_IN_Init(), but I easily copied it from BSP_AUDIO_OUT_Init().

There were also two defines:

//HAL_StatusTypeDef MX_I2S6_ClockConfig(I2S_HandleTypeDef *hi2s, uint32_t SampleRate);

//HAL_StatusTypeDef MX_I2S6_Init(I2S_HandleTypeDef* hi2s, MX_I2S_Config *MXConfig);

That prevented the compilation, probably some stuff from another H7 MCU the driver was copied and adapted from.

I checked that the mic2 received a clock and sent PDM values to the codec and that was the case.

But I receive only zeros from the codec itself, so the driver doesn't work at all for all inputs configurations.

I checked the codec i2c configuration, and it is the same as the one from the STM32F746G's one.

So the problem is in stm32h735g_discovery_audio.c or in wm8994.c.

I even tried to slightly modify the i2c config so it send exactly the same as for my STM32F746G that works:

write to 0x1A ack data: 0x00 0x00

read to 0x1A ack data: 0x89 0x94

write to 0x1A ack data: 0x00 0x00 0x00 0x00

write to 0x1A ack data: 0x01 0x02 0x00 0x03

write to 0x1A ack data: 0x08 0x17 0x00 0x00

write to 0x1A ack data: 0x01 0x02 0x00 0x00

write to 0x1A ack data: 0x00 0x39 0x00 0x6C

write to 0x1A ack data: 0x00 0x01 0x00 0x13

write to 0x1A ack data: 0x00 0x04 0x0C 0x30

write to 0x1A ack data: 0x04 0x50 0x00 0xDB

write to 0x1A ack data: 0x00 0x02 0x60 0x00

write to 0x1A ack data: 0x06 0x08 0x00 0x02

write to 0x1A ack data: 0x06 0x09 0x00 0x02

write to 0x1A ack data: 0x07 0x00 0x00 0x0E

write to 0x1A ack data: 0x02 0x10 0x00 0x83

write to 0x1A ack data: 0x03 0x00 0x40 0x10

write to 0x1A ack data: 0x03 0x02 0x00 0x00

write to 0x1A ack data: 0x02 0x08 0x00 0x0A

write to 0x1A ack data: 0x02 0x00 0x00 0x01

write to 0x1A ack data: 0x00 0x01 0x00 0x13

write to 0x1A ack data: 0x06 0x20 0x00 0x02

write to 0x1A ack data: 0x04 0x11 0x38 0x00

write to 0x1A ack data: 0x04 0x00 0x01 0xEF

write to 0x1A ack data: 0x04 0x01 0x01 0xEF

write to 0x1A ack data: 0x04 0x04 0x01 0xEF

write to 0x1A ack data: 0x04 0x05 0x01 0xEF

But it still doesn't work on that H7.

I have measured the I2S waveforms on the STMOD+, and I get it right. I'm using 48kHz, so I've a 48kHz L/R clock, with a 3.125MHz sclk (32bits/channel) and a 12.5MHz mclk. I see the data on SAI1B (headphones). I would like to watch if SAI1A is a constant 0 or if the codec send data. The track go from the codec to the STM32 directly so I scratched a via with a sewing neddle. I was able to measure that the data were only 0, which is quite unfortunate.

I guess in the next H7 release, ST should at least fix their examples so they are working with the STM32H735 hardware. This way we can quickly find what the problem is. At the moment, I have no idea if it is even possible to receive audio on the discovery board...

Best regards

SK G.1
Associate

Hi All,

Anyone found/knows solution for Audio recording not working on STM32H735G-DK discovery kit. I'm facing the same problem described above. Any suggestions will help me a lot. Thanks.

I am currently using the STM32H735G-DK with both SAIs, "recording" data to HyperRam and sending it via ETH and it works.

But I don't use the on-board Codec, and mostly no HAL, and absolutely no BSP stuff.

So I can only recommend to dive deeper into the used BSP & HAL stuff and to understand and find out what's going on.

And always check the SAI / I2S hardware lines - maybe the H7 is doing it right, but the codec config is wrong?

Thanks for responding. I'll try your suggestion.

And, this means drivers and examples provided for STM32H735G-DK board are not tested????

I have no idea, I never used them in the first place.

Maybe you find a complete project for that in the repo, try that, see if that works, and go on from there.