cancel
Showing results for 
Search instead for 
Did you mean: 

I2S communication between 2 stm32 boards facing issues in receiving?

MYadw.2
Associate II

Hello,

I am trying to send some dummy data through I2S in PCM format from one stm32 board to another board by configuring one board as master transmit and the other one slave receive.

I can send and receive the data but the received data is doubled the transmitted data and i am not getting how it is coming. Need the help in this one its very urgent?

Ex: if i transmit 1 i am receiving 2

Master Transmit Configurations :-

 hi2s2.Instance = SPI2;

 hi2s2.Init.Mode = I2S_MODE_MASTER_TX;

 hi2s2.Init.Standard = I2S_STANDARD_PCM_SHORT;

 hi2s2.Init.DataFormat = I2S_DATAFORMAT_16B;

 hi2s2.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;

 hi2s2.Init.AudioFreq = I2S_AUDIOFREQ_16K;

 hi2s2.Init.CPOL = I2S_CPOL_LOW;

 hi2s2.Init.ClockSource = I2S_CLOCK_PLL;

Slave Receive Configurations :-

 hi2s2.Instance = SPI2;

 hi2s2.Init.Mode = I2S_MODE_SLAVE_RX;

 hi2s2.Init.Standard = I2S_STANDARD_PCM_SHORT;

 hi2s2.Init.DataFormat = I2S_DATAFORMAT_16B;

 hi2s2.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;

 hi2s2.Init.AudioFreq = I2S_AUDIOFREQ_16K;

 hi2s2.Init.CPOL = I2S_CPOL_LOW;

 hi2s2.Init.ClockSource = I2S_CLOCK_PLL;

Its very urgent please do help

7 REPLIES 7

Observe signals using LA.

​JW

This is what I am receiving on the logic analyzer and could not relate it to waveform of the stm32f746 reference manual and I am not understanding how WS is behaving

0693W00000VO8gvQAD.png

Hello there was error in the setting of the logic analyzer attaching the new screenshot where I am getting exactly what I am sending

0693W00000VO8vvQAD.png

So, you don't see any data doubling in the signal? Then the problem can be localized to the receiver.

Which STM32 is the receiver?

How exactly does the problem manifest itself?

Do you use DMA? Read out and check/post content of SPI/I2S and DMA registers content.

JW

stm32f746 discovery board as my receiver.

No I am not using DMA its just polling method.

0693W00000VODqWQAX.png

QSHAO.1
ST Employee

I think you may check status registers of I2S for issue analysis, like OVR, UDR...

OK so what does "but the received data is doubled" mean exactly and how do you detect that?

JW