2013-05-06 06:07 PM
I'm trying to create a project where I send an audio file from a computer to my STM32F4-Discovery board via USART and play the file. I have successfully run a USART example where a character is sent to the F4 board and back to the computer. I have also run a program where a mp3 file stored in flash memory is played.
I was wondering how I could integrate the two programs. The mp3 used in the program is actually an mp3 file that was converted into a series of hex characters (c array). How would I send that c array to the F4 board?Here's the mp3 program I used: #usart #mp3 #stm32f4 #uart #xmodem #audio2013-05-06 07:04 PM
The mp3 used in the program is actually an mp3 file that was converted into a series of hex characters (c array). How would I send that c array to the F4 board?
Why wouldn't you just send the unconverted binary data as 8-bit data over the serial port? RealTerm - Send File? Accumulate the bytes at the receiving end and send off to the MP3 player. Not sure you have the bandwidth.2013-05-06 10:25 PM
I've never used Realterm before, so can I send an mp3 file as is over the serial port?
2013-05-07 03:06 AM
Probably best to use a protocol such as XMODEM.
Any decent terminal app (even Hyperterminal) and many comms toolkits can do XMODEM. The ST In-Application Programming (IAP) App Note uses XMODEM - so you have a ready example there (not a very good implementation, but it does work).2013-05-07 04:46 AM
I've never used Realterm before, so can I send an mp3 file as is over the serial port?
What is an MP3 file composed of? A stream of bytes. The serial port can transmit said bytes. XMODEM would add a protocol layer to ensure the data arrives correctly, by potentially retrying corrupt blocks.2013-05-07 11:28 AM
Ok I'm going to start working on that. By the way how would I find out if I have the bandwidth capabilities to perform this task? Is that referring to a limitation of the F4 board?
2013-05-07 12:56 PM
By the way how would I find out if I have the bandwidth capabilities to perform this task? Is that referring to a limitation of the F4 board?
A 128 Kbps MP3 will not fit down a pipe at 115200 baud.2013-05-07 08:36 PM
Ahh ok well thanks for the help