Hello!
Sounds like you are copying from and to internal SRAM? If so, it should be much faster. One possible reason is that the CPU is almost blocked with interrupt activity, or that you didn't manage to set the CPU clock generation as intended.
Yes, it's entirely in internal sram.
The CPU gets interrupts every millisecond because I want to use ST's PDM to PCM library, and this
latter is designed to process trunks of 1ms.
As I want 48 kHz output, I will have 48 samples at the end, and since the oversampling factor is
64, I have a microphone clock of 3.072 MHz (configured by CubeMX). I have setup a 24.576 MHz
crystal, and I generate the largest multiple, which 196.608 MHz. Once divided by 64 by a timer,
I get 3.072 MHz microphone clock that I can verify with the scope.
As I get the microphones in parallel on a GPIO, I get trunks of 3072 samples. And therefore I declare
a 6144 buffer, and I get an interrupt at half buffer and full buffer.
So most of the time, the CPU does nothing. And if I light a LED before the memcpy call and set it
off after, I can verify on the scope how long it takes. And it's very long. A possible approach will be
to use DMA to move bytes, but the problem will remain when rearranging (de-interleaving) the
pdm buffers.
Any hint to speed up things would be helpful.
Thanks,
Dora.