Hello,
I review the code about the s_buffer and I suggest changing the size of the buffer in macro [BUFFER_SIZE] to 2 bytes.
if (s_bufferValidBlock > 0)
{
pdmXfer.data = (uint8_t *)((uint32_t)s_buffer + s_readIndex * BUFFER_SIZE);
pdmXfer.dataSize = BUFFER_SIZE;
pdmXfer.linkTransfer = NULL;
if (kStatus_Success == PDM_TransferReceiveEDMA(DEMO_PDM, &s_pdmRxHandle, &pdmXfer))
{
s_readIndex++;
}
if (s_readIndex == BUFFER_NUMBER)
{
s_readIndex = 0U;
}
}
I hope this works for your application if you need more information please let me know.
Best regards,
Pavel