NXP提供 sai_low_power_audio程序,主要功能:A53核负责解码音乐文件然后放入内存中,最后通过SRTM(Simplified Real Time Messaging)通知M4核去内存中获取数据到TCM中,使用SDMA方式把数据传输到SAI和音频解码芯片进行播放。

编译

安装编译链和SDK:见上一篇imx8mm hello world编译

进入目录:SDK_2.5.0_EVK-MIMX8MM/boards/evkmimx8mm/demo_apps/sai_low_power_audio/armgcc

运行脚本:./build_all.sh

运行

拷贝sai_low_power_audio.bin文件出来,打开TFTP工具。

下载demo并运行

M4核打印显示

设置m4 dts并启动内核

测试

A53核播放音乐到SAI3 wm8524:

M4串口输入s启动sai_low_power_audio:

A53播放音乐文件到M4核:

可以看到M4核已经处于run的状态,这时候耳机里面听不到音乐的,因为M4核使用的是SAI1和I2C3通过FPC接口输出到底板外面,需要额外使用ak4497解码器盒子进行音乐的播放,且支持HIFI功能;由于手里没有ak4497解码器,所以不能验证M4播放音乐是否正常。

电路图

A53核对应的SAI3核WM8524图,可以正常的播放音乐文件。

M4核对应的SAI1 和I2C3,这里接ak4497解码器。

DTS

wm8524对应到sai3,没有挂I2C

ak4497d对应sai1,ak4497是挂载I2C3下面的。

代码

SDK_2.5.0_EVK-MIMX8MM/boards/evkmimx8mm/demo_apps/sai_low_power_audio/sai_low_power_audio.c

void Peripheral_RdcSetting(void)
{rdc_domain_assignment_t assignment = {0};rdc_periph_access_config_t periphConfig;assignment.domainId = BOARD_DOMAIN_ID;RDC_SetMasterDomainAssignment(RDC, kRDC_Master_SDMA3_PERIPH, &assignment);RDC_SetMasterDomainAssignment(RDC, kRDC_Master_SDMA3_BURST, &assignment);RDC_SetMasterDomainAssignment(RDC, kRDC_Master_SDMA3_SPBA2, &assignment);RDC_GetDefaultPeriphAccessConfig(&periphConfig);/* Do not allow the A53 domain(domain0) to access the following peripherals. */periphConfig.policy = RDC_DISABLE_A53_ACCESS;periphConfig.periph = kRDC_Periph_SAI1;RDC_SetPeriphAccessConfig(RDC, &periphConfig);periphConfig.periph = kRDC_Periph_UART4;RDC_SetPeriphAccessConfig(RDC, &periphConfig);periphConfig.periph = kRDC_Periph_I2C3;RDC_SetPeriphAccessConfig(RDC, &periphConfig);periphConfig.periph = kRDC_Periph_GPT1;RDC_SetPeriphAccessConfig(RDC, &periphConfig);/* Do not allow the m4 domain(domain1) to access SAI3.* The purpose is to avoid system hang when A core to access SAI3 once M4 enters STOP mode.*/periphConfig.policy = RDC_DISABLE_M4_ACCESS;periphConfig.periph = kRDC_Periph_SAI3;RDC_SetPeriphAccessConfig(RDC, &periphConfig);
}

可以看到M4核设置的是SAI3。

疑问

可以把A53的SAI1关闭,然后M4使用SAI1可以进行播放音乐吗?【单独修改M4使用SAI1不行】

如果不使用m4 dts启动内核报下面错误:

应该是报I2C初始化冲突了,见下面m4 dts文件内容:

arch/arm64/boot/dts/freescale/fsl-imx8mm-evk-m4.dts

/** Copyright 2018 NXP** This program is free software; you can redistribute it and/or* modify it under the terms of the GNU General Public License* as published by the Free Software Foundation; either version 2* of the License, or (at your option) any later version.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the* GNU General Public License for more details.*/#include "fsl-imx8mm-evk.dts"/ {reserved-memory {#address-cells = <2>;#size-cells = <2>;ranges;m4_reserved: m4@0x80000000 {no-map;reg = <0 0x80000000 0 0x1000000>;};};rpmsg_i2s: rpmsg-i2s {compatible = "fsl,imx8mq-rpmsg-i2s";/* the audio device index in m4 domain */fsl,audioindex = <0> ;fsl,dma-buffer-size = <0x6000000>;fsl,enable-lpa;status = "okay";};sound-rpmsg {compatible = "fsl,imx-audio-rpmsg";model = "ak4497-audio";cpu-dai = <&rpmsg_i2s>;rpmsg-out;};};/** ATTENTION: M4 may use IPs like below* ECSPI0/ECSPI2, GPIO1/GPIO5, GPT1, I2C3, I2S3, WDOG1, UART4, PWM3, SDMA1*/&i2c3 {status = "disabled";
};&rpmsg{/** 64K for one rpmsg instance:* --0xb8000000~0xb800ffff: pingpong*/vdev-nums = <1>;reg = <0x0 0xb8000000 0x0 0x10000>;status = "okay";
};&sdma1{status = "disabled";
};&uart4 {status = "disabled";
};&sdma3 {status = "disabled";
};&sai1 {status = "disabled";
};&flexspi {status = "disabled";
};

