cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 record SPDIF data to SD card

庭張.1
Associate

Hi,

I'm trying to use a STM32F746 to record SPDIF_Rx to SD card. I'm already got some data and save to SD card.

I use HAL_SPDIFRX_ReceiveDataFlow_DMA(&hspdif, (uint32_t*)&BufferCtl.pcm_buff_32[0], AUDIO_IN_PCM_BUFFER_HALF_SIZE)and HAL_SPDIFRX_RxHalfCpltCallback(), HAL_SPDIFRX_RxCpltCallback() to get pcm_buff_32 data.

But the data have some not expected data in save data. So I'm check the data receive in debug mode. I find that HAL_SPDIFRX_RxHalfCpltCallback and HAL_SPDIFRX_RxCpltCallback always get all buffer size. I remember that HalfCpltCallback only get half of buffer size, if it get all size that means some data will lose when I save data?

By the way, I try HAL_DMAEx_MultiBufferStart_IT() in HAL_SPDIFRX_ReceiveDataFlow_DMA, but what I seem XferHalfCpltCallback(), XferM1HalfCpltCallback(), XferCpltCallback(), XferM1CpltCallback() all of the callback get all buffer size.

I hope some one can help me to do double buffer save SPDIF_RX data.

Thanks all.

0 REPLIES 0