2023-02-24 02:28 PM
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));
Solved! Go to Solution.
2023-02-24 11:24 PM
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 .
2023-02-24 11:24 PM
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 .
2023-02-25 05:03 AM
data width not configured correctly...