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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

793 Views
ThomNet
Contributor III

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


Labels (1)
0 Kudos
1 Reply

332 Views
DavidS
NXP Employee
NXP Employee

Hi Thomas,

Not 100% sure of the answer but please review the attached appnote on using MQX as a protocol converter to see if that helps.

Regards,

David

0 Kudos