Skip to main content
jess
Associate
February 24, 2023
Solved

HAL I2S Receive DMA mode stuck in BUSY mode

  • February 24, 2023
  • 2 replies
  • 1662 views

On a stm32 mcu, using HAL_I2S_Receive_DMA the clock generation is started. At first, the application went into a hard fault and nothing is subsequently written in the data receive buffer.

HardFault_Handler:

08000942:  push  {r7}

08000944:  add   r7, sp, #0

 89     while (1)

08000946:  b.n   0x8000946 <HardFault_Handler+4>

I corrected some settings and now it is in BUSY mode which is fine. However, now the receive data buffer does not get filled. What is the reason that the receive data buffer doesn't get filled:

uint16_t i2s_receive_buffer[100];

HAL_I2S_Receive_DMA(&hi2s2, i2s_receive_buffer, sizeof(i2s_receive_buffer));

This topic has been closed for replies.
Best answer by AScha.3

i had big problems with I2S in slave mode: data in and out are exchanged and need to be switched back :  SPI1->CFG2 = 0x008000; // pin swap !!!!

next : it didnt work correct with 32b data - always something wrong with endianness, or wordclock in the middle of the 32bits - useless. but in 16b mode working fine.

then i tried SAI for I2S , here (until now) everything working as it should, 16..32b , master/slave ok.

so for your problem : check, is data in on the pin you use , maybe set in and out active, = full duplex, just to see the output (other miso/mosi is input then) ; or try using SAI .

2 replies

AScha.3
AScha.3Best answer
Super User
February 25, 2023

i had big problems with I2S in slave mode: data in and out are exchanged and need to be switched back :  SPI1->CFG2 = 0x008000; // pin swap !!!!

next : it didnt work correct with 32b data - always something wrong with endianness, or wordclock in the middle of the 32bits - useless. but in 16b mode working fine.

then i tried SAI for I2S , here (until now) everything working as it should, 16..32b , master/slave ok.

so for your problem : check, is data in on the pin you use , maybe set in and out active, = full duplex, just to see the output (other miso/mosi is input then) ; or try using SAI .

"If you feel a post has answered your question, please click ""Accept as Solution""."
jess
jessAuthor
Associate
February 25, 2023

data width not configured correctly...