可以看到只支持AK4497解码器,对A53使用的一些功能进行关闭避免冲突。

附readme.txt

Overview
========
In this demo, A core decoded music data and put it to DDR buffer and informs M4 with the related information.
Then M4 will take the ownership of consuming the buffer, it will copy buffer from DDR to TCM, manipulating SDMA to transfer the data to SAI and codec for playback.
It gives DDR and A core opportunity to do power saving for rather long time frame. M4 core will also take ownership of codec initialization.
SRTM(Simplified Real Time Messaging) protocol is used to communicate between A core an M4 core.
The protocol provides various commands for A core and M4 core to communicate with each other.
If there is no audio palyback, M4 will enter the STOP mode, and the whole SOC system would enter deep sleep mode(DSM) once A core enter low power status.Toolchain supported
===================
- IAR embedded Workbench 8.30.2
- GCC ARM Embedded 7-2017-q4-majorHardware requirements
=====================
- Micro USB cable
- MIMX8MM6-EVK  board
- J-Link Debug Probe
- 12V power supply
- Personal Computer
- HeadphoneBoard settings
==============
No special settings are required.#### Note! ####
1.  This case does not support flash targets because of SDMA3 burst DMA not supporting for accessing flexspi.
2.  This case does not support ddr target because of the mass of the music data decoded by A core will be placed in DDR. Prepare the Demo
================
1.  Connect 12V power supply and J-Link Debug Probe to the board, switch SW101 to power on the board
2.  Connect a USB cable between the host PC and the J901 USB port on the target board.
3.  Open a serial terminal with the following settings:- 115200 baud rate- 8 data bits- No parity- One stop bit- No flow control
4.  Download the program to the target board.
5.  Launch the debugger in your IDE to begin running the demo.******************
NOTE
******************
1.  The 48/96/192/384/768kHz, stereo, 16/24/32bit for PCM and DSD64/128/256/512 Music stream are supported
2.  Only ak4497 codecs on the audio board supported.
3.  Since the  DSD files are typically large, users could create a new large size patition in the SD card to place the music files.
4.  After M4 running, please make sure the linux kernel is boot up, then press "s" or "S" to start the demo.
5.  If there is no audio playback, the M4 will enter the STOP mode, then the whole system would enter DSM mode once A53 suspend.Press the ON/OFF button on the EVK board, could wakeup A53 core;
6.  Please make sure here exists xxx.wav file in the SD card.If the music file is placed at the Windows FAT32 paritions, after the linux kernel boot up and logged as root,using the "mount /dev/mmcblk1p1 /mnt" and then go to "/mnt" folder to playabck the music using the playback command.If the music file is placed at the Linux paritions, eg "/home", could playback the music dirctly using the playback command. ******************
Playback command
******************
When playback the .wav file:
1.  If want to test free run, could use command: aplay -Dhw:1 xxx.wav;
2.  If want to test pause command, could use command: aplay -Dhw:1 -i xxx.wav -N;press space key on the keyboard to pause, and press the space key again to resume.
3.  If want to test play back for specified period-size, could use command:aplay -Dhw:1 -i --buffer-size=xxx --period-size=xxx xxx.wav -N &;
4.  Support music playabck when A core enters suspend.When playback the .dsd/.dff file:
1.  Enter folder where the DSD execution procedure exists, using command:"cd /unit_tests/ALSA_DSD"
2.  Then playback the DSD file, using command:"./mxc_alsa_dsd_player hw:1 music path"Please note that the "music path" means where the DSD file exists.
3.  Does not support the specified period-size by linux side;
4.  Does not support music playabck when A core enters suspend; Running the demo
================
When the demo runs successfully, the log would be seen on the terminal like:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
####################  LOW POWER AUDIO TASK ####################Build Time: Sep 17 2018--09:32:59
********************************
Please:1) Boot A53 kernel first to create the link between M core and A core;2) Then press "s" or "S" to start the demo.
********************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
M4 is running now, please boot the linux kernel and use the command to playback music.Customization options
=====================

