I'm using an STM32H7 and looking to sample a digital signal at ~6MHz directly into memory with periodic interrupts? I've seen an approach using a DMA read from the GPIO ODR address but this would seem to sample as fast as the DMA can read from the peripheral. Using a timer interrupt its possible to achieve 2MHz+ but these interrupts are costly from the perspective of CPU time as they are occurring at the sampling rate.
Is there another approach I'm missing or not understanding, such as abusing I2S, that could permit a ~6MHz sampling frequency into a memory buffer in batches of hundreds of samples? This would permit the CPU to crunch on the bitstream while the hardware continued to fill the next samples buffer.
It's possible to change to other chips in the STM32 family or another SoC all together if it helps solve this problem.