SPDIF Example for STM32F7?
As your problem is related to ST-provided firmware you should look at STM32 Software Tools and Firmware.
For more low-level STM32 hardware questions, you may also look at STMicroelectronics e2e Communities.
Sorry not being able to be more useful,
Bernard