IMX93evk I2S Protocol with SAI

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

IMX93evk I2S Protocol with SAI

248 次查看
rti
Contributor II

Hello,

 

I wish to connect a device with I2S output to an imx93evk.

rti_0-1758790060342.png

Since I want I2s directly and not with a codec in the middle, I don't need to do anything since by default the pins will be in the EXPI.

rti_1-1758790117024.png

I then connected the device to the following pins:

rti_2-1758790213344.png

I am setting in the pin mux for the GPIO 18, 19 and 20.

Can you please confirm if my understanding is correct? Currently I can't read any value, but I am not sure if it is a wrong assumption on the HW or a faulty i2s driver.

Thank you.

 

标记 (3)
0 项奖励
回复
6 回复数

182 次查看
rti
Contributor II

Hello,

I made a test, where I ran the code without anything connected to the SAI3/I2S hardware Pins.

Result is that SAI_TransferRxHandleIRQ is called constantly, sometimes with Status RxIdle, but other times with RxError which is related with a FIFO error.

Looking to the code, this error is passed via callback when the FEF bit of the RCSR register is set, which represents FIFO overflow. This is where I am confused, how do I have FIFO overload? Having my i2s sensor connected or not results in exactly the same behavior.

I suspect currently on the HW setup, probably the SAI3 is connected to other place than the GPIO? Can you provide some guidance?

Thanks in advance.

 

0 项奖励
回复

119 次查看
joanxie
NXP TechSupport
NXP TechSupport

I'm not sure how you test this code on M33 side, but you can refer to the dts file, the SAI3 already is defined in the dts, 

https://github.com/nxp-imx/linux-imx/blob/lf-6.12.y/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dt...

&sai3 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pinctrl_sai3>;
pinctrl-1 = <&pinctrl_sai3_sleep>;
assigned-clocks = <&clk IMX93_CLK_SAI3>;
assigned-clock-parents = <&clk IMX93_CLK_AUDIO_PLL>;
assigned-clock-rates = <12288000>;
fsl,sai-mclk-direction-output;
status = "okay";
};

so you can test this on A core directly, if your end usage is for A core, or you can disable this sai3 in the linux firstly before you tested this on M core

0 项奖励
回复

13 次查看
rti
Contributor II

Hello Joanxie,

 

I made the test today with the A55 cores in off mode, and only boot from the M33 core.

 

I made some measurements:

- BCLK has the right voltage level and frequency (0 - 3.3V)

- Frame Sync has an oscilation similar to the BCLK which is strange. I am expecting the FrameSync pin to be High or Low voltage for the number of bits we need to read and not oscilating at the same frequency of BCLK. Also the voltage level is not right, always around 500-600mV, where the High and Low should be above and below ~1.5V

When I make the physical values deserialization with an osciloscope it is also all interpretred as 0, with different message length (due to bad frame sync) and always low voltage.

It is clear to me now that the problem is the registers configurations for SAI3. Can you please provide support with an application note on tx/rx with I2S usage?

Thanks in advance.

 

0 项奖励
回复

66 次查看
rti
Contributor II

Hello joanxie,

 

Thank you for your reply.

 

I see the device tree you send and it also has the sound-wm8962 codec. In my use case, let's say it can be in Linux or M33, I want to connect a sensor without any codec. Is it possible in the device tree connect the SAI3 directly to the pins?

Do you have an application note that can support this?

标记 (3)
0 项奖励
回复

204 次查看
joanxie
NXP TechSupport
NXP TechSupport

How do you connect the SAI3 signals if you don't use any code? and share your dts settings for this I2S usage

0 项奖励
回复

189 次查看
rti
Contributor II

Hello,

I am using the M33 core to read the I2S data. Do you have an application note on how to use it with A55?

In the M33 i connected the Rx_BCLK to the bclk of the i2s sensor. The Rx_Sync is connected to the LRCL. The Rx_Data0 is connected to the output of the i2s sensor.

 

The fsl_sai driver is configured with Mode Async (no dependency between the Tx and Rx), as Master.

MCLKOutputEnable is set with true.

 

Sequence of driver calls:

  1. SAI_INIT
  2. SAI_TransferRxCreateHandle
  3. SAI_GetClassicI2SConfig
  4. SAI_TransferRxSetConfig
  5. SAI_RxSetBitClockRate
  6. SAI_TransferReceiveNonBlocking

Callback is called but data is always zero. I made the test of printing the RDR register directly and it is also zero.

With an osciloscope I measured the Rx_BCLK and the clock is with the proper frequency and presents good Voltage level. The Rx_Sync on the other hand has some wave but always below the 20mV.

This leads to two possible failure points:

- Faulty I2S driver usage which is not setting the configuration properly

- My understanding on the HW is connected from the first post is not Correct and made wrong assumptions leading to a wrong behavior

 

0 项奖励
回复