Receiving Zeros via SPDIF with STM32F446 does not work
I'm using an STM32F446RE to receive data via SPDIF. This works well with the following initialisation:
hspdif.Instance = SPDIFRX;
hspdif.Init.InputSelection = SPDIFRX_INPUT_IN0;
hspdif.Init.Retries = SPDIFRX_MAXRETRIES_15;
hspdif.Init.WaitForActivity = SPDIFRX_WAITFORACTIVITY_ON;
hspdif.Init.ChannelSelection = SPDIFRX_CHANNEL_A;
hspdif.Init.DataFormat = SPDIFRX_DATAFORMAT_MSB;
hspdif.Init.StereoMode = SPDIFRX_STEREOMODE_ENABLE;
hspdif.Init.PreambleTypeMask = SPDIFRX_PREAMBLETYPEMASK_OFF;
hspdif.Init.ChannelStatusMask = SPDIFRX_CHANNELSTATUS_OFF;
hspdif.Init.ValidityBitMask = SPDIFRX_VALIDITYMASK_OFF;
hspdif.Init.ParityErrorMask = SPDIFRX_PARITYERRORMASK_OFF;
if (HAL_SPDIFRX_Init(&hspdif) != HAL_OK)...and with the following code (just some snippets to demonstrate what is going on):
void HAL_SPDIFRX_RxCpltCallback(SPDIFRX_HandleTypeDef *hspdif)
{
spdifRecvComplete=1;
}
...
if (HAL_SPDIFRX_ReceiveDataFlow_IT(&hspdif,recvBuffer[currBuff],spdifBufferSize)==HAL_OK)
{
spdifRecvComplete=0;
currBuff=1-currBuff;
}
...
while (1)
{
if (spdifRecvComplete)
{
if (HAL_SPDIFRX_ReceiveDataFlow_IT(&hspdif,recvBuffer[1-currBuff],spdifBufferSize)==HAL_OK)
{
spdifRecvComplete=0;
...Within my recvBuffer I can see the received audio data in the upper 20 bits and the flags/auxiliary bits in the lower 12 bits of the 32bit received data.
But when the incoming data except the Valid-bit all are 0 (means the device on the other end has 0 at Aux, Data and the flags except "Valid"), the interrupt never happens. The preamble of course is still valid, so that proper frames can be detected:
So shouldn't this also cause an interrupt to occur when there are enough SPDIF-frames detected? Or is there something special needed in order to receive such 0-data-frames too?
Thanks
