cancel
Showing results for 
Search instead for 
Did you mean: 

HAL I2S Receive DMA mode stuck in BUSY mode

jess
Associate II

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));

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Chief III

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".

View solution in original post

2 REPLIES 2
AScha.3
Chief III

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
Associate II

data width not configured correctly...