Skip to main content
Associate III
January 23, 2024
Solved

STM32H723ZG DMA I2S - tx works, no RX

  • January 23, 2024
  • 1 reply
  • 3044 views

Hello

I've seen tons of posts about this, I'm hoping I'm just missing something simple, I would really love to get this working. 

STM32H723ZG, DMA TX works, I can send a sine wave fine but the RX buffer never changes and is never filled. 

I've put the RX and TX buffers in D2RAM but this seems to make no difference. 

DMA half and complete callbacks trigger fine, everything else seems to be running right the RX just wont fill. 

I2S = 96khz, 32bit on a 32bit frame, 
DMA= half word, circular 

 

__attribute__ ((section(".rxBuffer"), used)) __attribute__ (()) uint16_t rxBuf[8];

__attribute__ ((section(".txBuffer"), used)) __attribute__ (()) uint16_t txBuf[8];

 

 

HAL_I2SEx_TransmitReceive_DMA (&hi2s2, txBuf, rxBuf, 4);

 

 

//in flash file

.buffers(NOLOAD) :

{

. = ALIGN(4);

. = ABSOLUTE (0x30000000);

*(.rxBuffer)

. = ABSOLUTE (0x30000040);

*(.txBuffer)

} >RAM_D2

 

This topic has been closed for replies.
Best answer by MatthewsEffects

If the DMA data width is not set to "Word" (was using "Half-Word" like in my previous working project) then the rx just shows 0's. When switched to word the data populates correctly. 

1 reply

AScha.3
Super User
January 23, 2024

Hi,

Just - why you have the buffers in int16 , but use int32 ?

(I do very similar, playing I2S to a DAC in int32. + also use D2 ram for buffers - same idea.)

I use int32 arrays, but had no success on H743ZI with I2S, so using SAI with I2S format, this running perfect.

The I2S worked with 16 bit format, but with 32bit (sometimes !!) wrong , looked like hi and lo 16bits puzzled.

With SAI no problem, 16 or 32 bit format.

So i would recommend : try with int32 (and word transfer) ; and try with SAI ...

+

HAL_I2SEx_TransmitReceive_DMA() with (so small) size 4 ?? I have the full buffer here, 16KB size.

Otherwise not enough time to prepare buffers . 

+

Switch off D-cache (or : not enable in Cube) , if you have not yet cache management :)

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate III
January 23, 2024

Just - why you have the buffers in int16 , but use int32 ?

The data is 24bit on a 32bit frame, I saw in some other forum posts that h7 wont access the data correctly if its set to 24bit on a 32bit frame and to just choose 32bit frame. they are int16 since its set to half word. I did try changing it to int32 and DMA to "Word" but no difference. Still no data gets into rx, tx is working fine. 

had no success on H743ZI with I2S, so using SAI with I2S format, this running perfect.

I'm "newer" to i2s so not really sure how to set that up, any good examples you recommend? If that works better I'd happily use that. 

 

The thing stumping me is why the TX works fine but the RX doesn't. 

AScha.3
Super User
January 23, 2024

So you giving 16b to the dma, to write 32b to the I2S ? Surprising me, this is working.

Check with a scope, what data is on tx + rx , maybe there is zero... 

And 

 

HAL_I2SEx_TransmitReceive_DMA() with (so small) size 4 ? Why?

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