2023-03-22 07:17 AM
Hi all,
I'm trying to get to know the STM32 world, and I have a STM32F746G-DISCOVERY board here. I've successfully tested a couple of TouchGFX things, and it seems quite neat.
Now I want to test the possibility to output audio signals on the TRS output connectors, so it could be played on a speaker or headphones.
However, I cannot for the life of me figure out how to do this.
What's strange is that there seems to be no real Documentation or Tutorial on how to do this. Best I could find were some forum posts and blog articles, which vary greatly in approach, effort and quality.
Also the Demo projects available in CubeIDE are not helpful, as they don't seem to work either. I flashed the "audio plackback and record" project onto my board, but only see 2 lines of log output on the screen and nothing else happens.
So my question is: What's the easiest way to produce audio output on the STM32F746? And is there any good documentation/tutorials on how to do it?
Any help would be much appreciated.
Regards
2023-03-22 08:04 AM
Check the other F7 discovery boards.
E.g., in the F769 repository from CubeMX I can find an Audio folder.
2023-03-22 08:33 AM
Yes, I also found two audio projects in the F746 folder. Those examples are available for many boards. But as far as I understand, one of them ("audio_standalone") is used to let the board act as a USB sound device when connected to a PC, so not the scenario I want, and the other one doesn't seem to work.
2023-03-22 11:27 AM
so : you want an "audio player" ?
look: in F469 files ->
This application runs on STM32F469xx devices.
This application has been tested with STM32469I-Discovery board and can be
easily tailored to any other supported device and development board.
or for F746
or
https://github.com/STMicroelectronics/STM32CubeF7/tree/master/Projects/STM32F769I-Discovery/Examples/SAI/SAI_AudioPlay
2023-03-22 11:31 PM
What do you expect?
There probably will not be exactly what you want, and you will learn a lot when modifying these examples.
2023-03-23 03:38 AM
Well, on a "Discovery Board" with example projects supplied by the manufacturer, I primarily expect them to work, so I can discover what the board is capable of and at what cost/effort. I think that is not too much to ask, and should not require any tinkering.
2023-03-23 03:42 AM
Yes, an "audio player" would be great. In fact I have tried exactly the project you recommended (audio_playback_and_record), but it does not seem to work. It boots up, seems to recognize the USB drive, but then just stops. There are no controls shown on the display and the board seems unresponsive.
2023-03-23 12:11 PM
so - why dont you debug and see, what happens, is missing or going wrong?
and a player - well, i have here a streamer/player, can do wav, flac, MP3 files and make audio signal in hi-end audio quality on ES9038 DAC. almost very good and without errors working now, after about 600 hours now... :) - just dont expect, you build such a thing in some 2 or 3 hours .
https://www.digikey.de/en/blog/audio-processing-with-stm32
https://w.dspconcepts.com/audio-weaver
https://www.youtube.com/watch?v=_Pm0L1ropJs
since 20.06.2020 i work on this.. so you know now.
2023-03-24 02:56 AM
Thanks for the links! I'll have a look at them.
The reason I'm confused and/or not willing to spend a lot of time on this, is that it is an example project on a discovery board. I'm not even working on my real task yet, just trying to see if it is possible, starting from something that (what I expected) already exists and works.
In a world of devices where apparently every penny counts, I find it odd that the first reaction on any question is "why don't you just spend a lot of time on tinkering?". This would be of course the way to go in an ideal world, but unfortunately that's not realistic.
2023-03-24 04:06 AM
> "why don't you just spend a lot of time on tinkering?"
The problem is, that unless your application is not super trivial, that is how it ends up anyway.
People think that 5 minutes clicking through CubeMX will give you a working solution for almost everything.
No, it's not, it's a basic setup tool for the MCU, the clock, GPIOs, peripherals.
Everything inbetween then needs time and "tinkering". (Isn't that the fun part anyway?)
Same with the examples, it's just not very probable that any example will fit your needs.
So, same as with the CubeMX stuff, take it as a base and learn from that (and sometimes how to not do it).
So " just trying to see if it is possible ", definitely examples are a good starting point, but it still requires lots fo reading the datasheets, reference manuals, then tinkering, and asking questions here. Depending very much on the complexity of your task.