2014-10-09 07:04 PM
Hi,
Ideally, I'd like to have a firmware that has the following support:
/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F4Discovery%20Cube-based%20USB%20Speaker%20application%20not%20working&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=116
, but I'm having problems accomplishing (3.b).Of course I already checked the ''Audio_playback_and_record'' common among STM32F4 and available in STM32CubeF4 package, however, the recording part there is configured as USB Host, not to mention that the USB Class is Mass Storage Class, not Audio Device Class.I can see related post/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/USB%20Audio%20Device%20with%20I2S%20microphone&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=2355
, but no conclusive answers (there was one saying he was able to do it but no details as to how were posted).At this/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F4Discovery%20Cube-based%20USB%20Speaker%20application%20not%20working&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=116
post, I was informed by someone from the Cube team that there isn't such a program yet for USB Device microphone where audio is configured to go to host PC (as of September 2014).However,/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/USB%20Audio%20Device%20with%20I2S%20microphone&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=2355
post I mentioned reached almost 2400 views, so that only means many people are searching for the same topic and still searching answers up until now (no other posts have more info aside from this one)...So I created this post.Anyone who can provide reference for us to allow STM32F4 to support ''USB Device microphone where audio is configured to go to host PC''?Any reference that could give us a jump start would do - then we can keep this thread rolling.BTW, I have STM32F4-Discovery with STM32F407VGx on hand.Since it has on-board CS43L22 DAC, a MP45DT02 MEMS microphone, DAC OUT for earphones, and of course USB Device mode port - it's the perfect device I can use for evaluation.Thanks in advance to those who can contribute to this post.Regards,Maj #stm32cubef4-usb-microphone-audio2014-10-13 02:10 AM
Hi Maj,
We'll let our development team know about your suggestion.Regards, Heisenberg.2014-10-14 12:10 AM
To Heisenberg
- please let us know once the development team released this in the future versions of STM32CubeF4 examples, via posting to this thread.I know it would be a hassle (sorry), but I'm saying for the benefit of all those who browses this forum, so that we/they can link the answer via your future post (ie ''this is already released as part of STM32CubeF4 vX.X...'').To all other users
- if you were able to make a firmware successfully with this setup, please still feel free to post.Thank you very much!2016-08-03 10:29 AM
That sound good! We must give a lot of critics to ST engineers. They must introduce such example! I insist on that!
2018-05-27 06:19 AM
Well, so two years and nothing? Really ST engineers? Awsome job. Till now i was really glad to use STM but their support starts to be really terrible.
2018-11-30 12:55 AM
I've been struggling for weeks to implement audio upstreaming feature on a stm32f103 board with cube generated codes, I can only stream lagging and intermittent sounds by using USBD_LL_Transmit() at DATAIN stage for now, I'm going really desperate.. And why are such basic examples nowhere to be found.
2018-11-30 08:21 AM
Maybe because it's not that basic to get it right. You've just told it: you've made the basic example stitching up ready made pieces of code, and the result is less than satisfactory.
JW
2019-02-07 07:35 AM
Good one, @maggie
I am starting to try to do almost the same thing on a STM32F7. Have you had any progress?
2019-07-24 05:21 AM
Did anyone get it to work already? I got some luck using X-CUBE-MEMS1 package, the device is recognized as a mic; however, when I try to send samples I get some very strange results and noisy samples.
The way I did it I just used the usbd_audio_in.h and .c files instead of the default usbd_audio.h and .c provided by ST (and calling the initialization and send functions).
2020-01-17 08:31 AM
I've been looking for a USB microphone example for a long time. I've done my own solution, but calling USBD_LL_Transmit from the DataIn callback doesn't seem very clean, and it means I can't send MIDI messages while streaming audio which is a big issue for some of my use cases.
Then today I found this: X-CUBE-USB-AUDIO
It has a complete example with audio record, playback, and feedback. It's pretty complex! Disappointingly it also calls USBD_LL_Transmit from DataIn, and of course there's no MIDI support.
To be honest I have no idea how you are supposed to use the Cube expansion packages. It doesn't show up when I do Manage Embedded Software Packages in STM32CubeMX (latest version v5.4.0). And if I download it, and then try to add the zip to Cube, it says it's not a supported format.
So instead I just unzip the package and look at the code, which is fine. At least it unzips the project contents, rather than a Windows-only exe like the Bluetooth packages!
Anyhow I just thought I'd share, as it might be useful for others.