IMX8MM SAI5 ISSUES

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

IMX8MM SAI5 ISSUES

198 Views
oprata
Contributor II

Hello Everyone,

I have an evaluation board model IMX8MMEVK. The reference kit is in perfect working condition. I built a version of the Linux operating system for this module using the manifest imx-5.15.71-2.2.2.xml available in the imx-manifest repository on GitHub. To build the operating system image, I used the command: bitbake imx-image-full.

After validating the operating system on the evaluation board, I used the command devtool modify virtual/kernel to modify the device tree of the system image. The modification aims to enable the use of the SAI5 bus in PDM mode through the header connector available on the IMX8MMEVK base board. The SAI5 configuration in the device tree is as follows:

/ {
chosen {
stdout-path = &uart2;
};

...

sound-micfil {
compatible = "fsl,imx-audio-card";
model = "imx-audio-micfil";
pri-dai-link {
link-name = "micfil hifi";
format = "i2s";
cpu {
sound-dai = <&micfil>;
};
};
};
};

...

&micfil {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pdm>;
assigned-clocks = <&clk IMX8MM_CLK_PDM>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <196608000>;
fsl,dataline = <4 0xff 0xff 0xff 0xff>; /* 4 channels, all enabled */
status = "okay";
};

...

&iomuxc {

...

pinctrl_pdm: pdmgrp {
fsl,pins = <
// MX8MM_IOMUXC_SAI5_MCLK_SAI5_MCLK 0xd6
MX8MM_IOMUXC_SAI5_RXC_PDM_CLK 0xd6
// MX8MM_IOMUXC_SAI5_RXFS_SAI5_RX_SYNC 0xd6
MX8MM_IOMUXC_SAI5_RXD0_PDM_DATA0 0xd6
MX8MM_IOMUXC_SAI5_RXD1_PDM_DATA1 0xd6
MX8MM_IOMUXC_SAI5_RXD2_PDM_DATA2 0xd6
MX8MM_IOMUXC_SAI5_RXD3_PDM_DATA3 0xd6
>;
};

...
};

These changes were made to the imx8mm-evk.dtsi file. After generating a new image with the presented modifications, the SAI5 bus available on the IMX8MMEVK board's header connector does not show the clock signal on the SAI5_RXC pin. Does anyone know how to solve this problem? Or could anyone tell me if the configuration for the SAI5 interface in PDM mode is correct?"

Labels (1)
Tags (1)
0 Kudos
Reply
2 Replies

171 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

  • The SYNC bit field of both TCR2 and RCR2 should be reserved for values of 10b and 11b. 

External connections are required for the 8M Mini to operate different SAI instances synchronously with each other. This would depend on the sources of the master clock, bit clock, and frame sync. If all are external, then both SAI instances need to be configured to receive all three. If one or the other SAI is generating them, then the other SAI needs to be configured to receive them. There is no way to route the signals internally, so external, board level connections need to be made.

For SAI5 this will help with the clock:

https://github.com/nxp-imx/linux-imx/blob/66e442bc7fdcc935e6faa94c743f653263d4ed67/arch/arm64/boot/d...

Regards

0 Kudos
Reply

131 Views
oprata
Contributor II

Hello,

I made the following change to the device tree:

/{
...

sound-micfil {
compatible = "fsl,imx-audio-card";
model = "imx-audio-micfil";
pri-dai-link {
link-name = "micfil hifi";
format = "i2s";
cpu {
sound-dai = <&micfil>;
};
};
};
};

&micfil {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pdm>;
assigned-clocks = <&clk IMX8MM_CLK_PDM>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <196608000>;
fsl,dataline = <2 0xf 0x0>;
status = "okay";
};

&sai5 {
...
status = "disabled";
};

&iomuxc {
...

pinctrl_pdm: pdmgrp {
fsl,pins = <
/* MX8MM_IOMUXC_SAI5_MCLK_SAI5_MCLK 0xd6 */
MX8MM_IOMUXC_SAI5_RXC_PDM_CLK 0xd6
/* MX8MM_IOMUXC_SAI5_RXFS_SAI5_RX_SYNC 0xd6 */
MX8MM_IOMUXC_SAI5_RXD0_PDM_DATA0 0xd6
MX8MM_IOMUXC_SAI5_RXD1_PDM_DATA1 0xd6
MX8MM_IOMUXC_SAI5_RXD2_PDM_DATA2 0xd6
MX8MM_IOMUXC_SAI5_RXD3_PDM_DATA3 0xd6
>;
};
...
};

After this change, I generated a new operating system image for the imx8mmevk kit using the Yocto tool and loaded it into the kit's flash memory. Then I used the following command:

arecord -D hw:1,0,0 -f S16_LE -c 1 -r 48000 recording.wav

to record audio from the microphone. For the SAI5_RX[0] interface, it worked correctly. However, for the SAI5_RX[1], SAI5_RX[2], and SAI5_RX[3] interfaces, it was not possible to record audio. Could you tell me if there is any configuration that needs to be done so that the SAI5_RX[1], SAI5_RX[2], and SAI5_RX[3] inputs can work correctly?

To capture audio from the SAI5_RX[1], SAI5_RX[2], and SAI5_RX[3] inputs, I used the same command to record input 0, changing the parameter hw:1,0,0 to hw:1,0,<interface number>. For the SAI5_RX[1] interface, the command was as follows:

arecord -D hw:1,0,1 -f S16_LE -c 1 -r 48000 recording.wav

Do you have any idea how to configure the device tree or other settings to enable recording on the SAI5_RX[1], SAI5_RX[2], and SAI5_RX[3] interfaces?

Thanks in advance.

 

0 Kudos
Reply