Hello I am using STM32F746 discovery board and trying to transfer data in PCM format using I2S protocol provided
Hello
I am using STM32F746 discovery board and trying to transfer data in PCM format using I2S protocol provided.
I have configured for below mentioned settings
hi2s2.Instance = SPI2;
hi2s2.Init.Mode = I2S_MODE_MASTER_TX;
hi2s2.Init.Standard = I2S_STANDARD_PCM_SHORT;
hi2s2.Init.DataFormat = I2S_DATAFORMAT_16B;
hi2s2.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;
hi2s2.Init.AudioFreq = I2S_AUDIOFREQ_32K;
hi2s2.Init.CPOL = I2S_CPOL_LOW;
hi2s2.Init.ClockSource = I2S_CLOCK_PLL;
after successfully configuring when I am trying to transmit the data using
ret = HAL_I2S_Transmit(&hi2s2, &dum, 1, 100);
it is giving error in
// /* Wait until TXE flag is set */
if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXE, SET, Timeout) != HAL_OK)
{
/* Set the error code */
SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT);
hi2s->State = HAL_I2S_STATE_READY;
__HAL_UNLOCK(hi2s);
return HAL_ERROR;
}
the TXE is not setting and hence the transfer of the data is not happening within the given timeout.
Please help me out in this its very urgent
