This application note introduces the FLAC codec library porting on i.MX RT6xx, compares the performance differences between CM33 and HiFi4 DSP, uses the GNU profiler tool to analyze time-consuming functions in the FLAC library, and provides recommendations for further performance optimization on i.MX RT685 evk board.
Please refer to AN13793 for complete instructions on how to use this software.
https://www.nxp.com.cn/docs/en/application-note/AN13793.pdf
- SDK: 2.12.1
- FLAC: 1.3.4
- FatFS: R0.14b
- CM33: IAR embedded Workbench 9.30.1
- HiFi4: Xtensa Xplorer 9.0.18
- Micro USB Cable
- EVK-MIMXRT685 REV E2 Board
- Personal Computer
- SD Card
- Copy your Music file(.wav format) to SD card;
- Insert SD card to EVK-MIMXRT685 board;
- Add your music filename to filelist array(main_cm33.c@line_51) and build(Important);
- Connect a micro USB cable between the PC host and the Jlink USB port (J5) on the board
- Open a serial terminal with the following settings:
- 115200 baud rate
- 8 data bits
- No parity
- One stop bit
- No flow control
- Download the program to the target board.
- Launch the debugger in your IDE to begin running the demo.
The log below shows the output of this demo in the terminal window:
FLAC example to demonstrate how to use FLAC with CM33&HiFi4 core.
Please insert a card into board.
Card inserted.
Now timerTicks is 2314
MU example polling!
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
...
In order to fully validate and evaluate the FLAC on RT685 EVK, we use below audios:
We should run CM33 core routine(CM33_FLAC_TEST) at first, and then get encode files and decode files which saved on SD card. Then check the files on PC. At last, run HiFi4 routine(HiFi4_FLAC_TEST) and compare time-consuming difference.
-
CM33_FLAC_TEST work flow:
- Step1.CM33 Encode .wav to .flac, encode file save to SD card;
- Step2.CM33 Decode .flac to .wav, decode file save to SD card;
- Step3.CM33 Encode .wav to .flac, encode file save to SRAM;
- Step4.CM33 Decode .flac to .wav, decode file save to SRAM;
-
HiFi4_FLAC_TEST work flow:
- Step1.CM33 start HiFi4
- Step2.HiFi4 Encode .wav to .flac, encode file save to SRAM;
- Step3.HiFi4 Decode .flac to .wav, decode file save to SRAM;
Change DSP_IMAGE_COPY_TO_RAM config to 0, then can debug HiFi4 core. For more detailed information please refer to Getting Started with i.MX RT600 Evaluation Kit.
If you need help, please contact FAE or create a ticket to NXP Community.
Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository.
Warning: For more general technical questions regarding NXP Microcontrollers and the difference in expected funcionality, enter your questions on the NXP Community Forum
Version | Description / Update | Date |
---|---|---|
1.0 | Initial release on Application Code HUb | June 7th 2023 |