2024-01-31 05:14 PM
Hi everyone, I hope someone can help me find or create a driver to communicate the tlv320aic3204 with the stm32f405 on my own custom board.
I have been trying to replicate this tutorial (STM32 I2S ADC DMA & Double Buffering - Digital Audio Processing with STM32 #4) but I have not been successful. Some parts of the audio driver are not shown, and my experience with i2s is very low.
All my code compiles and everything seems to be ok, however I noticed that apparently it's as if my stm had crashed, because I put a blink on my leds to happen in the while but they don't blink, but if I comment the function that configures the i2c and the i2s, then blink works.
I saw other posts that there were people here who managed to communicate this mcu with the codec, I wonder if anyone has released this project or would like to help me with this mission :grinning_face_with_sweat:
2024-01-31 05:46 PM
i2c boot code:
hi2c2.Instance = I2C2;
hi2c2.Init.ClockSpeed = 100000;
hi2c2.Init.DutyCycle = I2C_DUTYCYCLE_2;
hi2c2.Init.OwnAddress1 = 0;
hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
hi2c2.Init.OwnAddress2 = 0;
hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
if (HAL_I2C_Init(&hi2c2) != HAL_OK)
{
Error_Handler();
}
i2s boot code:
/* USER CODE END I2S2_Init 1 */
hi2s2.Instance = SPI2;
hi2s2.Init.Mode = I2S_MODE_MASTER_TX;
hi2s2.Init.Standard = I2S_STANDARD_PHILIPS;
hi2s2.Init.DataFormat = I2S_DATAFORMAT_16B;
hi2s2.Init.MCLKOutput = I2S_MCLKOUTPUT_ENABLE;
hi2s2.Init.AudioFreq = I2S_AUDIOFREQ_48K;
hi2s2.Init.CPOL = I2S_CPOL_LOW;
hi2s2.Init.ClockSource = I2S_CLOCK_PLL;
hi2s2.Init.FullDuplexMode = I2S_FULLDUPLEXMODE_ENABLE;
if (HAL_I2S_Init(&hi2s2) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN I2S2_Init 2 */