Skip to main content
MYadw.2
Associate II
October 26, 2022
Question

I2S communication between 2 stm32 boards facing issues in receiving?

  • October 26, 2022
  • 4 replies
  • 1809 views

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

This topic has been closed for replies.

4 replies

waclawek.jan
Super User
October 26, 2022

Observe signals using LA.

​JW

MYadw.2
MYadw.2Author
Associate II
October 26, 2022

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

waclawek.jan
Super User
October 26, 2022

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

MYadw.2
MYadw.2Author
Associate II
October 27, 2022

stm32f746 discovery board as my receiver.

No I am not using DMA its just polling method.

0693W00000VODqWQAX.png

QSHAO.1
ST Employee
October 27, 2022

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

waclawek.jan
Super User
October 27, 2022

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

JW