Skip to main content
Visitor II
February 12, 2025
Question

STM32H747I-DISCO, codec outputs noise in BSP example.

  • February 12, 2025
  • 2 replies
  • 1136 views

Hello,

I built and uploaded the BSP example from the H7 MCU package, version 1.12.1, on my STM32H747I-DISCO board. I tried the various demos included in the example and they work but it seems there is an issue with the codec configuration.

(I didn't change anything)

While testing the analog_audio_record demo (which should record from the input jack and pass the recorded data to the output jack) i plugged in my headphones in the output jack and noticed that there is a lot of noise, regardless of if an input jack is connected or not.

Playing a song on max volume from the input jack I could hear it above the noise.

While testing the audio_record demo, the microphone was less affected by noise but has a large gain.

I stumbled upon this video on youtube: https://youtu.be/O2XaCFsWxSw?si=J-KL4CMG7EA3le86
"STM32F7 Discovery : Audio Line-in to Line-out Pass-through" from "PizzaBear Engineering".
He points out how some register writes may be inappropriate, like 0x0035 to registers 0x29 and 0x2A, seting up a 30dB gain (in min 11:16). I tried to change this value to 0x0020 like in the video to see if it was the cause of the noise, but all it did was making the noise and the signal quieter and I can't hear anything but an hiss now.

I tried studying the datasheet of the wm8994 but coudn't understand how to make it work, I just understood what it could do. I am not an experienced user so I would like to use some sort of BSP function instead of spending a lot of time trying to learn to configure it.

 

Is there another example that I can try?

Is there something in the configuration that needs to be changed?

    This topic has been closed for replies.

    2 replies

    Super User
    February 12, 2025

    Hi,

    first some things to think about:

    - did you read the WM8994 ds ? or at least, look at it ? It has 359 pages, about 300 or 500 registers (!!OMG!).

    - to understand it in a basic way, needs many hours - to more or fully understand it, maybe some 2 or 3 weeks.

    - What you want to do with it - really ? 

    see start of ds :

    AScha3_0-1739388699862.png

    A lot of programming and understanding of most or all internal modules is needed...

    or you want just play a demo, to see: ok, its doing something ?

    ->  instead of spending a lot of time trying to learn to configure it.

    So decision is : you have got it "doing something" , ok, and now play with something else, 

    OR read and learn , until its doing exactly, what you want - even you might need 2 weeks or more to do this demanding job.

    NidaAuthor
    Visitor II
    February 13, 2025

    Hello,

    Thanks for replying. Yes I've read the datasheet but I have no clue what the sequence of instructions to correctly program it might be, I allready spent 3 days trying to make it work, with no success.

    I was hoping the BSP would take care of everything when I bought the board, otherwise I would have designed a board with a simpler codec.

     

    Sorry for not being clear with my intentions with this, I want to test some audio DSP algorithms.

    I was looking for some examples with a simple codec configuration to copy for my projects. I want the codec ADC to sample the data and the DAC to output the data sent to it, no special functions or extras.

     

    My idea was to copy the configuration from the AnalogAudioRecord BSP example, but the example itself does not behave as it should due to all the noise.

     

    At this point I'm not sure if my board is broken or if there is an issue with the example code.

     

    I would like to make the example work as a first step, and then get a configuration for my projects.

     

    Please let me know if you can run the example or if you can give me some feedback on what I might be doing wrong. Thanks.

    Super User
    February 13, 2025

    Hi,

    no, i have no example for this. Because (i also want to do some audio things...) i see the codec, look at its data sheet and think: oh no, not for me. And board is not cheap. So i decided to connect to a simple board ("black pill", F411, about 4 $ ) and a "simple" DAC, that has only few registers (to learn: just few hours) and has average good data : PCM5102A .

    Then to play a little with DSP , can use a faster cpu (H743 now) and do some calculations (biquad filters, even in double float no problem) and a more complex DAC with little DSP , PCM5122 :

    AScha3_0-1739472595042.png

    But then want still more quality, hi-end audio, so looking for "best" DAC : (tried some, then use) ES9038 .

    AScha3_1-1739472795313.png

    Now its my "audio-player" , plays wav/flac/mp3 (double float precision) from SDcard and USB , with my old (Sony) IR remote control (i just like it), with hi-end quality sound.

    Made a board for my toy:

    AScha3_2-1739473093788.png

    ...and 2x TDA1387 DACs , NOS, to make active speaker system - if  i have motivation to do so. 6ch are here.

     

    And "DSP" is just the 400MHz H743. (And ADCs - it has 16 bit fast ADCs .)

     

    So i would recommend: think first, what you want to do, then puzzle together some parts, that have a useful time-to-learn -> do-what-you-want   relation. Not to waste much time to learn about complex chips - that functions you anyway dont plan to use.

    Visitor II
    March 18, 2025

    This audio codec is very complicated to be honest, ive spent like 2 months reading the datasheet and had to write my own driver since the BSP example has no little to no documentation on how to start the init as im not familiar with pointers. Ive managed to get analog audio pass through to the speakers but i cant get any ADC to DAC stuff to work with SAI and DMA. im hoping somebody can help with this.