i.MX 8M Mini sai_low_power_audio相关推荐

  1. NXP i.MX 8M Mini处理器

    MYC-C8MMX核心板及开发板采用NXP i.MX 8M Mini系列嵌入式应用处理器设计,该系列应用处理器融合了先进的处理能力先进的音频,视频和图形,提供低功耗和高性能嵌入式消费和工业应用的解决方 ...

  2. NXP i.MX 8M Mini核心板(4核 ARM Cortex-A53)规格软硬件说明资料

    今日与大家分享基于NXP i.MX 8M Mini处理器的创龙科技-新款异构多核工业级开发板,它采用了四核ARM Cortex-A53 + 单核ARM Cortex-M4异构多核处理器设计,是创龙科技 ...

  3. NXP i.MX 8M Mini开发板(4核 ARM Cortex-A53)硬件原理图规格说明书

    前 言 本文档主要介绍NXP i.MX 8M Mini开发板硬件接口资源以及设计注意事项等内容. 创龙科技的NXP i.MX 8M Mini开发板是一款基于NXP i.MX 8M Mini的四核ARM ...

  4. NXP i.MX 8M Mini 核心板规格参数,四核ARM Cortex-A53 + ARM Cortex-M4

    今日与大家分享基于NXP i.MX 8M Mini处理器的创龙科技-新款异构多核工业级核心板,它采用了四核ARM Cortex-A53 + 单核ARM Cortex-M4异构多核处理器设计,是创龙科技 ...

  5. NXP i.MX 8M Mini 开发板规格参数,四核ARM Cortex-A53 + ARM Cortex-M4

    今日与大家分享基于NXP i.MX 8M Mini处理器的创龙科技-新款异构多核工业级开发板,它采用了四核ARM Cortex-A53 + 单核ARM Cortex-M4异构多核处理器设计,是创龙科技 ...

  6. i.MX 8M Mini——四核Cortex-A53+Cortex-M4多核CPU如何实现工控

    随着ARM处理器性能不断增强,当前越来越多产品都倾向尽量用单一架构的高性能ARM平台来满足产品的不同功能要求.但是,在工业应用领域还是要面对一些实时控制和通讯的要求,单一系统架构无法完全满足.面对复杂 ...

  7. linux系统的drm配置mipi,NXP i.MX 8M Mini平台Linux系统启动时间优化

    0x0 芯片功能介绍 i.MX 8M Mini是恩智浦首款采用先进的14LPC FinFET工艺技术打造的嵌入式多核异构应用处理器.i.MX 8M Mini系列处理器集合了高性能计算.能效.增强的系统 ...

  8. 【含案例源码】NXP i.MX 8M Mini基于FlexSPI、PCIe与FPGA的高速通信开发详解

    前 言 本文主要介绍i.MX 8M Mini基于FlexSPI.PCIe与FPGA的高速通信案例. 本文档适用开发环境: Windows开发环境:Windows 7 64bit.Windows 10 ...

  9. 基于NXP i.MX 8M Mini芯片的MYC-C8MMX核心板详细资料

    NXP 推出 i.MX8M Mini系列芯片以来,电子工程师们沸腾了,都想入手试试.嵌入式板卡公司米尔电子率先推出基于i.MX8M Mini处理器的MYC-C8MMX核心板及开发板.下面跟着小编一起看 ...

  10. i.MX 8M Mini Cortex-M4 Hello World

    imx8mm除了支持4个Cortex-A53还带1个Cortex-M4核,运行频率高达400MHz,本文需要在Cortex-M4核运行裸机程序或者系统. 运行官方bin文件 u-boot=> t ...

最新文章

  1. 人人都能学会的python编程教程11:定义函数
  2. 自定义eachFile遍历文件夹文件
  3. Dynamic LAN-to-LAN ××× 之 Router-to-Router
  4. uniapp在低版本android,uni-app离线打包Android平台注意事项
  5. 【windows】windows 11 安装解决 这台电脑无法运行 Windows 11
  6. ApacheCN jQuery 译文集 20211121 更新
  7. 【HISI系列】之IP/MAC地址配置
  8. delphi 标题栏相关操作
  9. Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException问题 学习记录
  10. php企业微信回调url校验失败,企业微信第三方服务商回调URL无法通过验证
  11. 数据库安全性相关习题。
  12. HDU 1317 一路wa到西天
  13. xls与csv文件区别
  14. 苏宁0元撸货福利来了!只限新人!老用户放弃吧!便宜只能占一次
  15. RHCE认证考试教材
  16. ESP32连接阿里云MQTT物联网平台
  17. 无限乱斗机器人ap出装_LOL无限乱斗武器大师AP流攻略出装天赋详解
  18. 在JME中遇到org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: 问题的解决方法
  19. 【讲座信息】(海洋科学-物理海洋学;大气科学;水文等)
  20. 模拟键盘、鼠标 mouse_event keybd_event

热门文章

  1. 教学实验平台之三极管放大特性测试
  2. VSCODE + 搜狗输入法,文字突然变成了繁体字,为什么?
  3. 计算机专业毕业了,还要不要参加培训班
  4. 解决ASP.NET 安装完成报错500
  5. C++ 应用程序性能优化 -- 内存池
  6. 怎样设计访谈提纲_如何设计调查问卷与访谈提纲要点分析.ppt
  7. 【论文笔记】基于交易的以太坊智能合约分类检测方法
  8. mac java报内存不足_苹果电脑显示内存不足怎么办_mac提示内存不足的解决方法-系统城...
  9. 哪些论文需要用到知网vip检测系统呢?
  10. Prosody如何查询已经注册的用户