SAI(audio interface) issue on STM32F7 MCU
- November 25, 2017
- 6 replies
- 1734 views
Hi.,
I am working on STM32F7 evolution board(Nucleo-F767ZI ) to interface external audio kit through SAI interface , I configured and got SAI drivers with STM cubeMX , The STM board is configured in Master mode with one block as transmitter and another as receiver(one block is working synchronously with another block ) and enabled the DMA to receive & transmit.
I can able to transmit data through SAI interface , but problem is with receiving . I am getting data for the first time through DMA , then onwards no data is receiving , same time I checked signals on board(FS,SCK & SD) all are coming but data is not receiving in to buffer. If I call SAI_DMAAbort() and then call receive function again data is receiving. What could be the problem. Should I need to abort DMA all the time or what.
SAI configurations:
hsai_BlockA1.Instance = SAI1_Block_A;
hsai_BlockA1.Init.AudioMode = SAI_MODEMASTER_TX; hsai_BlockA1.Init.Synchro = SAI_ASYNCHRONOUS; hsai_BlockA1.Init.OutputDrive = SAI_OUTPUTDRIVE_ENABLE; hsai_BlockA1.Init.NoDivider = SAI_MASTERDIVIDER_ENABLE; hsai_BlockA1.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_1QF; hsai_BlockA1.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_48K; hsai_BlockA1.Init.SynchroExt = SAI_SYNCEXT_DISABLE; hsai_BlockA1.Init.MonoStereoMode = SAI_STEREOMODE; hsai_BlockA1.Init.CompandingMode = SAI_NOCOMPANDING; hsai_BlockA1.Init.TriState = SAI_OUTPUT_NOTRELEASED; if (HAL_SAI_InitProtocol(&hsai_BlockA1, SAI_I2S_STANDARD, SAI_PROTOCOL_DATASIZE_24BIT, 2) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); }hsai_BlockB1.Instance = SAI1_Block_B;
hsai_BlockB1.Init.AudioMode = SAI_MODESLAVE_RX; hsai_BlockB1.Init.Synchro = SAI_SYNCHRONOUS; hsai_BlockB1.Init.OutputDrive = SAI_OUTPUTDRIVE_DISABLE; hsai_BlockB1.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_1QF; hsai_BlockB1.Init.SynchroExt = SAI_SYNCEXT_DISABLE; hsai_BlockB1.Init.MonoStereoMode = SAI_STEREOMODE; hsai_BlockB1.Init.CompandingMode = SAI_NOCOMPANDING; hsai_BlockB1.Init.TriState = SAI_OUTPUT_NOTRELEASED; if (HAL_SAI_InitProtocol(&hsai_BlockB1, SAI_I2S_STANDARD, SAI_PROTOCOL_DATASIZE_24BIT, 2) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); }I have attached function calling detail documents for reference.
#nucleo-f767zi #stm32f7