SPDIF Example for STM32F7?
FYI:
I have SPDIF Input working on STM32F7 Discovery board.
Actually, not so difficult to bring it up: all FW functions are there (in CubeF7).
Hints:
- use CubeMX in order to create a demo project for SPDIF. It generates almost all the code you need. Just modify some configs
- take the audio player from demo, e.g. stm32764g_discovery_audio.*
- configure SPDIF as: hSPDIFRX_IN0.Init.DataFormat = SPDIFRX_DATAFORMAT_32BITS;
it is needed for stereo over S/PDIF. Just: even your play 24bit over S/PDIF - just 2x16bit come into your FW (just 16bit stereo resolution)
- if SPDIF input buffer is half full - start DMA to SAI2 via: BSP_AUDIO_OUT_Play((uint16_t *)SPDIFIN0_RxBuf, (SPDIF_SAMPLE_NUM - 192) * 4);
- start the SPDIF Interrupt via: if (HAL_SPDIFRX_ReceiveDataFlow_IT(&hSPDIFRX_IN0, SPDIFIN0_RxBuf, SPDIF_SAMPLE_NUM) == HAL_OK)
- and let all running, in the background, no other calls (my mistake: do not start DMA and Play again),
it works in background: SPDIF Interrupt receives the audio data, DMA to SAI2 streams it out
It works !
Please see here: https://www.youtube.com/watch?v=k0vCi0mrIhI
Cool, now I have an USB and SPDIF input (front end) for my “Lyrebird True24” DAC: http://www.tjaekel.com/lyrebird/
If you need demo project for it: please visit: http://www.tjaekel.com/lyrebird/ and send me an email.