Hardware requirements
Micro USB cable
MIMX8ULP-EVK/EVK9 board
J-Link Debug Probe
5V power supply
Personal Computer
Headphone
Board settings
No special settings are required.
Note!
This case does not support ddr and flash target.
This case runs together with Linux and the Linux release version should not be lower than 5.15.32-2.0.0.
Prepare the Demo
Connect 5V power supply and J-Link Debug Probe to the board, switch SW10 to power on the board.
Connect a micro USB cable between the host PC and the J17 USB port on the target 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.
Turn on the power switch on your board to begin running the demo.
NOTE
The 16/24/32bits for PCM Music stream are supported.
Since the music files are typically large, users could create a new large size partition in the SD card to place the music files.
After M core running, please boot the linux kernel to create the rpmsg channel between A core and M core. Make sure the FDT file and key bootargs are correctly set before booting the linux kernel. Following is the example commands on A core U-Boot console: =>setenv fdtfile imx8ulp-evk-lpa.dtb =>setenv mmcargs ‘setenv bootargs ${jh_clk} console=${console} root=${mmcroot} no_console_suspend snd_pcm.max_alloc_per_card=134217728’ =>saveenv
Please make sure audio file (such as xxx.wav) in any filesystem that Linux can access. One of the way to send audio file to Linux filesystem: Under A core U-Boot console, execute below command to enable 8ULP board’s USB device mode (USB Mass Storage) function: u-boot->ums 0 mmc 0 Connect TYPE-C USB cable between 8ULP board and PC. You will see a drive show on PC to allow copy any file to board. After A core boot to Linux console, the audio file is located at /run/media/boot-mmcblk0p1/
Playback command
Note:
Please use the command “cat /proc/asound/cards” to check the wm8960 sound card number (on A core Linux console). E.g: Type command: ~# cat /proc/asound/cards The available sound cards can be shown:
0 [btscoaudio ]: simple-card - bt-sco-audio bt-sco-audio 1 [imxspdif ]: imx-spdif - imx-spdif imx-spdif 2 [wm8960audio ]: wm8960-audio - wm8960-audio wm8960-audio
Then the wm8960 sound card number is 3.
When playback the .wav file (on A Core Linux console):
If you want to playback with pause/resume command, below command can be used: “aplay -Dhw:2 -i xxx.wav -N”; press space key on the keyboard to pause, and press the space key again to resume.
8ULP supports audio format of S16_LE, and sample rates could be 8kHz, 16kHz and 48kHz, NOT including 44.1kHz.
Current demo should NOT be run with argument ‘plug’, otherwise LPA mode will NOT take effect: “aplay -Dplughw:2 -i xxx.wav -N”
If you want to playback with APD low power mode and specified period-size, below command can be used: “aplay -Dhw:2 –buffer-size=xxx –period-size=xxx xxx.wav -N &” or “aplay -Dhw:2 –buffer-time=xxx –period-time=xxx xxx.wav -N &”. E.g: “aplay -Dhw:2 –period-time=500000 –buffer-time=10000000 xxx.wav -N &” Now please use “echo mem > /sys/power/state” command to make APD enter suspend mode and the playback work normally. Note:
For APD into power down mode, this demo support dual boot mode only.
Please enable the A core has enough time to fill the audio buffer before going into suspend mode.
Running the demo
When the demo runs successfully, the M core log would be seen on the terminal like:
#################### LOW POWER AUDIO TASK ####################
Build Time: Aug 30 2022--12:56:26
Start SRTM communication
********************************
Wait the Linux kernel boot up to create the link between M core and A core.
********************************
BOARD_ReleaseTRDC: 75 start release trdc
BOARD_ReleaseTRDC: 78 finished release trdc, status = 0xd6
BOARD_SetTrdcGlobalConfig: 93 start setup trdc
BOARD_SetTrdcGlobalConfig: 411 finished setup trdc
Handle Peer Core Linkup
The rpmsg channel between M core and A core created!
********************************
Task A is working now.