2025-05-20 1:42 AM
Hi, I have an STM32F407-DISC1 connected to an Raspberry PI via I2S. The clock frequency is about 3MHz. The STM is receiving as slave on I2S2 and feeding data to a ring buffer. When the ring buffer is half full transmission on I2S3 is started (as slave). I meassure the timing between the two DMAs with __HAL_DMA_GET_COUNTER(hi2s2.hdmarx) and __HAL_DMA_GET_COUNTER(hi2s3.hdmatx). With this approach I am expecting to have a constant delay of one half buffer length between the two channels but the delay are slowly decreasing. Does anyone know why this is happen and if there is a solution.
This software is to test the data path. Next i will use an external low noise ocillator to drive I2S3 (as master). The external ocillator will drift compared to the bit clock from the PI and the buffer shall be deep enough to absorb the drift.