cancel
Showing results for 
Search instead for 
Did you mean: 

Random glitch on I2S recordings

frnt
Senior

Hello,

I'm using an STM32 M4 for recording short audio signals through the I2S interface and I write the PCM to an SD card. To check that everything is fine I have recorded pure tones (1kHz or 2kHz). By doing that I noticed in some recordings (not all of them) some glitches in the audio signal. Can someone help understand why those glitches appear?

The reference manual reports that I2SxCLK frequency should be higher than the APB bus. In my case the APB is 16MHz and the I2SxCLK is 48MHz. Here is attached one of the 2s audio tracks recorded. Sometimes the glitch appears at the beginning of the track, some others later.

What else can generate this issue?

12 REPLIES 12
frnt
Senior

Dear @AScha.3​ ,

I'm already using micro SD from "good" source. I have tried SanDisk, Kingston with different sizes but the glitch still appears.

@Piranha​, I have 16kB in one RAM and 32kB in the other. The problem is that, the Radio stack requires quite some RAM. What I could do is modify the linker script in order to put the inizialized/unitialized data into RAM1 and use RAM2 for stack/heap in oder to have some more space for the DMA buffer. The problem is that allocating a PDM buffer large enough to store PDM data to produce 4kB of PCM, with 128 decimation I would need 16k uint16 for the buffer.

AScha.3
Chief II

about buffer size : simple calcutate : 100ms delay can happen, 16ks/32bit is to store, so 1,6 x4 = 6,4kB need to be buffered, to avoid any problem, when SD needs 100ms extra time buffer;

+ 512 B. for regular buffer itself.

if you dont have this buffer, change your system or your expectation (= accept dropouts).

If you feel a post has answered your question, please click "Accept as Solution".