Overview
=================
The FLAC demo application demonstrates how to porting FLAC and evaluation performance on i.MXRT685 evk board.

We should run CM33 core routine(CM33_FLAC_TEST) at first, and we can get encode files and decode files which saved on sd card. Then we can check the files on PC.
At last, we can run HiFi4 routine(HiFi4_FLAC_TEST) and compare time-consuming difference.


CM33_FLAC_TEST work flow:
-------------------------     -------------------------    -------------------------    -------------------------
| 1.CM33 Encode to file |  => | 2.CM33 Decode to file | => | 3.CM33 Encode to SRAM | => | 4.CM33 Decode to SRAM |
-------------------------     -------------------------    -------------------------    -------------------------

HiFi4_FLAC_TEST work flow:
----------------------    --------------------------     -------------------------- 
| 1.CM33 start HiFi4 | => | 2.HiFi4 Encode to SRAM |  => | 3.HiFi4 Decode to SRAM |
----------------------    --------------------------     -------------------------- 

Tips:
- The CM33 core FLAC time-consuming information is saved as SD card file.
- You can change DSP_IMAGE_COPY_TO_RAM config to 0, that can debug HiFi4 core.


Toolchain supported
===================
- CM33:IAR embedded Workbench  9.30.1
- HiFi4: Xtensa Xplorer 9.0.18

Hardware requirements
=====================
- Micro USB cable
- EVK-MIMXRT685 board
- Personal Computer
- SD card


Prepare the Demo
================
1.  Copy your Music file to SD card;
2.  Insert SD card to EVK-MIMXRT685 board;
3.  Add your music filename to filelist array(main_cm33.c@line_51) and build(Important);
4.  Connect a micro USB cable between the PC host and the Jlink USB port (J5) on the board
5.  Open a serial terminal with the following settings:
    - 115200 baud rate
    - 8 data bits
    - No parity
    - One stop bit
    - No flow control
6.  Download the program to the target board.
7.  Launch the debugger in your IDE to begin running the demo.



Running the demo
================
The log below shows in the terminal window:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


FLAC example to demonstrate how to use FLAC with CM33&HiFi4 core.

Please insert a card into board.

Card inserted.
not timerTicks is 2314

MU example polling!
not timerTicks is 3746572
CM33: input:16khz_mono_sine_10s.wav
input:16khz_mono_sine_10s.wav, filesize is 320044
start encoder #0: compress level:0
wav sample_rate:16000, totalk_samples:160000
Heap addr:163000
encode consume time.60 ms
...
