cancel
Showing results for 
Search instead for 
Did you mean: 

Why is this happening to the I2S bus?

CLeo.1
Senior II

Hi guys,

Finally started injected known data into the I2S bus and I am seeing indifferences on the line and was wondering if you guys can explain this to me if this is normal or not.

Using the STM32H753ZI

Figure 1:

Sending: 0xFF FF (16 bits)

DATLEN = 16 bits

CHLEN = 16 bits

0693W000006Em06QAC.png 

Figure 2:

Sending: 0xFF FF FF (24 bits)

DATLEN = 24 bits

CHLEN = 32 bits

0693W000006Em0kQAC.pngFigure 3:

Sending: 0xFF FF FF FF (32 Bits)

DATLNE = 32 bits

CHLEN =32 BITS0693W000006Em0uQAC.png 

Why when it comes to sending 24 bits I am missing a byte?

Another thing I noticed when sending 24 bits for example if sent 0x010203, the bus will receive 0x000102 its like performing a >> shift by a byte

I2S and DMA configuration:

https://pastebin.com/fxuKXYpv

4 REPLIES 4
TDK
Guru

Duplicate: Related:

https://community.st.com/s/question/0D53W00000QPhEzSAL/how-to-inject-your-own-data-into-the-i2s-line-with-dma

Hard to say much without seeing code. Clearly the middle example is not sending 0xFFFFFF. Gotta be a bug somewhere.

You should be sampling on the rising edge, not the falling edge.

If you feel a post has answered your question, please click "Accept as Solution".
CLeo.1
Senior II

@TDK​  Oh sorry, totally forgot about the code, ill fix it up. I wouldnt say its a duplicate as that one was more so how to get data (your own known data) onto the I2S bus, this one is after the fact.

Yeah exactly thats why I am posting here, something is not making sense.

TDK
Guru

Okay, so there's initialization code posted not, but not the code used to actually send data.

> SPI3 -> I2SCFGR |= SPI_I2SCFGR_DATFMT_LAlign;

Maybe you're just not aligning your data correctly. Are you sending 0xFFFFFF or 0xFFFFFF00? Regardless, try the other one. Or instead leave data right-aligned (default).

If you feel a post has answered your question, please click "Accept as Solution".
CLeo.1
Senior II

With a lot of alone time with the logic analyzer and a lot of more reading of the reference manual, I finally figured it out.

I am Sending 0x00 FF FF FF (32 Bits). Whats happening since its Left Align and DATLEN = 24 bits, it will read the first 3 bytes as its suggested in the RM0433 Pg.2227 Figure 638. When I switched the Left Align to Right Align the I2S Bus then produced 0xFF FF FF 00 where the zero is ignored.

So its been working correctly, just didn't understand it.