Sound Card interface for Ham Radio using STM32

270 views
Skip to first unread message

Scott Baker

unread,
May 11, 2023, 7:53:02 PM5/11/23
to dorkbotpdx-blabber
Hi,

I'd like to build a sound card interface for a ham radio project using an STM32F411.

It has to look like a generic sound card (with no special drivers needed).
The audio data just needs to be streamed to the STM32 but
no sound output from the STM32 is required.

I want to use the Arduino IDE and I have installed the required STM32 core.
I have seen several STM32 sound card projects on GitHub, but none
of them use the Arduino IDE and they seem overly complex for what I need.

It there a simple way to implement a sound card interface for the
STM32F411 (within the Arduino IDE)?  Are there Arduino libraries that
can help with this?

Thanks,
Scott

Jared Boone

unread,
May 13, 2023, 1:19:34 PM5/13/23
to dorkbotpd...@googlegroups.com
It’s inferred by your application, but it might help to say it out loud: you want the STM32 to present as a USB audio interface to a host computer.

Having developed a couple of silly projects that acted as a USB audio device, implementing a modern USB audio device is no joke. It is, indeed, complex. More so depending on which clock synchronization scheme you choose, media types you support, and which (if any) controls you expose. So it’s not a surprise that the projects you’ve found are complex. They’re probably trying to provide a wide degree of support for all that USB audio can be.

All that said, there may be “toy” USB audio projects out there (like mine) that suit one particular use case, that might also happen to match your requirements. Speaking as somebody who has made toy implementations, you will probably find them rife with bugs and shortcuts and pitfalls, versus a larger and more compete project.

This is my two cents. In any case, I hope you find what works for you.

        - Jared

On May 11, 2023, at 16:53, Scott Baker <scott....@gmail.com> wrote:

Hi,
--
You received this message because you are subscribed to the Google Groups "dorkbotpdx-blabber" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dorkbotpdx-blab...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dorkbotpdx-blabber/3d3857a1-3392-4827-932f-20468bb961f0n%40googlegroups.com.

Jared Boone

unread,
May 13, 2023, 1:37:54 PM5/13/23
to dorkbotpd...@googlegroups.com
You didn’t say whether the project was cost-sensitive, but if you don’t mind adding a chip that does the USB work, you can get a USB-I2S bridge chip like this one:


XMOS and Microchip also seem to make them.

Then the STM32 firmware only needs to deal with moving audio frames through its I2S peripheral. No USB code is required. However, if your project needs to also support non-audio interfaces over USB, these chips might not work for you. 

        - Jared

On May 11, 2023, at 16:53, Scott Baker <scott....@gmail.com> wrote:

Hi,

Scott Baker

unread,
May 13, 2023, 6:44:05 PM5/13/23
to dorkbotpdx-blabber
Hi Jared,

>>you want the STM32 to present as a USB audio interface to a host computer.
Yes, this project is a digital radio which will require a host computer running WSJT-X (or equivalent) software.

>> It is, indeed, complex. More so depending on which clock synchronization scheme you choose
>> media types you support, and which (if any) controls you expose. 
The audio interface can probably be greatly simplified with limited controls exposed.

>> You didn’t say whether the project was cost-sensitive
It is cost sensitive, and also board real-estate sensitive.

>> However, if your project needs to also support non-audio interfaces over USB, these chips might not work for you.
Yes, in addition to audio over USB,  a serial port over USB is also needed.
The serial port is used to control the radio from the host computer.

Thanks,
Scott

Scott Baker

unread,
May 15, 2023, 2:22:22 AM5/15/23
to dorkbotpdx-blabber
I found this USB composite class wrapper that may be helpful:


73,
Scott   KJ7NLA
Reply all
Reply to author
Forward
0 new messages