AnsweredAssumed Answered

How to output a mp3 file, which is stored on a SD card, directly to uart3

Question asked by Thomas Hülsmann on Jun 25, 2013
Latest reply on Jun 27, 2013 by David E Seymour

Hi ,

 

does anyone know how to output a mp3 file, which is stored on a SD card, directly to uart3?

I like to download several mp3 files onto a hardware module with an embedded file system and a mp3 decoder using AT- commands.

 

My SD card is working fine, uart3 is working fine, the hardware module is already initialized with the appropriate AT commands, the opening of the file MUSIK.mp3 is fine.

 

So it is only this little piece of code, which does the copy from the SD card to the uart3 and which is recognising the EOF flag at the end of the file copy.

 

The mp3- file has approx 250 KB. I'm using MQX 4.0 with TWR-SER2- card and the Kinetis TWR K60F120M card.

 

This is, what I wrote till now:

 

/******************** Öffnen eines Files von der SD- Karte ********************/

 

printf ("\nÖffnen des Files Musik3.mp3\n");

 

  MQX_FILE_PTR fd_ptr;

 

  fd_ptr = fopen ("a:Musik4.mp3","r"); // ein File wird geöffnet

  if (fd_ptr == NULL){

    printf ("\nFehler: Das File wurde nicht geöffnet\n");

  }

  printf ("\nDas File wurde geöffnet\n");

 

!! HERE SHOULD BE THE CODE FOR OUTPUTTING THE FILE !!

 

/*********************** Hier wird die Shell gestartet ************************/

   

#if HTTPD_SEPARATE_TASK || !HTTPDCFG_POLL_MODE     

    _task_create(0, SHELL_TASK, 0);

    _task_block();

 

Can anybody help?

 

Thanks in advance

 

 

Thomas


Outcomes